2 // Copyright (C) 2008 Rod Roark <rod@sunsetsystems.com>
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 require_once("../../globals.php");
10 require_once("$srcdir/forms.inc");
11 require_once("$srcdir/patient.inc");
12 require_once("$srcdir/lists.inc");
13 require_once("$srcdir/acl.inc");
15 // Get relevant ACL info.
16 $auth_notes_a = acl_check('encounters', 'notes_a');
17 $auth_notes = acl_check('encounters', 'notes');
18 $auth_relaxed = acl_check('encounters', 'relaxed');
19 $auth_demo = acl_check('patients' , 'demo');
21 $tmp = getPatientData($pid, "squad");
22 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
23 $auth_notes_a = $auth_notes = $auth_demo = $auth_relaxed = 0;
25 if (!($auth_notes_a ||
$auth_notes ||
$auth_relaxed)) {
26 echo "<body>\n<html>\n";
27 echo "<p>(".xl('Encounters not authorized').")</p>\n";
28 echo "</body>\n</html>\n";
34 <?php
html_header_show();?
>
35 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
36 <script type
="text/javascript" src
="../../../library/tooltip.js"></script
>
38 <script language
="JavaScript">
40 function toencounter(enc
, datestr
) {
42 parent
.parent
.left_nav
.setEncounter(datestr
, enc
, parent
.window
.name
);
43 parent
.location
.href
= '../encounter/encounter_top.php?set_encounter=' + enc
;
50 <body
class="body_bottom">
52 <font
class='title'><?php
xl('Stength and Conditioning','e'); ?
></font
>
58 <td
class='bold'><?php
xl('Date','e'); ?
></td
>
59 <td
class='bold'><?php
xl('Reason','e'); ?
></td
>
60 <td
class='bold'><?php
xl('Provider','e'); ?
></td
>
64 $res = sqlStatement("SELECT " .
65 "f.encounter, f.user, fe.date, fe.reason, fe.sensitivity " .
67 "LEFT OUTER JOIN form_encounter AS fe ON fe.pid = f.pid " .
68 "AND fe.encounter = f.encounter " .
69 "WHERE f.pid = '$pid' AND f.formdir = 'strength_conditioning' " .
70 "ORDER BY fe.date DESC, f.encounter DESC");
72 while ($row = sqlFetchArray($res)) {
73 $raw_encounter_date = date("Y-m-d", strtotime($row['date']));
74 $reason_string = $row['reason'];
75 $auth_sensitivity = true;
77 $href = "javascript:window.toencounter(" . $row['encounter'] . ",\"" .
78 oeFormatShortDate($raw_encounter_date) . "\")";
79 $linkbeg = "<a class='text' href='$href'>";
82 if ($row['sensitivity']) {
83 $auth_sensitivity = acl_check('sensitivities', $row['sensitivity']);
84 if (!$auth_sensitivity) {
85 $reason_string = "(No access)";
86 $linkbeg = "<span class='text'>";
93 // show encounter date
94 echo "<td valign='top'>$linkbeg$raw_encounter_date$linkend</td>\n";
96 // show encounter reason/title
97 echo "<td valign='top'>$linkbeg" . $reason_string . "$linkend</td>\n";
99 // show user who created the encounter
100 echo "<td valign='top'>$linkbeg" . $row['user'] . "$linkend</td>\n";