2 // Copyright (C) 2009 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 $sanitize_all_escapes=true;
12 //STOP FAKE REGISTER GLOBALS
13 $fake_register_globals=false;
15 require_once("../../globals.php");
16 require_once("$srcdir/acl.inc");
17 require_once("$srcdir/options.inc.php");
18 require_once("$srcdir/patient.inc");
20 $CPR = 4; // cells per row
22 // The form name is passed to us as a GET parameter.
23 $formname = isset($_GET['formname']) ?
$_GET['formname'] : '';
25 $tmp = sqlQuery("SELECT title FROM list_options WHERE " .
26 "list_id = 'lbfnames' AND option_id = ? LIMIT 1", array($formname) );
27 $formtitle = $tmp['title'];
29 $fres = sqlStatement("SELECT * FROM layout_options " .
30 "WHERE form_id = ? AND uor > 0 " .
31 "ORDER BY group_name, seq", array($formname) );
35 <?php
html_header_show();?
>
39 font
-family
: Arial
, Helvetica
, sans
-serif
;
45 padding
: 5pt
5pt
5pt
5pt
;
51 border
-color
: #000000;
69 border
-width
: 0 0 1px
0;
70 border
-color
: #999999;
91 <body bgcolor
='#ffffff'>
94 <?php
echo genFacilityTitle($formtitle, -1); ?
>
96 <span
class='subhead'>
97 <?php
echo xlt('Patient') ?
>: ________________________________________
 
;
98 <?php
echo xlt('Clinic') ?
>: ____________________
 
;
99 <?php
echo xlt('Date') ?
>: ____________________
<br
/> 
;<br
/>
104 function end_cell() {
105 global $item_count, $cell_count;
106 if ($item_count > 0) {
113 global $cell_count, $CPR;
115 if ($cell_count > 0) {
116 for (; $cell_count < $CPR; ++
$cell_count) echo "<td></td>";
122 function end_group() {
124 if (strlen($last_group) > 0) {
135 while ($frow = sqlFetchArray($fres)) {
136 $this_group = $frow['group_name'];
137 $titlecols = $frow['titlecols'];
138 $datacols = $frow['datacols'];
139 $data_type = $frow['data_type'];
140 $field_id = $frow['field_id'];
141 $list_id = $frow['list_id'];
144 // if (isset($result[$field_id])) $currvalue = $result[$field_id];
146 // Handle a data category (group) change.
147 if (strcmp($this_group, $last_group) != 0) {
149 if (strlen($last_group) > 0) echo "<br />\n";
150 $group_name = substr($this_group, 1);
151 $last_group = $this_group;
152 echo "<b>" . text(xl_layout_label($group_name)) . "</b>\n";
154 echo "<div class='section'>\n";
155 echo " <table border='0' cellpadding='0'>\n";
158 // Handle starting of a new row.
159 if (($titlecols > 0 && $cell_count >= $CPR) ||
$cell_count == 0) {
161 echo " <tr style='height:30pt'>";
164 if ($item_count == 0 && $titlecols == 0) $titlecols = 1;
166 // Handle starting of a new label cell.
167 if ($titlecols > 0) {
169 echo "<td colspan='" . attr($titlecols) . "' width='10%'";
170 echo ($frow['uor'] == 2) ?
" class='required'" : " class='bold'";
171 if ($cell_count == 2) echo " style='padding-left:10pt'";
173 $cell_count +
= $titlecols;
179 if ($frow['title']) echo (text(xl_layout_label($frow['title'])) . ":"); else echo " ";
183 // Handle starting of a new data cell.
186 echo "<td colspan='" . attr($datacols) . "' width='40%'";
187 if ($data_type < 21 ||
$data_type > 25) echo " class='under'";
188 if ($cell_count > 0) echo " style='padding-left:5pt;'";
190 $cell_count +
= $datacols;
194 generate_print_field($frow, $currvalue);
202 <!-- This should really be in the onload handler but that seems to be unreliable
and can crash Firefox
3. -->
203 <script language
='JavaScript'>
204 var win
= top
.printLogPrint ? top
: opener
.top
;
205 win
.printLogPrint(window
);