dump db version
[openemr.git] / portal / get_medications.php
blob8fc5076df0f47c71614484a2de58615673833205
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) {
32 <table class="table table-striped">
33 <tr>
34 <th><?php echo xlt('Drug'); ?></th>
35 <th><?php echo xlt('Start Date'); ?></th>
36 <th><?php echo xlt('End Date'); ?></th>
37 <th><?php echo xlt('Referrer'); ?></th>
38 </tr>
39 <?php
40 $even=false;
41 while ($row = sqlFetchArray($res)) {
42 echo "<tr class='".text($class)."'>";
43 echo "<td>".text($row['title'])."</td>";
44 echo "<td>".text($row['begdate'])."</td>";
45 echo "<td>".text($row['enddate'])."</td>";
46 echo "<td>".text($row['referredby'])."</td>";
47 echo "</tr>";
50 echo "</table>";
51 } else {
52 echo xlt("No Results");