6 * @link http://www.open-emr.org
7 * @author Rod Roark <rod@sunsetsystems.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2006 Rod Roark <rod@sunsetsystems.com>
10 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/acl.inc");
17 require_once("drugs.inc.php");
19 function QuotedOrNull($fld)
22 return "'".add_escape_custom($fld)."'";
28 $drug_id = $_REQUEST['drug'];
29 $lot_id = $_REQUEST['lot'];
32 if (!acl_check('admin', 'drugs')) {
33 die(xlt('Not authorized'));
37 die(xlt('Drug ID missing!'));
41 die(xlt('Lot ID missing!'));
46 <?php
html_header_show();?
>
47 <title
><?php
echo xlt('Destroy Lot') ?
></title
>
48 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
49 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
52 td
{ font
-size
:10pt
; }
55 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
56 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
57 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
60 <script language
="JavaScript">
61 $
(document
).ready(function(){
62 $
('.datepicker').datetimepicker({
63 <?php
$datetimepicker_timepicker = false; ?
>
64 <?php
$datetimepicker_showseconds = false; ?
>
65 <?php
$datetimepicker_formatInput = false; ?
>
66 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
67 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
74 <body
class="body_top">
76 // If we are saving, then save and close the window.
78 if ($_POST['form_save']) {
79 sqlStatement("UPDATE drug_inventory SET " .
80 "destroy_date = " . QuotedOrNull($_POST['form_date']) . ", " .
81 "destroy_method = '" . add_escape_custom($_POST['form_method']) . "', " .
82 "destroy_witness = '" . add_escape_custom($_POST['form_witness']) . "', " .
83 "destroy_notes = '" . add_escape_custom($_POST['form_notes']) . "' " .
84 "WHERE drug_id = ? AND inventory_id = ?", array($drug_id,$lot_id));
86 // Close this window and redisplay the updated list of drugs.
88 echo "<script language='JavaScript'>\n";
90 echo " alert('".addslashes($info_msg)."');\n";
93 echo " window.close();\n";
94 echo " if (opener.refreshme) opener.refreshme();\n";
95 echo "</script></body></html>\n";
99 $row = sqlQuery("SELECT * FROM drug_inventory WHERE drug_id = ? " .
100 "AND inventory_id = ?", array($drug_id,$lot_id));
103 <form method
='post' name
='theform' action
='destroy_lot.php?drug=<?php echo attr($drug_id) ?>&lot=<?php echo attr($lot_id) ?>'>
106 <table border
='0' width
='100%'>
109 <td valign
='top' width
='1%' nowrap
><b
><?php
echo xlt('Lot Number'); ?
>:</b
></td
>
111 <?php
echo text($row['lot_number']) ?
>
116 <td valign
='top' nowrap
><b
><?php
echo xlt('Manufacturer'); ?
>:</b
></td
>
118 <?php
echo text($row['manufacturer']) ?
>
123 <td valign
='top' nowrap
><b
><?php
echo xlt('Quantity On Hand'); ?
>:</b
></td
>
125 <?php
echo text($row['on_hand']) ?
>
130 <td valign
='top' nowrap
><b
><?php
echo xlt('Expiration Date'); ?
>:</b
></td
>
132 <?php
echo text($row['expiration']) ?
>
137 <td valign
='top' nowrap
><b
><?php
echo xlt('Date Destroyed'); ?
>:</b
></td
>
139 <input type
='text' size
='10' class='datepicker' name
='form_date' id
='form_date'
140 value
='<?php echo $row['destroy_date
'] ? attr($row['destroy_date
']) : date("Y-m-d"); ?>'
141 title
='<?php echo xla('yyyy
-mm
-dd date destroyed
'); ?>' />
146 <td valign
='top' nowrap
><b
><?php
echo xlt('Method of Destruction'); ?
>:</b
></td
>
148 <input type
='text' size
='40' name
='form_method' maxlength
='250'
149 value
='<?php echo text($row['destroy_method
']) ?>' style
='width:100%' />
154 <td valign
='top' nowrap
><b
><?php
echo xlt('Witness'); ?
>:</b
></td
>
156 <input type
='text' size
='40' name
='form_witness' maxlength
='250'
157 value
='<?php echo text($row['destroy_witness
']) ?>' style
='width:100%' />
162 <td valign
='top' nowrap
><b
><?php
echo xlt('Notes'); ?
>:</b
></td
>
164 <input type
='text' size
='40' name
='form_notes' maxlength
='250'
165 value
='<?php echo text($row['destroy_notes
']) ?>' style
='width:100%' />
172 <input type
='submit' name
='form_save' value
='<?php echo xla('Submit
') ;?>' />
175 <input type
='button' value
='<?php echo xla('Cancel
'); ?>' onclick
='window.close()' />