forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_medications.php
48 lines (44 loc) · 1.55 KB
/
get_medications.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
// Copyright (C) 2011 Cassian LUP <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
require_once("verify_session.php");
$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'medication' ORDER BY begdate";
$res = sqlStatement($sql, array($pid) );
if(sqlNumRows($res)>0)
{
?>
<table class="class1">
<tr class="header">
<th><?php echo htmlspecialchars( xl('Drug'),ENT_NOQUOTES); ?></th>
<th><?php echo htmlspecialchars( xl('Start Date'),ENT_NOQUOTES); ?></th>
<th><?php echo htmlspecialchars( xl('End Date'),ENT_NOQUOTES); ?></th>
<th><?php echo htmlspecialchars( xl('Referrer'),ENT_NOQUOTES); ?></th>
</tr>
<?php
$even=false;
while ($row = sqlFetchArray($res)) {
if ($even) {
$class="class1_even";
$even=false;
} else {
$class="class1_odd";
$even=true;
}
echo "<tr class='".htmlspecialchars($class,ENT_QUOTES)."'>";
echo "<td>".htmlspecialchars($row['title'],ENT_NOQUOTES)."</td>";
echo "<td>".htmlspecialchars($row['begdate'],ENT_NOQUOTES)."</td>";
echo "<td>".htmlspecialchars($row['enddate'],ENT_NOQUOTES)."</td>";
echo "<td>".htmlspecialchars($row['referredby'],ENT_NOQUOTES)."</td>";
echo "</tr>";
}
echo "</table>";
}
else
{
echo htmlspecialchars( xl("No Results"),ENT_NOQUOTES);
}
?>