minor fix in hover for prior commit
[openemr.git] / interface / fax / fax_dispatch_newpid.php
blobf65353e07fa9cce8d971e5add3c44251bfbe05b0
1 <?php
2 // Copyright (C) 2008, 2010 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 // This is invoked via a jQuery getScript() from fax_dispatch.php.
10 // Its purpose is to return JavaScript that will set up patient-
11 // specific data when a patient is selected. Currently this data
12 // is just the caller's selection list of recent encounters.
14 $fake_register_globals=false;
15 $sanitize_all_escapes=true;
17 require_once("../globals.php");
18 require_once("$srcdir/sql.inc");
20 $res = sqlStatement("SELECT date, encounter, reason FROM form_encounter " .
21 "WHERE pid = ? " .
22 "ORDER BY date DESC, encounter DESC LIMIT 10", array($_GET['p']));
24 echo "var s = document.forms[0].form_copy_sn_visit;\n";
25 echo "s.options.length = 0;\n";
27 while ($row = sqlFetchArray($res)) {
28 echo "s.options[s.options.length] = new Option(" .
29 "'" . substr($row['date'], 0, 10) . " " .
30 addslashes(strtr(substr($row['reason'], 0, 40), "\r\n", " ")) . "', " .
31 "'" . $row['encounter'] . "'" .
32 ");\n";