Highway to PSR2
[openemr.git] / contrib / forms / example2 / report.php
blobebd0079b5b92965b38ab0ab82a60e3ac638e4deb
1 <?php
2 include_once("../../globals.php");
3 include_once($GLOBALS["srcdir"]."/api.inc");
5 /** CHANGE THIS, the name of the function is significant and **
6 ** must be changed to match the folder name **/
7 function example_report($pid, $encounter, $cols, $id)
10 /** CHANGE THIS - name of the database table associated with this form **/
11 $table_name = "form_example";
13 $count = 0;
14 $data = formFetch($table_name, $id);
16 if ($data) {
17 print "<table><tr>";
19 foreach ($data as $key => $value) {
20 if ($key == "id" || $key == "pid" || $key == "user" ||
21 $key == "groupname" || $key == "authorized" ||
22 $key == "activity" || $key == "date" ||
23 $value == "" || $value == "0000-00-00 00:00:00" ||
24 $value == "n") {
25 // skip certain fields and blank data
26 continue;
29 $key=ucwords(str_replace("_", " ", $key));
30 print("<tr>\n");
31 print("<tr>\n");
32 print "<td><span class=bold>$key: </span><span class=text>$value</span></td>";
33 $count++;
34 if ($count == $cols) {
35 $count = 0;
36 print "</tr><tr>\n";
41 print "</tr></table>";