fix: quick fix to enforce support of x509 database connection on install (#6157)
[openemr.git] / interface / fax / fax_dispatch_newpid.php
blob6cd53a888cbddc82c103da08a8b4f997092adec8
1 <?php
3 // Copyright (C) 2008, 2010 Rod Roark <rod@sunsetsystems.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This is invoked via a jQuery getScript() from fax_dispatch.php.
11 // Its purpose is to return JavaScript that will set up patient-
12 // specific data when a patient is selected. Currently this data
13 // is just the caller's selection list of recent encounters.
16 require_once("../globals.php");
18 use OpenEMR\Common\Csrf\CsrfUtils;
20 if (!CsrfUtils::verifyCsrfToken($_GET["csrf_token_form"])) {
21 CsrfUtils::csrfNotVerified();
24 $res = sqlStatement("SELECT date, encounter, reason FROM form_encounter " .
25 "WHERE pid = ? " .
26 "ORDER BY date DESC, encounter DESC LIMIT 10", array($_GET['p']));
28 echo "var s = document.forms[0].form_copy_sn_visit;\n";
29 echo "s.options.length = 0;\n";
31 while ($row = sqlFetchArray($res)) {
32 echo "s.options[s.options.length] = new Option(" .
33 "'" . attr(substr($row['date'], 0, 10)) . " " .
34 attr(strtr(substr($row['reason'], 0, 40), "\r\n", " ")) . "', " .
35 "'" . attr($row['encounter']) . "'" .
36 ");\n";