Server IP : 162.240.98.243 / Your IP : 18.225.235.144 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 : |
<?php session_start(); require_once('../DBManager.php'); require_once('../LoginManager.php'); require_once('../patientmanager.php'); include 'workdeskmenu.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"> <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]' AND cotegory='Consumable Product'"); 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='Consumable_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>Consumable Details</th> <th>Vendor</th> <th>Status</th> <th>Action</th> </tr> <?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']; $list_vendor=$_GET['list_vendor']; } $sql78 ="SELECT cat.crid,cat.subCat,pi.dateOfPurchase,pi.cmrp,pi.qty,pi.purchase_id,pi.entered_by,pi.batchNo,pi.totalQty,ms.ConsumableName, lv.name,ms.admin_id,ms.Category,pi.vendor,pi.consumable_id,pi.invoice_id,lv.emailid,lv.vid FROM consumable_stock AS ms INNER JOIN consumable_purchase_invoice AS pi ON ms.Consumable_id = pi.consumable_id INNER JOIN list_vendor AS lv ON lv.vid = pi.vendor INNER JOIN category AS cat ON cat.crid = ms.Category Where ms.admin_id='$re[entered_by]' AND date(pi.dateOfPurchase) BETWEEN '$from_date1' AND '$to_date1' AND pi.vendor='$list_vendor1'"; $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[0]=='0') { echo"<h1 align='center'> No Record Found</h1>"; } mysqli_close($con); } ?> </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 cat.crid,cat.subCat,pi.dateOfPurchase,pi.cmrp,pi.qty,pi.purchase_id,pi.entered_by,pi.batchNo,pi.totalQty,ms.ConsumableName, lv.name,ms.admin_id,ms.Category,pi.vendor,pi.consumable_id,pi.invoice_id,lv.emailid,lv.vid FROM consumable_stock AS ms INNER JOIN consumable_purchase_invoice AS pi ON ms.Consumable_id = pi.consumable_id INNER JOIN list_vendor AS lv ON lv.vid = pi.vendor INNER JOIN category AS cat ON cat.crid = ms.Category Where ms.admin_id='$re[entered_by]' AND date(pi.dateOfPurchase) BETWEEN '$from_date1' AND '$to_date1' AND pi.vendor='$list_vendor1'"; } if($from_date1=='' && $to_date1=='' && $list_vendor1==''){ $sql ="SELECT cat.crid,cat.subCat,pi.dateOfPurchase,pi.cmrp,pi.qty,pi.purchase_id,pi.entered_by,pi.batchNo,pi.totalQty,ms.ConsumableName, lv.name,ms.admin_id,ms.Category,pi.vendor,pi.consumable_id,pi.invoice_id,lv.emailid,lv.vid FROM consumable_stock AS ms INNER JOIN consumable_purchase_invoice AS pi ON ms.Consumable_id = pi.consumable_id INNER JOIN list_vendor AS lv ON lv.vid = pi.vendor INNER JOIN category AS cat ON cat.crid = ms.Category Where ms.admin_id='$re[entered_by]'"; } $qsql = mysqli_query($con,$sql); while($rs = mysqli_fetch_array($qsql)) { if($rs['Category']==$rs['crid']){ $pricetotal1=$rs[cmrp]*$rs['qty']; //$pricetotal1=$sizefinal*$rsp2[qtygiven]; $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[ConsumableName] <br><b>Batch Number : </b>$rs[batchNo] <br><b>Date Of Purchase : </b>$rs[dateOfPurchase] <br><b> Invoice No : </b>$rs[invoice_id] <br><b>Cost : </b>$rs[cmrp] <br><b>Qty : </b>$rs[qty] <br>($rs[totalQty] $rs[subCat]) </td> <td>$rs[name] <br>$rs[emailid]</td> <td>"; $PInvoice=$con->query("SELECT * FROM consumable_purchasereport WHERE Batch_number='$rs[batchNo]' 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 `consumable_purchase_return` WHERE `batchNo`='$RPInvoice[Batch_number]' AND `vendor`='$RPInvoice[vendor]' AND pid='$RPInvoice[conumable_report_id]'"); while($RowReturnAmt=$ReturnAmt->fetch_array()){ $sqlpatient2 = "SELECT * FROM consumable_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 consumable_purchasereport WHERE Batch_number='$rs[batchNo]' AND vendor='$rs[vendor]'"); $RPInvoice=$PInvoice->fetch_array(); if($RPInvoice['status']=='1') { echo " <a class='tooltiplink' data-title='View' href='consumable_purchase_timeline.php?consumable_id=$rs[consumable_id]&invoice_id=$rs[invoice_id]&vendor=$rs[vid]&pid=$RPInvoice[conumable_report_id]'> <i class='fa fa-eye' style='font-size:20px;'></i> </a> | <a class='tooltiplink' data-title='Return' href='consumable_Return_purchase_invoice.php?consumable_id=$rs[consumable_id]&invoice_id=$rs[invoice_id]&vendor=$rs[vid]&pid=$RPInvoice[conumable_report_id]'> <i class='fa fa-undo' aria-hidden='true' style='color:#971B01'></i> </a>"; } else { echo " <a class='tooltiplink' data-title='View' href='consumable_purchase_invoice.php?consumable_id=$rs[consumable_id]&invoice_id=$rs[invoice_id]&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> <b><i class='fa fa-inr'></i> <span align='right' id='val'></b></span></div> <div class='col-sm-6'> <lable>GST :-</lable> <b><i class='fa fa-inr'></i> <span align='right' id='GSTval'></b></span></div> <div class='col-sm-6'> <lable>Return Amt :-</lable> <b><i class='fa fa-inr'></i> <span align='right' id='ReturnValue'></b></span></div> <div class='col-sm-6'> <lable>GST (Return) :-</lable> <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> <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> <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>