consolidated reviewMode in forms.php (this can then be used for view only acl users...
[openemr.git] / portal / get_medications.php
blobf6835190be62328baa84c24c76388fae5c3b934c
1 <?php
2 /**
4 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
5 * Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
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 Cassian LUP <cassi.lup@gmail.com>
20 * @author Jerry Padgett <sjpadgett@gmail.com>
21 * @link http://www.open-emr.org
24 require_once("verify_session.php");
26 $sql = "SELECT * FROM lists WHERE pid = ? AND type = 'medication' ORDER BY begdate";
28 $res = sqlStatement($sql, array($pid) );
30 if(sqlNumRows($res)>0)
33 <table class="table table-striped">
34 <tr>
35 <th><?php echo xlt('Drug'); ?></th>
36 <th><?php echo xlt('Start Date'); ?></th>
37 <th><?php echo xlt('End Date'); ?></th>
38 <th><?php echo xlt('Referrer'); ?></th>
39 </tr>
40 <?php
41 $even=false;
42 while ($row = sqlFetchArray($res)) {
44 echo "<tr class='".text($class)."'>";
45 echo "<td>".text($row['title'])."</td>";
46 echo "<td>".text($row['begdate'])."</td>";
47 echo "<td>".text($row['enddate'])."</td>";
48 echo "<td>".text($row['referredby'])."</td>";
49 echo "</tr>";
51 echo "</table>";
53 else
55 echo xlt("No Results");