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");
20 $drug_id = $_REQUEST['drug'];
21 $lot_id = $_REQUEST['lot'];
24 if (!acl_check('admin', 'drugs')) {
25 die(xlt('Not authorized'));
29 die(xlt('Drug ID missing!'));
33 die(xlt('Lot ID missing!'));
38 <?php
html_header_show();?
>
39 <title
><?php
echo xlt('Destroy Lot') ?
></title
>
40 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
41 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.min.css">
44 td
{ font
-size
:10pt
; }
47 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery/dist/jquery.min.js"></script
>
48 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js"></script
>
49 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
52 <script language
="JavaScript">
53 $
(document
).ready(function(){
54 $
('.datepicker').datetimepicker({
55 <?php
$datetimepicker_timepicker = false; ?
>
56 <?php
$datetimepicker_showseconds = false; ?
>
57 <?php
$datetimepicker_formatInput = false; ?
>
58 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
59 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
66 <body
class="body_top">
68 // If we are saving, then save and close the window.
70 if ($_POST['form_save']) {
71 if (!verifyCsrfToken($_POST["csrf_token_form"])) {
76 "UPDATE drug_inventory SET " .
77 "destroy_date = ?, " .
78 "destroy_method = ?, " .
79 "destroy_witness = ?, " .
80 "destroy_notes = ? " .
81 "WHERE drug_id = ? AND inventory_id = ?",
83 (empty($_POST['form_date']) ?
"NULL" : $_POST['form_date']),
84 $_POST['form_method'],
85 $_POST['form_witness'],
92 // Close this window and redisplay the updated list of drugs.
94 echo "<script language='JavaScript'>\n";
96 echo " alert('".addslashes($info_msg)."');\n";
99 echo " window.close();\n";
100 echo " if (opener.refreshme) opener.refreshme();\n";
101 echo "</script></body></html>\n";
105 $row = sqlQuery("SELECT * FROM drug_inventory WHERE drug_id = ? " .
106 "AND inventory_id = ?", array($drug_id,$lot_id));
109 <form method
='post' name
='theform' action
='destroy_lot.php?drug=<?php echo attr_url($drug_id); ?>&lot=<?php echo attr_url($lot_id); ?>'>
110 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(collectCsrfToken()); ?>" />
114 <table border
='0' width
='100%'>
117 <td valign
='top' width
='1%' nowrap
><b
><?php
echo xlt('Lot Number'); ?
>:</b
></td
>
119 <?php
echo text($row['lot_number']) ?
>
124 <td valign
='top' nowrap
><b
><?php
echo xlt('Manufacturer'); ?
>:</b
></td
>
126 <?php
echo text($row['manufacturer']) ?
>
131 <td valign
='top' nowrap
><b
><?php
echo xlt('Quantity On Hand'); ?
>:</b
></td
>
133 <?php
echo text($row['on_hand']) ?
>
138 <td valign
='top' nowrap
><b
><?php
echo xlt('Expiration Date'); ?
>:</b
></td
>
140 <?php
echo text($row['expiration']) ?
>
145 <td valign
='top' nowrap
><b
><?php
echo xlt('Date Destroyed'); ?
>:</b
></td
>
147 <input type
='text' size
='10' class='datepicker' name
='form_date' id
='form_date'
148 value
='<?php echo $row['destroy_date
'] ? attr($row['destroy_date
']) : date("Y-m-d"); ?>'
149 title
='<?php echo xla('yyyy
-mm
-dd date destroyed
'); ?>' />
154 <td valign
='top' nowrap
><b
><?php
echo xlt('Method of Destruction'); ?
>:</b
></td
>
156 <input type
='text' size
='40' name
='form_method' maxlength
='250'
157 value
='<?php echo attr($row['destroy_method
']) ?>' style
='width:100%' />
162 <td valign
='top' nowrap
><b
><?php
echo xlt('Witness'); ?
>:</b
></td
>
164 <input type
='text' size
='40' name
='form_witness' maxlength
='250'
165 value
='<?php echo attr($row['destroy_witness
']) ?>' style
='width:100%' />
170 <td valign
='top' nowrap
><b
><?php
echo xlt('Notes'); ?
>:</b
></td
>
172 <input type
='text' size
='40' name
='form_notes' maxlength
='250'
173 value
='<?php echo attr($row['destroy_notes
']) ?>' style
='width:100%' />
180 <input type
='submit' name
='form_save' value
='<?php echo xla('Submit
') ;?>' />
183 <input type
='button' value
='<?php echo xla('Cancel
'); ?>' onclick
='window.close()' />