refactor(ccdaservice): extract and test cleanCode function (#6785)
[openemr.git] / portal / get_allergies.php
blob48da59afe85b27267cc845b39599ed4b66d55e20
1 <?php
3 /**
5 * Copyright (C) 2016-2019 Jerry Padgett <sjpadgett@gmail.com>
6 * Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Cassian LUP <cassi.lup@gmail.com>
21 * @link http://www.open-emr.org
25 require_once("verify_session.php");
27 $sql = "SELECT * FROM lists WHERE pid = ? AND type = 'allergy' ORDER BY begdate";
29 $res = sqlStatement($sql, array($pid));
31 if (sqlNumRows($res) > 0) {
33 <table class="table table-striped">
34 <tr class="header">
35 <th><?php echo xlt('Title'); ?></th>
36 <th><?php echo xlt('Reported Date'); ?></th>
37 <th><?php echo xlt('Start Date'); ?></th>
38 <th><?php echo xlt('End Date'); ?></th>
39 <th><?php echo xlt('Referrer'); ?></th>
40 </tr>
41 <?php
42 $even = false;
43 while ($row = sqlFetchArray($res)) {
44 echo "<tr class='" . ($class ?? '') . "'>";
45 echo "<td>" . text($row['title']) . "</td>";
46 echo "<td>" . text($row['date']) . "</td>";
47 echo "<td>" . text($row['begdate']) . "</td>";
48 echo "<td>" . text($row['enddate']) . "</td>";
49 echo "<td>" . text($row['referredby']) . "</td>";
50 echo "</tr>";
53 echo "</table>";
54 } else {
55 echo xlt("No Results");