fix: faxsms psr7 vendor fix (#7794)
[openemr.git] / interface / patient_file / summary / lbf_fragment.php
blob187b3d341e266084e6b308e8a636a35a6e5b352a
1 <?php
3 /**
4 * Functions to globally validate and prepare data for sql database insertion.
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @author Rod Roark <rod@sunsetsystems.com>
10 * @copyright Copyright (c) 2010-2018 Brady Miller <brady.g.miller@gmail.com>
11 * @copyright Copyright (c) 2011 Rod Roark <rod@sunsetsystems.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../../globals.php");
17 use OpenEMR\Common\Csrf\CsrfUtils;
19 if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
20 CsrfUtils::csrfNotVerified();
23 $lbf_form_id = $_GET['formname'];
25 <div id='<?php echo attr($lbf_form_id); ?>' style='margin-top: 3px; margin-left: 10px; margin-right: 10px'>
26 <br />
27 <?php
28 // Retrieve most recent instance of this form for this patient.
29 $result = sqlQuery(
30 "SELECT f.form_id, f.form_name, fe.date " .
31 "FROM forms AS f, form_encounter AS fe WHERE " .
32 "f.pid = ? AND f.formdir = ? AND " .
33 "f.deleted = 0 AND " .
34 "fe.pid = f.pid AND fe.encounter = f.encounter " .
35 "ORDER BY fe.date DESC, f.encounter DESC, f.date DESC " .
36 "LIMIT 1",
37 array($pid, $lbf_form_id)
40 if (!$result) { //If there are none
42 <span class='text'> <?php echo xlt("None have been documented"); ?>
43 </span>
44 <?php } else { ?>
45 <span class='text'><b>
46 <?php
47 echo text(xl('Most recent from') . ": " .
48 oeFormatShortDate(substr($result['date'], 0, 10)));
50 </b></span>
51 <br />
52 <br />
53 <?php
54 include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
55 lbf_report('', '', 2, $result['form_id'], $lbf_form_id);
57 <span class='text'>
58 <br />
59 <a href='../encounter/trend_form.php?formname=<?php echo attr_url($lbf_form_id); ?>' onclick='top.restoreSession()'>
60 <?php echo xlt('Click here to view and graph'); ?>
61 </a>
62 </span>
63 <?php } ?>
64 <br />
65 <br />
66 </div>