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