Server IP : 162.240.98.243 / Your IP : 3.144.113.163 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 : |
<?php session_start(); include("../dbconnection.php"); require_once('../../DBManager.php'); require_once("../../LoginManager.php"); require_once('../../patientmanager.php'); include("header.php"); include("menu.php"); if(isset($_POST[opdmedicine])) { PatientManager::Consumable_inventory("$_GET[Consumable_id]","$_POST[invoice_no]","$_POST[dateOfPurchase]","$_POST[Vendor]","$_POST[date_invoice]","$_POST[cmrp]","$_POST[batchno]","$_POST[HSN]","$_POST[mrp]","$_POST[gst]","$_POST[qty]","$_POST[totalQty]","$_POST[expiryDate]","$_POST[entered_by]"); } ?> <?php include("../dbconnection.php"); if(isset($_GET[delid])) { $sql ="DELETE FROM consumable_inventory WHERE inventory_id='$_GET[delid]'"; $qsql=mysqli_query($con,$sql); if(mysqli_affected_rows($con) == 1) { echo "<script>alert('Deleted successfully..');</script><script> window.history.go(-1)</script>;</script>"; } } if(isset($_GET[Vendor]) && isset($_GET[Consumable_id]) && isset($_GET[invoice])) { $PI ="DELETE FROM consumable_purchase_invoice WHERE vendor='$_GET[Vendor]' AND invoice_id='$_GET[invoice]' AND Consumable_id='$_GET[Consumable_id]'"; $qPI=mysqli_query($con,$PI); if(mysqli_affected_rows($con) == 1) { echo "<script>alert('Purchase Order Deleted Successfully..');</script>"; } } ?> <!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> <script type="text/javascript"> $(document).ready(function(){ $('#myForm').submit(function() { $('#loaderImg').show(); return true; }); }); </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> </head> <body> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h2 Align="center">Consumable in Stock </h2> <?php include("../dbconnection.php"); require_once('../../DBManager.php'); require_once('../../LoginManager.php'); $sql ="SELECT * FROM consumable_stock WHERE Consumable_id='$_GET[Consumable_id]'"; $qsql = mysqli_query($con,$sql); while($rs = mysqli_fetch_array($qsql)) { echo " <h4 align='center'>$rs[ConsumableName]</h4> "; } ?> <input type="search" class="light-table-filter" data-table="order-table" placeholder="Search" /> <p align="right"> <button class="button" data-modal="modalOne11" style="color:#ffffff"> Add New Consumable Stock</button> </p> <table id="example2" class="order-table table table-bordered table-hover"> <thead> <tr> <tr><th>Towards</th> <th>Towards</th> <th>Expiry Date</th><th>Quantity</th><th>Action</th></tr> </tr> </thead> <?php include("../dbconnection.php"); require_once('../../DBManager.php'); require_once('../../LoginManager.php'); $sql ="SELECT * FROM consumable_inventory WHERE Consumable_id='$_GET[Consumable_id]'"; $qsql = mysqli_query($con,$sql); while($rs = mysqli_fetch_array($qsql)) { $consumable_stock ="SELECT * FROM consumable_stock WHERE Consumable_id='$rs[Consumable_id]'"; $qconsumable_stock = mysqli_query($con,$consumable_stock); while($rsms = mysqli_fetch_array($qconsumable_stock)){ if($rs['totalQty']=$rs['totalQty']){ $a=$rs['totalQty']; }else{ $a=$rs['qty']*$rsms['Size']; } $cat=$con->query("SELECT * FROM `category` where crid='$rsms[Category]'"); while($RowCat=$cat->fetch_array()){ echo " <tr><td> <b>Date Of Purchase :</b>$rs[dateOfPurchase]<br><b>Invoice No :</b>$rs[invoice_no]<br> <b>HSN No :</b>$rs[HSN]<br> <b>Batch No :</b>$rs[batchno]</td> <td> <b>Cost Price :</b>$rs[cmrp] <br> <b>MRP :</b>$rs[mrp] <br> <b>GST %:</b>$rs[gst] <br> <b>Category :</b>$RowCat[subCat] <br> </td> <td>$rs[expiryDate]</td><td> $a ($RowCat[subCat])</td> <td> <a href='edit_consumable_inventory.php?inventory_id=$rs[inventory_id]'> <i class='fa fa-pencil-square-o' style='font-Size:20px; color:blue;'></i></a> <a href='Consumable_Add_inventory.php?delid=$rs[inventory_id]&Vendor=$rs[Vendor]&Consumable_id=$rs[Consumable_id]&invoice=$rs[invoice_no]'> <i class='fa fa-trash-o' style='font-Size:20px; color:red;'></i> </a> </td> </tr> "; }} } ?> </tbody> <tfoot> </tfoot> </table> <div id="modalOne11" class="modal"> <div class="modal-content"> <div class="contact-form"> <a class="close">×</a> <div style = "display:none;" id = "loaderImg"> <div class="loader"> </div> </div> <form class='form1' name="opdmedicine" id="myForm" method="POST"> <?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)) { echo " <input type='hidden' value='$re[entered_by]' name='admin_id' > "; } ?><label>Invoice No</label> <input type='text' name='invoice_no' placeholder='Enter Invoice No' onkeyup='this.value=this.value.toUpperCase();'> <label>Date of Purchase</label> <input type='date' name='dateOfPurchase' placeholder='Enter Date'> <label>Vendor</label> <select class="form-control" name="Vendor" required> <option value="" disabled selected>Vendor name </option> <?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)) { $sql ="SELECT * FROM list_vendor WHERE cotegory='Consumable Product'"; $qsql = mysqli_query($con,$sql); while($rs = mysqli_fetch_array($qsql)) { echo" <option value='$rs[vid]'>$rs[name]</option>"; } } ?> </select> <label>Batch No</label> <input placeholder='Batch number' name='batchno' id='batchno' list='batchno12' onkeyup='this.value=this.value.toUpperCase();'> <datalist name='batchno' id='batchno12'> <?php include("../dbconnection.php"); $sql12 ="SELECT * FROM consumable_inventory WHERE Consumable_id='$_GET[Consumable_id]'"; $qsql12 = mysqli_query($con,$sql12); while($rs12 = mysqli_fetch_array($qsql12)) { echo " <option value='$rs12[batchno]'>$rs12[batchno]</option> "; } ?> </datalist> <lable><b>HSN NO</b></lable><input type='text' placeholder='HSN' name='HSN'> <lable><b>Rate</b> </lable><input type='text' placeholder='Rate Per Package' name='cmrp'> <label>MRP</label><input type='text' placeholder='MRP Per Package' name='mrp' id='mrp' class='form-control'> <label>GST%</label> <input type='text' placeholder='GST in % ' name='gst' id='gst' class='form-control'> <label>Expiry Date</label><input type='date' placeholder='Expiry Date' name='expiryDate' id='expiryDate' class='form-control'> <label>Quantity</label><input type='text' placeholder='Total Quantity' name='qty' id='qty<?php echo $_GET['Consumable_id']?>' onkeyup='sum<?php echo $_GET['Consumable_id']?>(); ' class='form-control'> <?php $consumable_stock ="SELECT * FROM consumable_stock WHERE Consumable_id='$_GET[Consumable_id]'"; $qconsumable_stock = mysqli_query($con,$consumable_stock); while($rsms = mysqli_fetch_array($qconsumable_stock)){ $a=$rs['qty']*$rsms['Size']; echo " <input type='hidden' id='Size$_GET[Consumable_id]' value='$rsms[Size]' onkeyup='sum$_GET[Consumable_id]();' style='width:25%;'/><br> "; } ?> <input type='hidden' id='txt3<?php echo $_GET['Consumable_id']?>' name='totalQty' style='width:25%;'/> </tr> <input type="submit" value="Add" name="opdmedicine"> </form> </div> </body> </html> <script> function sum<?php echo $_GET['Consumable_id'] ?>() { var txtFirstNumberValue = document.getElementById('qty<?php echo $_GET['Consumable_id'] ?>').value; var txtSecondNumberValue = document.getElementById('Size<?php echo $_GET['Consumable_id'] ?>').value; var textQty=parseFloat(txtFirstNumberValue)*parseFloat(txtSecondNumberValue); if (!isNaN(textQty)) { document.getElementById('txt3<?php echo $_GET['Consumable_id'] ?>').value = textQty; } } 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>