Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 18.117.188.138
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//UnAccounted-lost-pharmacy.php
 <?php
session_start();
require_once('../DBManager.php');
require_once('../LoginManager.php');
require_once('../patientmanager.php');
include 'workdeskmenu.php';
include 'header.php';
include("dbconnection.php");
if(isset($_POST['save'])){
    
    $inventory_id=$_POST['inventory_id'];
    $Batch_number=$_POST['Batch_number'];
    $medicine_id=$_POST['medicine_id'];
    $admin_id=$_POST['admin_id'];
    $updated_at=date("F d, Y / h:i:s A");
    $created_at=date("F d, Y / h:i:s A");
    $UnAccounted=$_POST['UnAccounted'];
    if($UnAccounted=='Add'){
        $AddQuantity=$_POST['TQuantity'];
        $Quantity=$_POST['Quantity'];
        $Increase=$_POST['Increase'];
    }
    if($UnAccounted=='Subs'){
        $AddQuantity=$_POST['SubsTQuantity'];
         $Quantity=$_POST['SubsQuantity'];
        $Increase=$_POST['Decrease'];
    }
    date_default_timezone_set('Asia/Calcutta'); 
$date= date('Y-m-d'); // time in India
    
    $UnAccounted=$con->query("INSERT INTO `UnAccounted`(`Quantity`, `type`, `Calculator`, `totalVal`, `Batch_number`, `inventory_id`, `medicine_id`, `admin_id`,`acc_loss_date`, `created_at`, `updated_at`) VALUES ('$Quantity','$UnAccounted','$AddQuantity','$Increase','$Batch_number','$inventory_id','$medicine_id','$admin_id','$date','$created_at','$updated_at')");
    echo $UnAccounted;
    if($UnAccounted==1){
        echo "<script>alert('Successfully.....');</script>";
        header('Location:UnAccounted-lost-pharmacy.php');
    }
}


if(isset($_POST['save'])){
    
    $inventory_id=$_POST['inventory_id'];
    $Batch_number=$_POST['Batch_number'];
    $medicine_id=$_POST['medicine_id'];
    $admin_id=$_POST['admin_id'];
    $updated_at=date("F d, Y / h:i:s A");
    $created_at=date("F d, Y / h:i:s A");
    $UnAccounted=$_POST['UnAccounted'];
    if($UnAccounted=='Add'){
        $AddQuantity=$_POST['TQuantity'];
        $Quantity=$_POST['Quantity'];
        $Increase=$_POST['Increase'];
    }
    if($UnAccounted=='Subs'){
        $AddQuantity=$_POST['SubsTQuantity'];
         $Quantity=$_POST['SubsQuantity'];
        $Increase=$_POST['Decrease'];
    }
    
    
    
    $inventory=$con->query("UPDATE `medicine_inventory` SET `totalQuatity`='$Increase' WHERE `inventory_id`='$inventory_id' AND `Batch_number`='$Batch_number'");
    echo $inventory;
    if($inventory==1){
        echo "<script>alert('Inventory Successfully.....');</script>";
        header('Location:UnAccounted-lost-pharmacy.php');
    }
    
    
   
}
?> 
   <div class='content-wrapper'>
    <!-- Content Header (Page header) -->
    <section class='content-header'>


<?php
session_start();
include("dbconnection.php");
require_once('../DBManager.php');
require_once("../LoginManager.php");
require_once('../patientmanager.php');
?>
 
<!DOCTYPE html>
<html>  <head>
    <title>Medicine in Stock</title>
    <style>
      .modal {
        display: none;
        position: fixed;
        z-index: 8;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgb(0, 0, 0);
        background-color: rgba(0, 0, 0, 0.4);
      }
      .modal-content {
        margin: 50px auto;
        border: 1px solid #999;
        width: 60%;
      }
      h2,p {
        margin: 0 0 20px;
        font-weight: 400;
  
      }     
     .form1 {
        padding: 25px;
        margin: 25px;
        box-shadow: 0 2px 5px #f5f5f5;
        background: #eee;
      }
      input,
      textarea, select {
        width: 100%;
        padding: 6px;
        margin-bottom: 20px;
        border: 1px solid #1c87c9;
        outline: none;
      }
      .contact-form button {
        width: 100%;
        padding: 10px;
        border: none;
        background: #1c87c9;
        font-size: 16px;
        font-weight: 400;
        color: #fff;
      }
      button:hover {
        background: #2371a0;
      }
      .close {
        color: #aaa;
        float: right;
        font-size: 58px;
        font-weight: bold;
      }
      .close:hover,
      .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
      }
      button.button {
        display: inline-block;
       
        border-bottom: #02274a 1px solid;
     
        font-size: 19px;
        cursor: pointer;
      }
      
      button.button:hover {
    
        border-bottom: #a99567 1px solid;
        color: #a99567;
      }
      
    </style>
      <style>

 
/* Automatic Serial Number Row */
.css-serial {
 counter-reset: serial-number; /* Set the serial number counter to 0 */
}
.css-serial td:first-child:before {
 counter-increment: serial-number; /* Increment the serial number counter */
 content: counter(serial-number); /* Display the counter */
}
</style>
<style>
    .box{
       
        padding: 20px;
        display: none;
        margin-top: 20px;
    }
  
    
</style>
<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>

  </head>
  <body>
      
   <div id="text2"  >
          
                
                 <form action="" method="GET">
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>From Date</label>
                                        <input type="date" name="from_date" value="<?php if(isset($_GET['from_date'])){ echo $_GET['from_date']; } ?>" class="form-control">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>To Date</label>
                                        <input type="date" name="to_date" value="<?php if(isset($_GET['to_date'])){ echo $_GET['to_date']; } ?>" class="form-control">
                                    </div>
                                </div>
             <!--                   <div class='col-md-3'>-->
             <!--                       <div class="form-group">-->
             <!--                            <label>Payment Mode</label>-->
             <!--                       <select name='paymentmode' required="true">-->
             <!--                           <option value="">--Select--</option>-->
             <!--<option value='Cash'<?php //echo ($_GET['paymentmode']=='Cash')? 'selected':''; ?>>Cash</option>-->
             <!-- <option value='Card' <?php //echo ($_GET['paymentmode']=='Card')? 'selected':''; ?>>Card</option>-->
             <!--  <option value='UPI' <?php //echo ($_GET['paymentmode']=='UPI')? 'selected':''; ?>>UPI</option>-->
             <!--</select></div>-->
             <!--                   </div>-->
                                <div class="col-md-3">
                                    <div class="form-group">
                                    <br>
                                      <button type="submit" class="btn btn-primary">Apply</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                        
                        </div>
                         <button style='height:40px;width:200px' onclick="location.href='UnAccounted-lost-pharmacy.php'" type="button"> <span style="color:white">    Reset</span></button>
                                 </section>
          
        
    <h2 Align="center">UnAccounted-lost </h2>
    
 <form>
        <table id="myTable"  class="order-table table table-bordered table-hover css-serial">
                  <thead>
         
						<tr>
						    <th>SR No</th>
						    <th>Medicine Details</th>
						     <th>Towards</th>
							<th>Action</th>
						</tr>
				
      
                  </thead>
   <?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))
		{
		       if(isset($_GET['from_date']) && isset($_GET['to_date']))
                                {
                                    $from_date = $_GET['from_date'];
                                    $to_date = $_GET['to_date'];
}
$sql78 ="SELECT count(id) FROM UnAccounted Where admin_id ='$re[userno]' AND date(acc_loss_date) BETWEEN '$from_date1' AND '$to_date1'";
$result45=mysqli_query($con,$sql78);
$row1=mysqli_fetch_array($result45);


echo"<p align='right'  style='color:red;'><b>From Date</b> $_GET[from_date] -<b>TO</b> $_GET[to_date]</p>";
if($row1['id']=='0')
{

    echo"<h1 align='center'>
  No Record Found</h1>";
}

mysqli_close($con);
}
?>                  
                
                  
<?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))
		{
		  
		   $from_date=$_GET['from_date'];
		    $to_date=$_GET['to_date'];
		    
		    
		    
		    $from_date1 = (isset($from_date) ? $from_date : '');
		    $to_date1 = (isset($to_date) ? $to_date : '');
		      
		    
$sql ="SELECT * FROM medicine_stok WHERE admin_id='$re[entered_by]' AND status='1' order by medicine_id DESC";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
      $sql121="SELECT * FROM medicine_inventory WHERE medicine_id='$rs[medicine_id]'";
            $result1 = $con->query($sql121);
            while($row1 = mysqli_fetch_array($result1)){
                
                
           
if($from_date1 && $to_date1){
 $unaccounted=$con->query("SELECT * FROM UnAccounted Where inventory_id ='$row1[inventory_id]' AND Batch_number='$row1[Batch_number]'");
   
} 
else{
     $unaccounted=$con->query("SELECT * FROM UnAccounted Where inventory_id ='$row1[inventory_id]' AND Batch_number='$row1[Batch_number]'  AND date(acc_loss_date) BETWEEN '$from_date1' AND '$to_date1'");

}
$RowAcc=$unaccounted->fetch_assoc();
//while($RowAcc=$unaccounted->fetch_assoc()){
                
            echo " <tbody>
            <tr>    
            <td>&nbsp;</td>
            <td> 
            <b>Drug : </b>$rs[DRUGS_name]
           
            <br><b>Category : </b>$rs[Category]
            <br><b>Size : </b>$rs[size]<br>
            
            <b>Batch No</b>:- $row1[Batch_number] <br>

<b> Quantity</b>:- $row1[totalQuatity]<br>
<b> Date</b>:- $rs[created_at]<br>

            </td><td>
            ";
         
            
            
    
 ?>
 
 <?php
 $unaccounted=$con->query("SELECT * FROM `UnAccounted` Where inventory_id ='$row1[inventory_id]' AND Batch_number='$row1[Batch_number]'");
 while($row_accounted = $unaccounted->fetch_array()){
 
 if($row_accounted[type]=='Add'){
     $Calculator=$row_accounted['Calculator'];
     $a="UnAccounted/Extra";
 }
 if($row_accounted[type]=='Subs'){
     $Calculator=$row_accounted['Calculator'];
     $a="lost/Missing";
 }
 
 
    echo $a.' ='.$Calculator.'<br><br>';

     
}
                
       
   ?>
              
                  <?php 
  
  
echo "<br>



<input name='Quantity[]' id='Quantity' class='Quantity$rs2[medicine_id]' type='hidden' value='$row1[totalQuatity]' /> <br>";



?>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
  <script>
             
              var table3 = document.getElementById("myTable"), sumQuantity = 0;
            
           $(".Quantity<?php echo $rs2['medicine_id']; ?>").each(function() {
                    sumQuantity += Number($(this).val());
                    console.log(sumQuantity);
                   
                 });
            document.getElementById("AddQuantity<?php echo $rs2['medicine_id']; ?>").innerHTML = "" + sumQuantity;
            $('#AddQuantity').val(sumQuantity)
            console.log(sumQuantity);
          
        </script> 
<?php
  
 ?>
 
 <?php
 echo"</td><td>
  <a class='modalLink' href='#myModal' data-toggle='modal' data-target='#myModal$row1[Batch_number]' >
              <i class='fa fa-pencil' aria-hidden='true' style='color:green; font-size:20px;'></i>
            </a></td></tr>";
?>

 <!-- Modal -->
 <div class="modal fade" id="myModal<?php echo $row1['Batch_number']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style='float:right;'>&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">UnAccounted-lost</h4>
        </div>
        <form  method='post'>
        <div class="modal-body">
               <input type='hidden' value='<?php echo $row1['Batch_number']; ?>' name='Batch_number'/>
            
            <input type='hidden' value='<?php echo $row1['inventory_id']; ?>' name='inventory_id'/>
            <input type='hidden' value='<?php echo $rs['medicine_id']; ?>' name='medicine_id'/>
            <input type='hidden' value='<?php echo $rs['admin_id']; ?>' name='admin_id'/>
            
            
            
            <div class='row' style='padding:5px;'>
                <div class='col-sm-4'>Towards</div>
                <div class='col-sm-8'><select name='UnAccounted'>
           <option value="">Select</option>
            <option value="Add">UnAccounted/Extra</option>
            <option value="Subs">lost/Missing</option>
           
        </select> 
                </div>
          </div>
            
             <div class="Add box">
       <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Quantity" style='width:25%;'>Quantity</label></div>
                <div class='col-sm-8'> <input   type="text" name="Quantity" id='Quantity<?php echo $row1['Batch_number']; ?>' value='<?php echo $row1['totalQuatity'];  ?>' readonly  onkeyup='sum<?php echo $row1['Batch_number']; ?>();'/></div>
            </div>
            <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Quantity" style='width:25%;'>Calculator</label></div>
                <div class='col-sm-8'> <input   type="number" name="TQuantity" id='TQuantity<?php echo $row1['Batch_number']; ?>'   onkeyup='sum<?php echo $row1['Batch_number']; ?>();' placeholder="Mention Difference "/>
               
                </div>
            </div>
                
            <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Increase" style='width:25%;'>Updated </label></div>
                <div class='col-sm-8'> <input  type="number" name="Increase" id='Increase<?php echo $row1['Batch_number']; ?>' onkeyup='sum<?php echo $row1['Batch_number']; ?>();' readonly/></div>
            </div>
           
    </div> 
    
    <!--substraction-->
    
    
    <div class="Subs box">
          <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Quantity" style='width:25%;'>Quantity</label></div>
                <div class='col-sm-8'> <input   type="text" name="SubsQuantity" id='SubsQuantity<?php echo $row1['Batch_number']; ?>' value='<?php echo $row1['totalQuatity'];  ?>' readonly  onkeyup='Sub<?php echo $row1['Batch_number']; ?>();'/></div>
            </div>
            <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Quantity" style='width:25%;'>Calculator</label></div>
                <div class='col-sm-8'> <input   type="number" name="SubsTQuantity" id='SubsTQuantity<?php echo $row1['Batch_number']; ?>'   onkeyup='Sub<?php echo $row1['Batch_number']; ?>();' placeholder="Mention Difference "/>
               
                </div>
            </div>
                
            <div class='row' style='padding:5px;'>
                <div class='col-sm-4'><label for="Increase" style='width:25%;'>Updated</label></div>
                <div class='col-sm-8'> <input  type="number" name="Decrease" id='SubsDecrease<?php echo $row1['Batch_number']; ?>' onkeyup='Sub<?php echo $row1['Batch_number']; ?>();' readonly/></div>
            </div>
           
    </div>
            
            
            
            
            
             
            
             
         
             
        
        </div>
        <div class="modal-footer">
            <button type="submit" name='save' class="btn btn-primary" style='width:25%;'>Save</button>
            <button type="button" class="btn btn-default" data-dismiss="modal" style='width:25%;'>Close</button>
        </div>
        </form>
      </div>
    </div>
  </div>
   <script>
    function sum<?php echo $row1['Batch_number']; ?>() {
            var txtFirstNumberValue = document.getElementById('Quantity<?php echo $row1['Batch_number']; ?>').value;
            var txtSecondNumberValue = document.getElementById('TQuantity<?php echo $row1['Batch_number']; ?>').value;
            
               var result =    parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue);
               
            if (!isNaN(result)) {
                document.getElementById('Increase<?php echo $row1['Batch_number']; ?>').value = result;
            }
           
        }
        
  
             </script>
             
             
              <script>
    function Sub<?php echo $row1['Batch_number']; ?>() {
            var SubsQuantity = document.getElementById('SubsQuantity<?php echo $row1['Batch_number']; ?>').value;
            var SubsTQuantity = document.getElementById('SubsTQuantity<?php echo $row1['Batch_number']; ?>').value;
            
               var SubResult =    parseInt(SubsQuantity) - parseInt(SubsTQuantity);
               
            if (!isNaN(SubResult)) {
                document.getElementById('SubsDecrease<?php echo $row1['Batch_number']; ?>').value = SubResult;
            }
           
        }
        
  
             </script>
<?php        
//}
}
  
}}
?>    </tbody>
  <tfoot>
          </tfoot>
        </table>
  </form>
  </body>
</html>

     
          
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

         

Anon7 - 2022
AnonSec Team