File manager - Edit - /home/autoph/public_html/ahglegal/includes/addnewmedicines.php
Back
<?php $user = $user_data['u_name']; if(isset($_GET['addmedicine'])){ $medname=$_GET['medname']; $medtype=$_GET['medtype']; $price=$_GET['price']; $UoM=$_GET['UoM']; $checkDesc=mysql_result(mysql_query("SELECT COUNT('medicine_id') FROM `medicines` WHERE `medicine_desc`='$medname'"),0); if($checkDesc > 0 ){ echo " <center> <div style='position:absolute;width:550px;height:180px;left:250px;top:200px;border:2px solid red;border-radius:5px;background:#EFFBFB'> <table> <tr> <td align='center' style='font-size:14px;font-weight:bold;color:red;width:500px;height:170px;background:#EFFBFB;border:1px solid white'><br> Record already exist. Please check your entry and try again. Thank You! </font> <br> <br> <br> <a href='mainindex.php?view=medicines'><input style='background-color:#E5E4E2;border:1px black solid;border-radius:5px;width:120px;height:30px;color:black;font-size:16px;font-weight:bold;'type ='button' name ='edit' value = 'Close'> </a> <br><br> </td> </tr> </table> </div> </center>"; }else { $sql="INSERT INTO `medicines` (`medicine_id`,`medicine_desc`, `medicine_price`, `type`, `UoM`,`encoded_by`) VALUES('','$medname','$price','$medtype','$UoM','$user')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); }else{ echo " <center> <div style='position:absolute;width:550px;height:180px;left:250px;top:200px;border:2px solid red;border-radius:5px;background:#EFFBFB'> <table> <tr> <td align='center' style='font-size:14px;font-weight:bold;color:red;width:500px;height:170px;background:#EFFBFB;border:1px solid white'><br> New record has been added to database. </font> <br> <br> <br> <a href='mainindex.php?view=medicines'><input style='background-color:#E5E4E2;border:1px black solid;border-radius:5px;width:120px;height:30px;color:black;font-size:16px;font-weight:bold;'type ='button' name ='edit' value = 'Close'> </a> <br><br> </td> </tr> </table> </div> </center>"; } } } $checkAccess = $user_data['add_new_medicine']; if($checkAccess == '0'){ secalert(); }else{ ?> <table style="border-collapse:collapse;background:gray:border:1px solid gray;width:100%;height:100%"> <tr> <td colspan ='2' class="lightGradient" style="border:1px solid gray;height:32px;font-size:14px;font-weight:normal;color:gray"> <form action='' method='POST'> <b style='font-size:16px;color:gray '><img src="images/bullet.gif" width="10px" height="10px"> </img> <b style="font-size:14px;color:red">MEDICINE MASTERFILE</b> Search Item: </b> <input type='text' name='searchpatient' id='D' style='width:300px;height:30px;font-size:16px;color:gray;border:1px solid lightgray;border-radius:3px;background:white;text-align:center;' required> <input type='submit' name='plookup' value='Search' style='width:80px;height:28px;border:1px solid gray;border-radius:3px;font-size:14px;font-weight:normal'> <a href='mainindex.php?view=medicines'><input type='button' name='new' value='New Record' style='width:100px;height:28px;border:1px solid gray;border-radius:3px;font-size:14px;font-weight:normal'></a> </form></b> </td> </tr> <tr> <td colspan="2" valign="TOP" style="border:1px solid gray;font-size:14px;weight:bold;color:gray;background:gray;height:100%"> <?php if(isset($_POST['plookup'])){ $searchtext=$_POST['searchpatient']; echo "<tr>"; echo "<td colspan ='3' valign='TOP' style='border:1px solid white;font-size:14px;weight:bold;color:gray;height:400px;background:white'>"; $q=mysql_query("SELECT * FROM `medicines` WHERE `medicine_desc` LIKE '%$searchtext%' || `item_code` LIKE '%$searchtext%'"); $row=mysql_fetch_array($q); $total=mysql_num_rows($q); $dis=10; $total_page=ceil($total/$dis); $page_cur=(isset($_GET['page']))?$_GET['page']:1; $k=($page_cur-1)*$dis; $page_cur = mysql_real_escape_string($page_cur); $qq=mysql_query("SELECT * FROM `medicines` WHERE `medicine_desc` LIKE '%$searchtext%' || `item_code` LIKE '%$searchtext%'"); echo "<table style='width:100%; height:95% border:1px solid white; border-collapse:collapse;'>"; echo "<tr> <th class='Gradient' style='text-align:center;width:50px;background:#f5f5f5;border:1px solid gray;font-size:13px;height:25px'>Item I.D</th> <th class='Gradient' align='left' style='width:150px;background:#f5f5f5;border:1px solid gray;font-size:13px'>Item Code</th> <th class='Gradient' align='left' style='width:300px;background:#f5f5f5;border:1px solid gray;font-size:13px'>Item Description</th> <th class='Gradient' align='left' style='width:200px;background:#f5f5f5;border:1px solid gray;font-size:13px'>Item Type</th> <th class='Gradient' align='left' style='width:100px;background:#f5f5f5;border:1px solid gray;font-size:13px'>UoM</th> <th class='Gradient' align='left' style='width:100px;background:#f5f5f5;border:1px solid gray;font-size:13px'>Price</th> <th class='Gradient' align='center' style='width:100px;background:#f5f5f5;border:1px solid gray;font-size:13px'>Stock On-Hond</th> <th class='Gradient' align='center' style='width:50px;background:#f5f5f5;border:1px solid gray;font-size:13px'>-</th> </tr>"; while($row = mysql_fetch_array($qq)){ echo "<tr>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:center;height:25px'>" . $row['medicine_id'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:left;height:25px'>" . $row['item_code'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:left;height:25px'>" . $row['medicine_desc'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:left;height:25px'>" . $row['type'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:left;height:25px'>" . $row['UoM'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:left;height:25px'>" . $row['medicine_price'] . "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:center;height:25px'>"; $itemID = $row['medicine_id']; $onHand = mysql_result(mysql_query("SELECT `item_qty` FROM `inventory` WHERE `item_id`='$itemID'"),0); echo $onHand; echo "</td>"; echo "<td style='font-size:12px;border:1px solid lightgray;text-align:center;height:25px'><a href='mainindex.php?view=itemupdate&id=".$row['medicine_id']."'>Update</a></td>"; } echo "</tr>"; echo "</table>"; echo "</td>"; echo "</tr>"; }else{ echo "<table style='width:60%; height:100% border:1px solid gray; border-collapse:collapse;background:white'>"; echo "<form action='' method='GET'> <input type='hidden' name='view' value='medicines'> <tr> <td colspan='2' class='Gradient' align='left' style='widtd:300px;background:white;border:1px solid white;font-size:14px;font-weight:normal'> <h4>Item Information:</h3><br> Description:<br> <input type='text' name='medname' style='font-size:14px;width:90%;border:1px solid gray;background:white;border-radius:3px;height:30px' placeholder='Item Description' required> </td> </tr> <tr> <td colspan='2' class='Gradient' align='left' style='widtd:200px;background:#fff;border:1px solid #fff;font-weight:normal;font-size:14px;height:50px'> <br> Category: <br> <select name='medtype' style='height:30px;width:30%;font-size:16px;border:1px solid lightgray;background:white;border-radius:5px'>"; $getmedType = mysql_query("SELECT * FROM `medical_type` WHERE `active`= '1' ORDER by `type` ASC"); while($myMed = mysql_fetch_array($getmedType)){ $Type = $myMed['type']; if ($Type !=$subType) { echo "<option>".$myMed['type']."</option>"; } $subType = $Type ; } echo "</select> <select name='UoM' style='height:30px;width:80px;font-size:16px;border:1px solid lightgray;background:white;border-radius:5px'> <option>Box</option> <option>Lt</option> <option>Pack</option> <option>Pc</option> <option>PSI</option> <option>Set</option> <option>Unit</option> </select><br><br>"; echo "</td>"; echo "<tr>"; echo "<td colspan='2' class='Gradient' align='left' style='widtd:60px;background:#fff;border:1px solid #fff;font-size:13px;font-weight:bold'> <br> Unit Price:<br> <input type='text' name='price' style='font-size:14px;width:100px;font-weight:bold;border:1px solid gray;background:white;border-radius:3px;height:30px;text-align:center' placeholder='' required><br> </td> </tr> <tr> <td colspan='2' class='Gradient' align='left' style='widtd:50px;background:#fff;border:1px solid #D8F0F8;font-size:13px'> <br><center> <input type='submit' name='addmedicine' value='Add Record' style='text-align:center;font-size:14px;width:90px;border:1px solid gray;border-radius:3px;height:30px'> <a href='maindindex.php?view=searchitem'><input type='button' name='search' value='Search Item' style='text-align:center;font-size:14px;width:90px;border:1px solid gray;border-radius:3px;height:30px'> </a> </center> <br></td> </tr>"; echo "</table></center>"; } ?> </td> </tr> </table> <?php }?>
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings