Centralized formatting.inc.php include
[openemr.git] / interface / patient_file / summary / lbf_fragment.php
blobfb1d10604a2fcd6f1e16a6b8f9e883399d10d479
1 <?php
2 /*******************************************************************************\
3 * Copyright 2010 Brady Miller <brady@sparmy.com> *
4 * Copyright 2011 Rod Roark <rod@sunsetsystems.com> *
5 * *
6 * This program is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU General Public License *
8 * as published by the Free Software Foundation; either version 2 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ********************************************************************************/
21 //SANITIZE ALL ESCAPES
22 $sanitize_all_escapes = true;
24 //STOP FAKE REGISTER GLOBALS
25 $fake_register_globals = false;
27 require_once("../../globals.php");
29 $lbf_form_id = $_GET['formname'];
31 <div id='<?php echo $lbf_form_id; ?>' style='margin-top: 3px; margin-left: 10px; margin-right: 10px'>
32 <br />
33 <?php
34 // Retrieve most recent instance of this form for this patient.
35 $result = sqlQuery("SELECT f.form_id, f.form_name, fe.date " .
36 "FROM forms AS f, form_encounter AS fe WHERE " .
37 "f.pid = ? AND f.formdir = ? AND " .
38 "f.deleted = 0 AND " .
39 "fe.pid = f.pid AND fe.encounter = f.encounter " .
40 "ORDER BY fe.date DESC, f.encounter DESC, f.date DESC " .
41 "LIMIT 1",
42 array($pid, $lbf_form_id));
44 if (!$result) { //If there are none
46 <span class='text'> <?php echo htmlspecialchars(xl("None have been documented"), ENT_NOQUOTES); ?>
47 </span>
48 <?php } else { ?>
49 <span class='text'><b>
50 <?php
51 echo htmlspecialchars(xl('Most recent from') . ": " .
52 oeFormatShortDate(substr($result['date'], 0, 10)), ENT_NOQUOTES);
54 </b></span>
55 <br />
56 <br />
57 <?php
58 include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
59 call_user_func("lbf_report", '', '', 2, $result['form_id'], $lbf_form_id);
61 <span class='text'>
62 <br />
63 <a href='../encounter/trend_form.php?formname=<?php echo $lbf_form_id; ?>'
64 onclick='top.restoreSession()'>
65 <?php echo htmlspecialchars(xl('Click here to view and graph'),ENT_NOQUOTES);?>
66 </a>
67 </span>
68 <?php } ?>
69 <br />
70 <br />
71 </div>