misc cosmetic cleanups for sports team use
[openemr.git] / interface / patient_file / encounter / forms.php
blob3dcc97d76e5a84e4d76bec8267a16d62809f1e29
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/forms.inc");
4 include_once("$srcdir/calendar.inc");
5 include_once("$srcdir/acl.inc");
6 ?>
7 <html>
9 <head>
10 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
11 <script type="text/javascript" src="../../../library/dialog.js"></script>
13 <script language="JavaScript">
15 // Process click on Delete link.
16 function deleteme() {
17 dlgopen('../deleter.php?encounter=<?php echo $encounter ?>', '_blank', 500, 450);
18 return false;
21 // Called by the deleter.php window on a successful delete.
22 function imdeleted() {
23 top.Title.location.href = '../patient_file/encounter/encounter_title.php';
24 top.Main.location.href = '../patient_file/encounter/patient_encounter.php?mode=new';
27 </script>
29 </head>
31 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
33 <span class="title">This Encounter</span>
35 $auth_notes_a = acl_check('encounters', 'notes_a');
36 $auth_notes = acl_check('encounters', 'notes');
37 $auth_relaxed = acl_check('encounters', 'relaxed');
39 if (is_numeric($pid)) {
40 $result = getPatientData($pid, "fname,lname,squad");
41 echo " for " . $result['fname'] . " " . $result['lname'];
42 if ($result['squad'] && ! acl_check('squads', $result['squad'])) {
43 $auth_notes_a = $auth_notes = $auth_relaxed = 0;
47 echo ":";
48 if (acl_check('admin', 'super')) {
49 echo "&nbsp;&nbsp;<a href='' onclick='return deleteme()'>" .
50 "<font class='more' style='color:red'>(Delete)</font></a>";
52 echo "<br>\n";
54 if ($result = getFormByEncounter($pid, $encounter, "id, date, form_id, form_name,formdir,user")) {
55 echo "<table>";
56 foreach ($result as $iter) {
57 $formdir = $iter['formdir'];
59 // Skip forms that we are not authorized to see.
60 if (($auth_notes_a) ||
61 ($auth_notes && $iter['user'] == $_SESSION['authUser']) ||
62 ($auth_relaxed && ($formdir == 'sports_fitness' || $formdir == 'podiatry'))) ;
63 else continue;
65 $form_info = getFormInfoById($iter['id']);
66 echo '<tr valign="top">';
67 $user = getNameFromUsername($iter['user']);
69 $form_name = ($formdir == 'newpatient') ? "Patient Encounter" : $iter['form_name'];
71 echo '<td class="text"><span style="font-weight:bold;">' .
72 $user['fname'] . " " . $user['lname'] .'</span></td>';
73 echo "<td valign='top'><a target='Main' href='$rootdir/patient_file/encounter/view_form.php?" .
74 "formname=" . $formdir . "&id=" . $iter{"form_id"} .
75 "' class='text'>$form_name</a></td>\n" .
76 "<td width='25'></td>\n" .
77 "<td valign='top'>";
79 // Use the form's report.php for display.
81 include_once($GLOBALS['incdir'] . "/forms/$formdir/report.php");
82 call_user_func($formdir . "_report", $pid, $iter['encounter'], 2, $iter['form_id']);
84 echo "</td></tr>";
86 echo "</table>";
90 </body>
91 </html>