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.
9 require_once("../../globals.php");
10 require_once("$srcdir/acl.inc");
11 require_once("$srcdir/options.inc.php");
12 require_once("$srcdir/patient.inc");
14 $CPR = 4; // cells per row
16 // The form name is passed to us as a GET parameter.
17 $formname = formData('formname', 'G');
19 $tmp = sqlQuery("SELECT title FROM list_options WHERE " .
20 "list_id = 'lbfnames' AND option_id = '$formname' LIMIT 1");
21 $formtitle = $tmp['title'];
23 $fres = sqlStatement("SELECT * FROM layout_options " .
24 "WHERE form_id = '$formname' AND uor > 0 " .
25 "ORDER BY group_name, seq");
29 <?php
html_header_show();?
>
33 font
-family
: Arial
, Helvetica
, sans
-serif
;
39 padding
: 5pt
5pt
5pt
5pt
;
45 border
-color
: #000000;
63 border
-width
: 0 0 1px
0;
64 border
-color
: #999999;
85 <body bgcolor
='#ffffff'>
88 <?php
echo genFacilityTitle($formtitle, -1); ?
>
90 <span
class='subhead'>
91 <?php
xl('Patient','e') ?
>: ________________________________________
 
;
92 <?php
xl('Clinic','e') ?
>: ____________________
 
;
93 <?php
xl('Date','e') ?
>: ____________________
<br
/> 
;<br
/>
99 global $item_count, $cell_count;
100 if ($item_count > 0) {
107 global $cell_count, $CPR;
109 if ($cell_count > 0) {
110 for (; $cell_count < $CPR; ++
$cell_count) echo "<td></td>";
116 function end_group() {
118 if (strlen($last_group) > 0) {
129 while ($frow = sqlFetchArray($fres)) {
130 $this_group = $frow['group_name'];
131 $titlecols = $frow['titlecols'];
132 $datacols = $frow['datacols'];
133 $data_type = $frow['data_type'];
134 $field_id = $frow['field_id'];
135 $list_id = $frow['list_id'];
138 // if (isset($result[$field_id])) $currvalue = $result[$field_id];
140 // Handle a data category (group) change.
141 if (strcmp($this_group, $last_group) != 0) {
143 if (strlen($last_group) > 0) echo "<br />\n";
144 $group_name = substr($this_group, 1);
145 $last_group = $this_group;
146 echo "<b>" . xl_layout_label($group_name) . "</b>\n";
148 echo "<div class='section'>\n";
149 echo " <table border='0' cellpadding='0'>\n";
152 // Handle starting of a new row.
153 if (($titlecols > 0 && $cell_count >= $CPR) ||
$cell_count == 0) {
155 echo " <tr style='height:30pt'>";
158 if ($item_count == 0 && $titlecols == 0) $titlecols = 1;
160 // Handle starting of a new label cell.
161 if ($titlecols > 0) {
163 echo "<td colspan='$titlecols' width='10%'";
164 echo ($frow['uor'] == 2) ?
" class='required'" : " class='bold'";
165 if ($cell_count == 2) echo " style='padding-left:10pt'";
167 $cell_count +
= $titlecols;
173 if ($frow['title']) echo (xl_layout_label($frow['title']) . ":"); else echo " ";
177 // Handle starting of a new data cell.
180 echo "<td colspan='$datacols' width='40%'";
181 if ($data_type < 21 ||
$data_type > 25) echo " class='under'";
182 if ($cell_count > 0) echo " style='padding-left:5pt;'";
184 $cell_count +
= $datacols;
188 generate_print_field($frow, $currvalue);
196 <!-- This should really be in the onload handler but that seems to be unreliable
and can crash Firefox
3. -->
197 <script language
='JavaScript'>