2 // Copyright (C) 2008 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 require_once("../globals.php");
10 require_once("$srcdir/acl.inc");
11 require_once("$include_root/drugs/drugs.inc.php");
13 // Check authorization.
14 $thisauth = acl_check('admin', 'drugs');
15 if (!$thisauth) die("Not authorized.");
18 $res = sqlStatement("SELECT d.*, SUM(di.on_hand) AS on_hand " .
20 "LEFT OUTER JOIN drug_inventory AS di ON di.drug_id = d.drug_id " .
21 "AND di.on_hand != 0 AND di.destroy_date IS NULL " .
22 "GROUP BY d.name, d.drug_id ORDER BY d.name, d.drug_id");
27 <?php
html_header_show(); ?
>
29 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
30 <title
><?php
xl('Inventory List','e'); ?
></title
>
33 tr
.head
{ font
-size
:10pt
; background
-color
:#cccccc; text-align:center; }
34 tr
.detail
{ font
-size
:10pt
; }
35 a
, a
:visited
, a
:hover
{ color
:#0000cc; }
38 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
40 <script language
="JavaScript">
48 <form method
='post' action
='inventory_list.php' name
='theform'>
49 <table border
='0' cellpadding
='5' cellspacing
='0' width
='98%'>
52 <?php
xl('Inventory List','e'); ?
>
54 <td
class='text' align
='right'>
55 <input type
="button" value
="Print" onclick
="window.print()">
61 <table width
='98%' cellpadding
='2' cellspacing
='2'>
62 <thead style
='display:table-header-group'>
64 <th
><?php
xl('NDC','e'); ?
></th
>
65 <th
><?php
xl('Name','e'); ?
></th
>
66 <th
><?php
xl('Form','e'); ?
></th
>
67 <th align
='right'><?php
xl('QOH','e'); ?
></th
>
73 while ($row = sqlFetchArray($res)) {
75 $bgcolor = "#" . (($encount & 1) ?
"ddddff" : "ffdddd");
76 echo " <tr class='detail' bgcolor='$bgcolor'>\n";
77 echo " <td>" . htmlentities($row['ndc_number']) . "</td>\n";
78 echo " <td>" . htmlentities($row['name']) . "</td>\n";
79 echo " <td>" . $form_array[$row['form']] . "</td>\n";
80 echo " <td align='right'>" . $row['on_hand'] . "</td>\n";