Merge branch 'master' of https://github.com/openemr/openemr into signer-templates
[openemr.git] / portal / get_amendments.php
blobef6735dc462ef9460639b1409425114275527a8e
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) { ?>
33 <table class="table table-striped">
34 <tr class="header">
35 <th><?php echo xlt('Date'); ?></th>
36 <th><?php echo xlt('Requested By'); ?></th>
37 <th><?php echo xlt('Description'); ?></th>
38 <th><?php echo xlt('Status'); ?></th>
39 </tr>
40 <?php
41 $even = false;
42 while ($row = sqlFetchArray($res)) {
43 echo "<tr class='".$class."'>";
44 echo "<td>".text($row['amendment_date'])."</td>";
45 echo "<td>".text($row['AmendmentBy'])."</td>";
46 echo "<td>".text($row['amendment_desc'])."</td>";
47 echo "<td>".text($row['AmendmentStatus'])."</td>";
48 echo "</tr>";
51 echo "</table>";
52 } else {
53 echo xlt("No Results");