forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.php
40 lines (39 loc) · 1.15 KB
/
report.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
//------------Forms generated from formsWiz
include_once("../../globals.php");
include_once($GLOBALS["srcdir"]."/api.inc");
include_once($GLOBALS["srcdir"]."/sql.inc");
function evaluation_report( $pid, $encounter, $cols, $id) {
$count = 0;
$data = formFetch("form_evaluation", $id);
$sql = "SELECT name from form_evaluation_checks where foreign_id = '" . add_escape_custom($id) . "'";
$results = sqlQ($sql);
$data2 = array();
while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
$data2[] = $row['name'];
}
$data = array_merge($data,$data2);
if ($data) {
print "<table><tr>";
foreach($data as $key => $value) {
if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") {
continue;
}
if ($value == "on") {
$value = "yes";
}
$key=ucwords(str_replace("_"," ",$key));
if (is_numeric($key)){
$key = "check";
}
print "<td><span class=bold>$key: </span><span class=text>$value</span></td>";
$count++;
if ($count == $cols) {
$count = 0;
print "</tr><tr>\n";
}
}
}
print "</tr></table>";
}
?>