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 // Currently this will print only a blank form, but some code was
10 // preserved here and in options.inc.php to ease future support for
11 // data for a specified patient.
13 require_once("../../globals.php");
14 require_once("$srcdir/acl.inc");
15 require_once("$srcdir/options.inc.php");
16 require_once("$srcdir/patient.inc");
18 $CPR = 4; // cells per row
20 /*********************************************************************
21 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
22 $result2 = getEmployerData($pid);
23 // Check authorization.
25 if (!acl_check('patients','demo','','write'))
26 die(xl('Demographics not authorized.'));
27 if ($result['squad'] && ! acl_check('squads', $result['squad']))
28 die(xl('You are not authorized to access this squad.'));
30 $insurancei = getInsuranceProviders();
31 *********************************************************************/
33 $fres = sqlStatement("SELECT * FROM layout_options " .
34 "WHERE form_id = 'DEM' AND uor > 0 " .
35 "ORDER BY group_name, seq");
39 <?php
html_header_show();?
>
43 font
-family
: Arial
, Helvetica
, sans
-serif
;
49 padding
: 5pt
5pt
5pt
5pt
;
55 border
-color
: #000000;
68 border
-width
: 0 0 1px
0;
69 border
-color
: #999999;
90 <body bgcolor
='#ffffff'>
93 <?php
echo genFacilityTitle(xl('Registration Form'), -1); ?
>
98 global $item_count, $cell_count;
99 if ($item_count > 0) {
106 global $cell_count, $CPR;
108 if ($cell_count > 0) {
109 for (; $cell_count < $CPR; ++
$cell_count) echo "<td></td>";
115 function end_group() {
117 if (strlen($last_group) > 0) {
128 while ($frow = sqlFetchArray($fres)) {
129 $this_group = $frow['group_name'];
130 $titlecols = $frow['titlecols'];
131 $datacols = $frow['datacols'];
132 $data_type = $frow['data_type'];
133 $field_id = $frow['field_id'];
134 $list_id = $frow['list_id'];
137 if (strpos($field_id, 'em_') === 0) {
138 $tmp = substr($field_id, 3);
139 // if (isset($result2[$tmp])) $currvalue = $result2[$tmp];
142 // if (isset($result[$field_id])) $currvalue = $result[$field_id];
145 // Handle a data category (group) change.
146 if (strcmp($this_group, $last_group) != 0) {
148 if (strlen($last_group) > 0) echo "<br />\n";
149 $group_name = substr($this_group, 1);
150 $last_group = $this_group;
151 echo "<b>" . xl_layout_label($group_name) . "</b>\n";
153 echo "<div class='section'>\n";
154 echo " <table border='0' cellpadding='0'>\n";
157 // Handle starting of a new row.
158 if (($titlecols > 0 && $cell_count >= $CPR) ||
$cell_count == 0) {
160 echo " <tr style='height:30pt'>";
163 if ($item_count == 0 && $titlecols == 0) $titlecols = 1;
165 // Handle starting of a new label cell.
166 if ($titlecols > 0) {
168 echo "<td colspan='$titlecols' width='10%'";
169 echo ($frow['uor'] == 2) ?
" class='required'" : " class='bold'";
170 if ($cell_count == 2) echo " style='padding-left:10pt'";
172 $cell_count +
= $titlecols;
178 if ($frow['title']) echo (xl_layout_label($frow['title']) . ":"); else echo " ";
182 // Handle starting of a new data cell.
185 echo "<td colspan='$datacols' width='40%' class='under'";
186 if ($cell_count > 0) echo " style='padding-left:5pt;'";
188 $cell_count +
= $datacols;
192 generate_print_field($frow, $currvalue);
200 <!-- This should really be in the onload handler but that seems to be unreliable
and can crash Firefox
3. -->
201 <script language
='JavaScript'>