corrected table name from form_weel_child to form_well_infant
[openemr.git] / contrib / forms / well_infant / report.php
blobb9bb77c07b17935a300ac6be413f67f8ade88676
1 <?php
2 //------------Forms generated from formsWiz
3 include_once("../../globals.php");
4 include_once($GLOBALS["srcdir"]."/api.inc");
5 include_once($GLOBALS["srcdir"]."/sql.inc");
6 function well_infant_report( $pid, $encounter, $cols, $id) {
7 $count = 0;
8 $data = formFetch("form_well_infant", $id);
9 $sql = "SELECT name from form_well_infant_checks where foreign_id = '" . mysql_real_escape_string($id) . "'";
10 $results = sqlQ($sql);
11 $data2 = array();
12 while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
13 $data2[] = $row['name'];
15 $data = array_merge($data,$data2);
16 if ($data) {
17 print "<table><tr>";
18 foreach($data as $key => $value) {
19 if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") {
20 continue;
22 if ($value == "on") {
23 $value = "yes";
26 $key=ucwords(str_replace("_"," ",$key));
27 if (is_numeric($key)){
28 $key = "check";
30 print "<td><span class=bold>$key: </span><span class=text>$value</span></td>";
31 $count++;
32 if ($count == $cols) {
33 $count = 0;
34 print "</tr><tr>\n";
38 print "</tr></table>";
40 ?>