2 // Copyright (C) 2010-2016 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.
10 // Product Name (blank where repeated)
11 // Warehouse Name (blank where repeated) or Total for Product
12 // Starting Inventory (detail lines: date)
13 // Ending Inventory (detail lines: invoice ID)
21 require_once("../globals.php");
22 require_once("$srcdir/patient.inc");
23 require_once("$srcdir/acl.inc");
25 // Specify if product or warehouse is the first column.
26 $product_first = (!empty($_POST['form_by']) && $_POST['form_by'] == 'w') ?
0 : 1;
28 $last_warehouse_id = '~';
31 function esc4Export($str)
33 return str_replace('"', '\\"', $str);
36 // Get ending inventory for the report's end date.
37 // Optionally restricts by product ID and/or warehouse ID.
38 function getEndInventory($product_id = 0, $warehouse_id = '~')
40 global $form_from_date, $form_to_date, $form_product;
43 if ($warehouse_id !== '~') {
44 $whidcond = $warehouse_id === '' ?
45 "AND ( di.warehouse_id IS NULL OR di.warehouse_id = '' )" :
46 "AND di.warehouse_id = '$warehouse_id'";
51 $product_id = $form_product;
55 $prodcond = "AND di.drug_id = '$product_id'";
58 // Get sum of current inventory quantities + destructions done after the
59 // report end date (which is effectively a type of transaction).
60 $eirow = sqlQuery("SELECT sum(di.on_hand) AS on_hand " .
61 "FROM drug_inventory AS di WHERE " .
62 "( di.destroy_date IS NULL OR di.destroy_date > '$form_to_date' ) " .
63 "$prodcond $whidcond");
65 // Get sum of sales/adjustments/purchases after the report end date.
66 $sarow = sqlQuery("SELECT sum(ds.quantity) AS quantity " .
67 "FROM drug_sales AS ds, drug_inventory AS di WHERE " .
68 "ds.sale_date > '$form_to_date' AND " .
69 "di.inventory_id = ds.inventory_id " .
70 "$prodcond $whidcond");
72 // Get sum of transfers out after the report end date.
73 $xfrow = sqlQuery("SELECT sum(ds.quantity) AS quantity " .
74 "FROM drug_sales AS ds, drug_inventory AS di WHERE " .
75 "ds.sale_date > '$form_to_date' AND " .
76 "di.inventory_id = ds.xfer_inventory_id " .
77 "$prodcond $whidcond");
79 return $eirow['on_hand'] +
$sarow['quantity'] - $xfrow['quantity'];
82 function thisLineItem(
94 global $warehouse, $product, $secqtys, $priqtys, $grandqtys;
95 global $whleft, $prodleft; // left 2 columns, blank where repeated
96 global $last_warehouse_id, $last_product_id, $product_first;
99 $invnumber = empty($irnumber) ?
($patient_id ?
"$patient_id.$encounter_id" : "") : $irnumber;
101 // Product name for this detail line item.
102 if (empty($rowprod)) {
103 $rowprod = 'Unnamed Product';
106 // Warehouse name for this line item.
111 // If new warehouse or product...
112 if ($warehouse_id != $last_warehouse_id ||
$product_id != $last_product_id) {
113 // If there was anything to total...
114 if (($product_first && $last_warehouse_id != '~') ||
(!$product_first && $last_product_id)) {
115 $secei = getEndInventory($last_product_id, $last_warehouse_id);
117 // Print second-column totals.
118 if ($form_action == 'export') {
120 if (! $_POST['form_details']) {
121 if ($product_first) {
122 echo '"' . esc4Export($product) . '"';
123 echo ',"' . esc4Export($warehouse) . '"';
125 echo '"' . esc4Export($warehouse) . '"';
126 echo ',"' . esc4Export($product) . '"';
129 echo ',"' . ($secei - $secqtys[0] - $secqtys[1] - $secqtys[2] - $secqtys[3] - $secqtys[4]) . '"'; // start inventory
130 echo ',"' . $secqtys[0] . '"'; // sales
131 echo ',"' . $secqtys[1] . '"'; // distributions
132 echo ',"' . $secqtys[2] . '"'; // purchases
133 echo ',"' . $secqtys[3] . '"'; // transfers
134 echo ',"' . $secqtys[4] . '"'; // adjustments
135 echo ',"' . $secei . '"'; // end inventory
141 <tr bgcolor
="#ddddff">
142 <?php
if ($product_first) { ?
>
144 <?php
echo htmlspecialchars($prodleft);
147 <td
class="detail" colspan
='3'>
148 <?php
if ($_POST['form_details']) {
149 echo htmlspecialchars(xl('Total for')) . ' ';
152 echo htmlspecialchars($warehouse); ?
>
156 <?php
echo htmlspecialchars($whleft);
159 <td
class="detail" colspan
='3'>
160 <?php
if ($_POST['form_details']) {
161 echo htmlspecialchars(xl('Total for')) . ' ';
164 echo htmlspecialchars($product); ?
>
167 <td
class="dehead" align
="right">
168 <?php
echo $secei - $secqtys[0] - $secqtys[1] - $secqtys[2] - $secqtys[3] - $secqtys[4]; ?
>
170 <td
class="dehead" align
="right">
171 <?php
echo $secqtys[0]; ?
>
173 <td
class="dehead" align
="right">
174 <?php
echo $secqtys[1]; ?
>
176 <td
class="dehead" align
="right">
177 <?php
echo $secqtys[2]; ?
>
179 <td
class="dehead" align
="right">
180 <?php
echo $secqtys[3]; ?
>
182 <td
class="dehead" align
="right">
183 <?php
echo $secqtys[4]; ?
>
185 <td
class="dehead" align
="right">
186 <?php
echo $secei; ?
>
190 } // End not csv export
193 $secqtys = array(0, 0, 0, 0, 0);
194 if ($product_first) {
195 $whleft = $warehouse = $rowwh;
196 $last_warehouse_id = $warehouse_id;
198 $prodleft = $product = $rowprod;
199 $last_product_id = $product_id;
203 // If first column is changing, time for its totals.
204 if (($product_first && $product_id != $last_product_id) ||
205 (!$product_first && $warehouse_id != $last_warehouse_id)) {
206 if (($product_first && $last_product_id) ||
207 (!$product_first && $last_warehouse_id != '~')) {
208 $priei = $product_first ?
getEndInventory($last_product_id) :
209 getEndInventory(0, $last_warehouse_id);
210 // Print first column total.
211 if ($form_action != 'export') {
214 <tr bgcolor
="#ffdddd">
218 <td
class="detail" colspan
="3">
219 <?php
echo htmlspecialchars(xl('Total for')) . ' ';
220 echo htmlspecialchars($product_first ?
$product : $warehouse); ?
>
222 <td
class="dehead" align
="right">
223 <?php
echo $priei - $priqtys[0] - $priqtys[1] - $priqtys[2] - $priqtys[3] - $priqtys[4]; ?
>
225 <td
class="dehead" align
="right">
226 <?php
echo $priqtys[0]; ?
>
228 <td
class="dehead" align
="right">
229 <?php
echo $priqtys[1]; ?
>
231 <td
class="dehead" align
="right">
232 <?php
echo $priqtys[2]; ?
>
234 <td
class="dehead" align
="right">
235 <?php
echo $priqtys[3]; ?
>
237 <td
class="dehead" align
="right">
238 <?php
echo $priqtys[4]; ?
>
240 <td
class="dehead" align
="right">
241 <?php
echo $priei; ?
>
245 } // End not csv export
248 $priqtys = array(0, 0, 0, 0, 0);
249 if ($product_first) {
250 $prodleft = $product = $rowprod;
251 $last_product_id = $product_id;
253 $whleft = $warehouse = $rowwh;
254 $last_warehouse_id = $warehouse_id;
259 if ($_POST['form_details'] && $product_id && ($qtys[0] +
$qtys[1] +
$qtys[2] +
$qtys[3] +
$qtys[4])) {
260 if ($form_action == 'export') {
261 if ($product_first) {
262 echo '"' . esc4Export($product) . '"';
263 echo ',"' . esc4Export($warehouse) . '"';
265 echo '"' . esc4Export($warehouse) . '"';
266 echo ',"' . esc4Export($product) . '"';
269 echo ',"' . oeFormatShortDate($transdate) . '"';
270 echo ',"' . esc4Export($invnumber) . '"';
271 echo ',"' . $qtys[0] . '"'; // sales
272 echo ',"' . $qtys[1] . '"'; // distributions
273 echo ',"' . $qtys[2] . '"'; // purchases
274 echo ',"' . $qtys[3] . '"'; // transfers
275 echo ',"' . $qtys[4] . '"'; // adjustments
280 <?php
if ($product_first) { ?
>
282 <?php
echo htmlspecialchars($prodleft);
286 <?php
echo htmlspecialchars($whleft);
291 <?php
echo htmlspecialchars($whleft);
295 <?php
echo htmlspecialchars($prodleft);
300 <?php
echo oeFormatShortDate($transdate); ?
>
303 <?php
echo htmlspecialchars($invnumber); ?
>
308 <td
class="dehead" align
="right">
309 <?php
echo $qtys[0]; ?
>
311 <td
class="dehead" align
="right">
312 <?php
echo $qtys[1]; ?
>
314 <td
class="dehead" align
="right">
315 <?php
echo $qtys[2]; ?
>
317 <td
class="dehead" align
="right">
318 <?php
echo $qtys[3]; ?
>
320 <td
class="dehead" align
="right">
321 <?php
echo $qtys[4]; ?
>
328 } // End not csv export
330 for ($i = 0; $i < 5; ++
$i) {
331 $secqtys[$i] +
= $qtys[$i];
332 $priqtys[$i] +
= $qtys[$i];
333 $grandqtys[$i] +
= $qtys[$i];
337 if (! acl_check('acct', 'rep')) {
338 die(htmlspecialchars(xl("Unauthorized access.")));
341 // this is "" or "submit" or "export".
342 $form_action = $_POST['form_action'];
344 $form_from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
345 $form_to_date = fixDate($_POST['form_to_date'], date('Y-m-d'));
346 $form_product = $_POST['form_product'];
348 if ($form_action == 'export') {
349 header("Pragma: public");
350 header("Expires: 0");
351 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
352 header("Content-Type: application/force-download");
353 header("Content-Disposition: attachment; filename=inventory_activity.csv");
354 header("Content-Description: File Transfer");
356 if ($product_first) {
357 echo '"' . esc4export(xl('Product')) . '",';
358 echo '"' . esc4export(xl('Warehouse')) . '",';
360 echo '"' . esc4export(xl('Warehouse')) . '",';
361 echo '"' . esc4export(xl('Product')) . '",';
364 if ($_POST['form_details']) {
365 echo '"' . esc4export(xl('Date')) . '",';
366 echo '"' . esc4export(xl('Invoice')) . '",';
367 echo '"' . esc4export(xl('Sales')) . '",';
368 echo '"' . esc4export(xl('Distributions')) . '",';
369 echo '"' . esc4export(xl('Purchases')) . '",';
370 echo '"' . esc4export(xl('Transfers')) . '",';
371 echo '"' . esc4export(xl('Adjustments')) . '"' . "\n";
373 echo '"' . esc4export(xl('Start')) . '",';
374 echo '"' . esc4export(xl('Sales')) . '",';
375 echo '"' . esc4export(xl('Distributions')) . '",';
376 echo '"' . esc4export(xl('Purchases')) . '",';
377 echo '"' . esc4export(xl('Transfers')) . '",';
378 echo '"' . esc4export(xl('Adjustments')) . '",';
379 echo '"' . esc4export(xl('End')) . '"' . "\n";
386 <?php
html_header_show();?
>
387 <title
><?php
echo htmlspecialchars(xl('Inventory Activity')) ?
></title
>
389 <link rel
='stylesheet' href
='<?php echo $css_header ?>' type
='text/css'>
391 <style type
="text/css">
392 /* specifically include & exclude from printing */
394 #report_parameters {visibility: hidden; display: none;}
395 #report_parameters_daterange {visibility: visible; display: inline;}
396 #report_results {margin-top: 30px;}
398 /* specifically exclude some from the screen */
400 #report_parameters_daterange {visibility: hidden; display: none;}
402 body
{ font
-family
:sans
-serif
; font
-size
:10pt
; font
-weight
:normal
}
403 .dehead
{ color
:#000000; font-family:sans-serif; font-size:10pt; font-weight:bold }
404 .detail
{ color
:#000000; font-family:sans-serif; font-size:10pt; font-weight:normal }
406 table
.mymaintable
, table
.mymaintable td
, table
.mymaintable th
{
407 border
: 1px solid
#aaaaaa;
408 border
-collapse
: collapse
;
410 table
.mymaintable td
, table
.mymaintable th
{
411 padding
: 1pt
4pt
1pt
4pt
;
415 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
416 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
417 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
418 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
419 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
420 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-9-1/index.js"></script
>
421 <script type
="text/javascript" src
="../../library/js/report_helper.js?v=<?php echo $v_js_includes; ?>"></script
>
423 <script language
='JavaScript'>
425 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
427 $
(document
).ready(function() {
428 oeFixedHeaderSetup(document
.getElementById('mymaintable'));
429 var win
= top
.printLogSetup ? top
: opener
.top
;
430 win
.printLogSetup(document
.getElementById('printbutton'));
433 function mysubmit(action
) {
434 var f
= document
.forms
[0];
435 f
.form_action
.value
= action
;
436 top
.restoreSession();
444 <body leftmargin
='0' topmargin
='0' marginwidth
='0' marginheight
='0' class='body_top'>
448 <h2
><?php
echo htmlspecialchars(xl('Inventory Activity'))?
></h2
>
450 <form method
='post' action
='inventory_activity.php?product=<?php echo htmlspecialchars($product_first, ENT_QUOTES); ?>'>
452 <div id
="report_parameters">
453 <!-- form_action is set to
"submit" or "export" at form submit time
-->
454 <input type
='hidden' name
='form_action' value
='' />
460 <td
class='label_custom'>
461 <?php
echo htmlspecialchars(xl('By')); ?
>:
464 <select name
='form_by'>
465 <option value
='p'><?php
echo htmlspecialchars(xl('Product')); ?
></option
>
466 <option value
='w'<?php
if (!$product_first) {
468 } ?
>><?php
echo htmlspecialchars(xl('Warehouse')); ?
></option
>
471 <td
class='label_custom'>
472 <?php
echo htmlspecialchars(xl('From')); ?
>:
475 <input type
='text' name
='form_from_date' id
="form_from_date" size
='10'
476 value
='<?php echo htmlspecialchars($form_from_date, ENT_QUOTES) ?>'
477 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd
'), ENT_QUOTES) ?>'
478 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'>
479 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
480 id
='img_from_date' border
='0' alt
='[?]' style
='cursor:pointer'
481 title
='<?php echo htmlspecialchars(xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
483 <td
class='label_custom'>
484 <?php
echo htmlspecialchars(xl('To')); ?
>:
487 <input type
='text' name
='form_to_date' id
="form_to_date" size
='10'
488 value
='<?php echo htmlspecialchars($form_to_date, ENT_QUOTES) ?>'
489 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd
'), ENT_QUOTES) ?>'
490 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'>
491 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
492 id
='img_to_date' border
='0' alt
='[?]' style
='cursor:pointer'
493 title
='<?php echo htmlspecialchars(xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
497 <td
class='label_custom'>
498 <?php
echo htmlspecialchars(xl('For'), ENT_NOQUOTES
); ?
>:
502 // Build a drop-down list of products.
504 $query = "SELECT drug_id, name FROM drugs ORDER BY name, drug_id";
505 $pres = sqlStatement($query);
506 echo " <select name='form_product'>\n";
507 echo " <option value=''>-- " . htmlspecialchars(xl('All Products')) . " --\n";
508 while ($prow = sqlFetchArray($pres)) {
509 $drug_id = $prow['drug_id'];
510 echo " <option value='$drug_id'";
511 if ($drug_id == $form_product) {
515 echo ">" . htmlspecialchars($prow['name']) . "\n";
521 <td
class='label_custom'>
522 <?php
echo htmlspecialchars(xl('Details')); ?
>:
524 <td colspan
='3' nowrap
>
525 <input type
='checkbox' name
='form_details' value
='1'<?php
if ($_POST['form_details']) {
532 <td align
='left' valign
='middle'>
533 <table style
='border-left:1px solid; width:100%; height:100%'>
536 <a href
='#' class='css_button' onclick
='mysubmit("submit")' style
='margin-left:1em'>
537 <span
><?php
echo htmlspecialchars(xl('Submit')); ?
></span
>
539 <?php
if ($form_action) { ?
>
540 <a href
='#' class='css_button' id
='printbutton' style
='margin-left:1em'>
541 <span
><?php
echo htmlspecialchars(xl('Print')); ?
></span
>
543 <a href
='#' class='css_button' onclick
='mysubmit("export")' style
='margin-left:1em'>
544 <span
><?php
echo htmlspecialchars(xl('CSV Export')); ?
></span
>
555 <?php
if ($form_action) { // if submit (already not export here) ?>
557 <div id
="report_results">
558 <table width
='98%' id
='mymaintable' class='mymaintable'>
560 <tr bgcolor
="#dddddd">
562 <?php
echo htmlspecialchars($product_first ?
xl('Product') : xl('Warehouse')); ?
>
564 <?php
if ($_POST['form_details']) { ?
>
566 <?php
echo htmlspecialchars($product_first ?
xl('Warehouse') : xl('Product')); ?
>
569 <?php
echo htmlspecialchars(xl('Date')); ?
>
572 <?php
echo htmlspecialchars(xl('Invoice')); ?
>
575 <td
class="dehead" colspan
="3">
576 <?php
echo htmlspecialchars($product_first ?
xl('Warehouse') : xl('Product')); ?
>
579 <td
class="dehead" align
="right" width
="8%">
580 <?php
echo htmlspecialchars(xl('Start')); ?
>
582 <td
class="dehead" align
="right" width
="8%">
583 <?php
echo htmlspecialchars(xl('Sales')); ?
>
585 <td
class="dehead" align
="right" width
="8%">
586 <?php
echo htmlspecialchars(xl('Distributions')); ?
>
588 <td
class="dehead" align
="right" width
="8%">
589 <?php
echo htmlspecialchars(xl('Purchases')); ?
>
591 <td
class="dehead" align
="right" width
="8%">
592 <?php
echo htmlspecialchars(xl('Transfers')); ?
>
594 <td
class="dehead" align
="right" width
="8%">
595 <?php
echo htmlspecialchars(xl('Adjustments')); ?
>
597 <td
class="dehead" align
="right" width
="8%">
598 <?php
echo htmlspecialchars(xl('End')); ?
>
607 if ($form_action) { // if submit or export
608 $from_date = $form_from_date;
609 $to_date = $form_to_date;
615 $grandqtys = array(0, 0, 0, 0, 0);
616 $priqtys = array(0, 0, 0, 0, 0);
617 $secqtys = array(0, 0, 0, 0, 0);
618 $last_inventory_id = 0;
620 $query = "SELECT s.sale_id, s.sale_date, s.quantity, s.fee, s.pid, s.encounter, " .
621 "s.xfer_inventory_id, s.distributor_id, d.name, lo.title, " .
622 "di.drug_id, di.warehouse_id, di.inventory_id, di.destroy_date, di.on_hand, " .
623 "fe.invoice_refno " .
624 "FROM drug_inventory AS di " .
625 "JOIN drugs AS d ON d.drug_id = di.drug_id " .
626 "LEFT JOIN drug_sales AS s ON " .
627 "s.sale_date >= '$from_date' AND s.sale_date <= '$to_date' AND " .
628 "s.drug_id = di.drug_id AND " .
629 "( s.inventory_id = di.inventory_id OR s.xfer_inventory_id = di.inventory_id ) " .
630 "LEFT JOIN list_options AS lo ON lo.list_id = 'warehouse' AND " .
631 "lo.option_id = di.warehouse_id AND lo.activity = 1 " .
632 "LEFT JOIN form_encounter AS fe ON fe.pid = s.pid AND fe.encounter = s.encounter " .
633 "WHERE ( di.destroy_date IS NULL OR di.destroy_date >= '$form_from_date' )";
635 // If a product was specified.
637 $query .= " AND di.drug_id = '$form_product'";
640 if ($product_first) {
641 $query .= " ORDER BY d.name, d.drug_id, lo.title, di.warehouse_id, " .
642 "di.inventory_id, s.sale_date, s.sale_id";
644 $query .= " ORDER BY lo.title, di.warehouse_id, d.name, d.drug_id, " .
645 "di.inventory_id, s.sale_date, s.sale_id";
648 $res = sqlStatement($query);
649 while ($row = sqlFetchArray($res)) {
650 // If new lot and it was destroyed during the reporting period,
651 // generate a pseudo-adjustment for that.
652 if ($row['inventory_id'] != $last_inventory_id) {
653 $last_inventory_id = $row['inventory_id'];
654 if (!empty($row['destroy_date']) && $row['on_hand'] != 0
655 && $row['destroy_date'] <= $form_to_date) {
658 $row['warehouse_id'],
663 $row['destroy_date'],
664 array(0, 0, 0, 0, 0 - $row['on_hand']),
670 $qtys = array(0, 0, 0, 0, 0);
671 if ($row['sale_id']) {
672 if ($row['xfer_inventory_id']) {
673 // A transfer sale item will appear twice, once with each lot.
674 if ($row['inventory_id'] == $row['xfer_inventory_id']) {
675 $qtys[3] = $row['quantity'];
677 $qtys[3] = 0 - $row['quantity'];
679 } else if ($row['pid']) {
680 $qtys[0] = 0 - $row['quantity'];
681 } else if ($row['distributor_id']) {
682 $qtys[1] = 0 - $row['quantity'];
683 } else if ($row['fee'] != 0) {
684 $qtys[2] = 0 - $row['quantity'];
685 } else { // no pid, distributor, source lot or fee: must be an adjustment
686 $qtys[4] = 0 - $row['quantity'];
692 $row['warehouse_id'],
694 $row['encounter'] +
0,
699 $row['invoice_refno']
703 // Generate totals for last product and warehouse.
704 thisLineItem(0, '~', 0, 0, '', '', '0000-00-00', array(0, 0, 0, 0, 0));
706 // Grand totals line.
707 if ($form_action != 'export') { // if submit
708 $grei = getEndInventory();
710 <tr bgcolor
="#dddddd">
711 <td
class="detail" colspan
="4">
712 <?php
echo htmlspecialchars(xl('Grand Total')); ?
>
714 <td
class="dehead" align
="right">
715 <?php
echo $grei - $grandqtys[0] - $grandqtys[1] - $grandqtys[2] - $grandqtys[3] - $grandqtys[4]; ?
>
717 <td
class="dehead" align
="right">
718 <?php
echo $grandqtys[0]; ?
>
720 <td
class="dehead" align
="right">
721 <?php
echo $grandqtys[1]; ?
>
723 <td
class="dehead" align
="right">
724 <?php
echo $grandqtys[2]; ?
>
726 <td
class="dehead" align
="right">
727 <?php
echo $grandqtys[3]; ?
>
729 <td
class="dehead" align
="right">
730 <?php
echo $grandqtys[4]; ?
>
732 <td
class="dehead" align
="right">
738 } // end if submit or export
740 if ($form_action != 'export') {
747 } // end if ($form_action)
754 <!-- stuff
for the popup calendar
-->
755 <script language
="Javascript">
756 Calendar
.setup({inputField
:"form_from_date", ifFormat
:"%Y-%m-%d", button
:"img_from_date"});
757 Calendar
.setup({inputField
:"form_to_date", ifFormat
:"%Y-%m-%d", button
:"img_to_date"});