sql-injection fix in demographics
[openemr.git] / library / ajax / left_nav_issues_ajax.php
blobed27d95154e89ca1cbec2adc42c86be30e66ec81
1 <?php
2 // Copyright (C) 2011 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 $sanitize_all_escapes = true;
10 $fake_register_globals = false;
12 require_once("../../interface/globals.php");
14 $type = $_GET['type'];
16 echo "// pid = $pid, type = $type\n";
18 $res = sqlStatement("SELECT * FROM lists WHERE " .
19 "pid = ? AND type = ? AND activity = 1 AND enddate IS NULL " .
20 "ORDER BY begdate DESC", array($pid, $type));
22 while ($row = sqlFetchArray($res)) {
23 // Note the new sliding menu style requires exactly one <a> tag per list
24 // item, so we use embedded <span> tags to serve as the links.
26 $('#icontainer_<?php echo $type ?>').append("<li>" +
27 "<a href='' id='xxx1' onclick='return false'>" +
28 "<span onclick='return repPopup(" +
29 "\"../patient_file/summary/add_edit_issue.php?issue=" +
30 "<?php echo $row['id']; ?>\")' " +
31 "title='<?php echo htmlspecialchars(xl('View/edit issue')); ?>'>" +
32 "<?php echo $row['begdate']; ?> </span>" +
33 "<span onclick=\"return addEncNotes(<?php echo $row['id']; ?>);\" " +
34 "title='<?php echo htmlspecialchars(xl('Add encounter/notes')); ?>'>" +
35 "[<?php echo htmlspecialchars(xl('Add')); ?>] </span>" +
36 "<span onclick=\"return loadFrame2('ens1','RBot'," +
37 "'patient_file/history/encounters.php?issue=<?php echo $row['id']; ?>')\" " +
38 "title='<?php echo htmlspecialchars(xl('List encounters')); ?>'>" +
39 "<?php echo htmlspecialchars($row['title']); ?></span></a></li>");
40 <?php