Highway to PSR2
[openemr.git] / interface / patient_file / summary / track_anything_fragment.php
blob0d097490e2d09de66b98b6955bb622bc241b60a9
1 <?php
2 /*******************************************************************************\
3 * Copyright (C) 2014 Joe Slam (joe@produnis.de) *
4 * *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, *
17 * see <http://opensource.org/licenses/gpl-license.php> *
18 ********************************************************************************
19 * @package OpenEMR
20 * @author Joe Slam <joe@produnis.de>
21 * @link http://www.open-emr.org
27 require_once("../../globals.php");
30 <div id='labdata' style='margin-top: 3px; margin-left: 10px; margin-right: 10px'><!--outer div-->
31 <br>
32 <?php
33 //retrieve tracks.
34 $spell = "SELECT form_name, MAX(form_track_anything_results.track_timestamp) as maxdate, form_id " .
35 "FROM forms " .
36 "JOIN form_track_anything_results ON forms.form_id = form_track_anything_results.track_anything_id " .
37 "WHERE forms.pid = ? " .
38 "AND formdir = ? " .
39 "GROUP BY form_name " .
40 "ORDER BY maxdate DESC ";
41 $result = sqlQuery($spell, array($pid, 'track_anything'));
42 if (!$result) { //If there are no disclosures recorded
44 <span class='text'> <?php echo htmlspecialchars(xl("No tracks have been documented."), ENT_NOQUOTES);
46 </span>
47 <?php
48 } else { // We have some tracks here...
49 echo "<span class='text'>";
50 echo xlt('Available Tracks') . ":";
51 echo $result;
52 echo "<ul>";
53 $result=sqlStatement($spell, array($pid, 'track_anything'));
54 while ($myrow = sqlFetchArray($result)) {
55 $formname = $myrow['form_name'];
56 $thedate = $myrow['maxdate'];
57 $formid = $myrow['form_id'];
58 echo "<li><a href='../../forms/track_anything/history.php?formid=" . attr($formid) . "'>" . text($formname) . "</a></li> (" . text($thedate) . ")</li>";
61 echo "</ul>";
62 echo "</span>";
63 } ?>
64 <br />
65 <br />
66 </div>