changes to prior commit for coding standards compliance
[openemr.git] / portal / get_amendments.php
blob4378bc4a1c67cea8132a35e6ab641a56ed58ebc4
1 <?php
3 /**
4 * Patient Portal Amendments
6 * Copyright (C) 2014 Ensoftek
7 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 3
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Hema Bandaru <hemab@drcloudemr.com>
22 * @author Jerry Padgett <sjpadgett@gmail.com>
23 * @link http://www.open-emr.org
25 require_once("verify_session.php");
27 $query = "SELECT a.*,lo.title AS AmendmentBy,lo1.title AS AmendmentStatus FROM amendments a
28 INNER JOIN list_options lo ON a.amendment_by = lo.option_id AND lo.list_id='amendment_from'
29 LEFT JOIN list_options lo1 ON a.amendment_status = lo1.option_id AND lo1.list_id='amendment_status'
30 WHERE a.pid = ? ORDER BY amendment_date DESC";
31 $res = sqlStatement($query, array($pid) );
32 if ( sqlNumRows($res) > 0 ) { ?>
34 <table class="table table-striped">
35 <tr class="header">
36 <th><?php echo xlt('Date'); ?></th>
37 <th><?php echo xlt('Requested By'); ?></th>
38 <th><?php echo xlt('Description'); ?></th>
39 <th><?php echo xlt('Status'); ?></th>
40 </tr>
41 <?php
42 $even = false;
43 while ($row = sqlFetchArray($res)) {
45 echo "<tr class='".$class."'>";
46 echo "<td>".text($row['amendment_date'])."</td>";
47 echo "<td>".text($row['AmendmentBy'])."</td>";
48 echo "<td>".text($row['amendment_desc'])."</td>";
49 echo "<td>".text($row['AmendmentStatus'])."</td>";
50 echo "</tr>";
52 echo "</table>";
54 else
56 echo xlt("No Results");