dynamic search fix when open patient in a new window (#4377)
[openemr.git] / portal / get_amendments.php
blob5c16364c6e7b03f4f1fd57a11d3c6f8c1708b5f2
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
26 require_once("verify_session.php");
28 $query = "SELECT a.*,lo.title AS AmendmentBy,lo1.title AS AmendmentStatus FROM amendments a
29 INNER JOIN list_options lo ON a.amendment_by = lo.option_id AND lo.list_id='amendment_from'
30 LEFT JOIN list_options lo1 ON a.amendment_status = lo1.option_id AND lo1.list_id='amendment_status'
31 WHERE a.pid = ? ORDER BY amendment_date DESC";
32 $res = sqlStatement($query, array($pid));
33 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)) {
44 echo "<tr class='" . $class . "'>";
45 echo "<td>" . text($row['amendment_date']) . "</td>";
46 echo "<td>" . text($row['AmendmentBy']) . "</td>";
47 echo "<td>" . text($row['amendment_desc']) . "</td>";
48 echo "<td>" . text($row['AmendmentStatus']) . "</td>";
49 echo "</tr>";
52 echo "</table>";
53 } else {
54 echo xlt("No Results");