2 //////////////////////////////////////////////////////////////////////
3 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
4 // View.php is an exact duplicate of new.php. If you wish to make
5 // any changes, then change new.php and either (recommended) make
6 // view.php a symbolic link to new.php, or copy new.php to view.php.
8 // And if you check in a change to either module, be sure to check
9 // in the other (identical) module also.
11 // This nonsense will go away if we ever move to subversion.
12 //////////////////////////////////////////////////////////////////////
14 // Copyright (C) 2006-2007 Rod Roark <rod@sunsetsystems.com>
16 // This program is free software; you can redistribute it and/or
17 // modify it under the terms of the GNU General Public License
18 // as published by the Free Software Foundation; either version 2
19 // of the License, or (at your option) any later version.
21 include_once("../../globals.php");
22 include_once("$srcdir/api.inc");
23 include_once("$srcdir/forms.inc");
27 if (! $encounter) { // comes from globals.php
28 die("Internal error: we do not seem to be in an encounter!");
31 function rbvalue($rbname) {
32 $tmp = $_POST[$rbname];
33 if (! $tmp) $tmp = '0';
37 function cbvalue($cbname) {
38 return $_POST[$cbname] ?
'1' : '0';
41 function invalue($inname) {
42 return (int) trim($_POST[$inname]);
45 function txvalue($txname) {
46 return "'" . trim($_POST[$txname]) . "'";
49 function rbinput($name, $value, $desc, $colname) {
51 $ret = "<input type='radio' name='$name' value='$value'";
52 if ($row[$colname] == $value) $ret .= " checked";
57 function rbcell($name, $value, $desc, $colname) {
58 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
61 function cbinput($name, $colname) {
63 $ret = "<input type='checkbox' name='$name' value='1'";
64 if ($row[$colname]) $ret .= " checked";
69 function cbcell($name, $desc, $colname) {
70 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
73 $formid = $_GET['id'];
75 // If Save was clicked, save the info.
77 if ($_POST['bn_save']) {
78 $fiinjmin = (int) $_POST['form_injmin'];
80 // If updating an existing form...
83 $query = "UPDATE form_football_injury_audit SET " .
84 "fiinjmin = " . invalue('form_injmin') . ", " .
85 "fiinjtime = " . rbvalue('form_injtime') . ", " .
86 "fimatchtype = " . rbvalue('form_matchtype') . ", " .
87 "fimech_tackling = " . cbvalue('form_mech_tackling') . ", " .
88 "fimech_tackled = " . cbvalue('form_mech_tackled') . ", " .
89 "fimech_collision = " . cbvalue('form_mech_collision') . ", " .
90 "fimech_kicked = " . cbvalue('form_mech_kicked') . ", " .
91 "fimech_elbow = " . cbvalue('form_mech_elbow') . ", " .
92 "fimech_nofoul = " . cbvalue('form_mech_nofoul') . ", " .
93 "fimech_oppfoul = " . cbvalue('form_mech_oppfoul') . ", " .
94 "fimech_ownfoul = " . cbvalue('form_mech_ownfoul') . ", " .
95 "fimech_yellow = " . cbvalue('form_mech_yellow') . ", " .
96 "fimech_red = " . cbvalue('form_mech_red') . ", " .
97 "fimech_passing = " . cbvalue('form_mech_passing') . ", " .
98 "fimech_shooting = " . cbvalue('form_mech_shooting') . ", " .
99 "fimech_running = " . cbvalue('form_mech_running') . ", " .
100 "fimech_dribbling = " . cbvalue('form_mech_dribbling') . ", " .
101 "fimech_heading = " . cbvalue('form_mech_heading') . ", " .
102 "fimech_jumping = " . cbvalue('form_mech_jumping') . ", " .
103 "fimech_landing = " . cbvalue('form_mech_landing') . ", " .
104 "fimech_fall = " . cbvalue('form_mech_fall') . ", " .
105 "fimech_stretching = " . cbvalue('form_mech_stretching') . ", " .
106 "fimech_turning = " . cbvalue('form_mech_turning') . ", " .
107 "fimech_throwing = " . cbvalue('form_mech_throwing') . ", " .
108 "fimech_diving = " . cbvalue('form_mech_diving') . ", " .
109 "fimech_overuse = " . cbvalue('form_mech_overuse') . ", " .
110 "fimech_othercon = " . txvalue('form_mech_othercon') . ", " .
111 "fimech_othernon = " . txvalue('form_mech_othernon') . ", " .
112 "fisurface = " . rbvalue('form_surface') . ", " .
113 "fiposition = " . rbvalue('form_position') . ", " .
114 "fifootwear = " . rbvalue('form_footwear') . ", " .
115 "fiside = " . rbvalue('form_side') . ", " .
116 "firemoved = " . rbvalue('form_removed') . " " .
117 "WHERE id = '$formid'";
118 sqlStatement($query);
121 // If adding a new form...
124 $query = "INSERT INTO form_football_injury_audit ( " .
125 "fiinjmin, fiinjtime, fimatchtype, " .
126 "fimech_tackling, fimech_tackled, fimech_collision, " .
127 "fimech_kicked, fimech_elbow, fimech_nofoul, fimech_oppfoul, " .
128 "fimech_ownfoul, fimech_yellow, fimech_red, fimech_passing, " .
129 "fimech_shooting, fimech_running, fimech_dribbling, fimech_heading, " .
130 "fimech_jumping, fimech_landing, fimech_fall, fimech_stretching, " .
131 "fimech_turning, fimech_throwing, fimech_diving, fimech_overuse, " .
132 "fimech_othercon, fimech_othernon, fisurface, fiposition, fifootwear, " .
133 "fiside, firemoved " .
135 invalue('form_injmin') . ", " .
136 rbvalue('form_injtime') . ", " .
137 rbvalue('form_matchtype') . ", " .
138 cbvalue('form_mech_tackling') . ", " .
139 cbvalue('form_mech_tackled') . ", " .
140 cbvalue('form_mech_collision') . ", " .
141 cbvalue('form_mech_kicked') . ", " .
142 cbvalue('form_mech_elbow') . ", " .
143 cbvalue('form_mech_nofoul') . ", " .
144 cbvalue('form_mech_oppfoul') . ", " .
145 cbvalue('form_mech_ownfoul') . ", " .
146 cbvalue('form_mech_yellow') . ", " .
147 cbvalue('form_mech_red') . ", " .
148 cbvalue('form_mech_passing') . ", " .
149 cbvalue('form_mech_shooting') . ", " .
150 cbvalue('form_mech_running') . ", " .
151 cbvalue('form_mech_dribbling') . ", " .
152 cbvalue('form_mech_heading') . ", " .
153 cbvalue('form_mech_jumping') . ", " .
154 cbvalue('form_mech_landing') . ", " .
155 cbvalue('form_mech_fall') . ", " .
156 cbvalue('form_mech_stretching') . ", " .
157 cbvalue('form_mech_turning') . ", " .
158 cbvalue('form_mech_throwing') . ", " .
159 cbvalue('form_mech_diving') . ", " .
160 cbvalue('form_mech_overuse') . ", " .
161 txvalue('form_mech_othercon') . ", " .
162 txvalue('form_mech_othernon') . ", " .
163 rbvalue('form_surface') . ", " .
164 rbvalue('form_position') . ", " .
165 rbvalue('form_footwear') . ", " .
166 rbvalue('form_side') . ", " .
167 rbvalue('form_removed') . " " .
169 $newid = sqlInsert($query);
170 addForm($encounter, "Football Injury Audit", $newid, "football_injury_audit", $pid, $userauthorized);
173 formHeader("Redirecting....");
180 $row = sqlQuery ("SELECT * FROM form_football_injury_audit WHERE " .
181 "id = '$formid' AND activity = '1'") ;
186 <?
html_header_show();?
>
187 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
189 .billcell
{ font
-family
: sans
-serif
; font
-size
: 10pt
}
192 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
194 <script language
="JavaScript">
196 // Pop up the coding window.
197 function docoding() {
198 var width
= screen
.width
- 50;
199 if (!isNaN(top
.screenX
)) {
200 width
-= top
.screenX
;
201 } else if (!isNaN(top
.screenLeft
)) {
202 width
-= top
.screenLeft
;
204 if (width
> 1000) width
= 1000;
205 dlgopen('../../patient_file/encounter/coding_popup.php', '_blank', width
, 550);
211 <body
<?
echo $top_bg_line;?
> topmargin
="0" rightmargin
="0" leftmargin
="2" bottommargin
="0" marginwidth
="2" marginheight
="0">
212 <form method
="post" action
="<? echo $rootdir ?>/forms/football_injury_audit/new.php?id=<? echo $formid ?>"
213 onsubmit
="return top.restoreSession()">
217 <p
class='title' style
='margin-top:8px;margin-bottom:8px'>Football Injury Statistics
</p
>
219 <table border
='1' width
='98%'>
221 <tr bgcolor
='#dddddd'>
222 <td colspan
='2' align
='center'><b
>Time of Injury
</b
></td
>
226 <td nowrap
>Match Play
</td
>
232 <input type
='text' name
='form_injmin' size
='4'
233 value
='<? echo addslashes($row['fiinjmin
']) ?>' />
235 <?
echo rbcell('form_injtime', '1', 'Warm Up' , 'fiinjtime') ?
>
236 <?
echo rbcell('form_injtime', '2', 'Extra Time', 'fiinjtime') ?
>
237 <?
echo rbcell('form_injtime', '3', 'Cool Down' , 'fiinjtime') ?
>
244 <td nowrap
>Training
</td
>
248 <?
echo rbcell('form_injtime', '4', 'Warm Up' , 'fiinjtime') ?
>
249 <?
echo rbcell('form_injtime', '5', 'During Session', 'fiinjtime') ?
>
250 <?
echo rbcell('form_injtime', '6', 'Cool Down' , 'fiinjtime') ?
>
251 <?
echo rbcell('form_injtime', '7', 'Rehabilitation', 'fiinjtime') ?
>
258 <td nowrap
>Match Type
</td
>
262 <?
echo rbcell('form_matchtype', '1', 'Premiership' , 'fimatchtype') ?
>
263 <?
echo rbcell('form_matchtype', '2', 'FA Cup' , 'fimatchtype') ?
>
264 <?
echo rbcell('form_matchtype', '3', 'League Cup' , 'fimatchtype') ?
>
265 <?
echo rbcell('form_matchtype', '4', 'Champions League Cup', 'fimatchtype') ?
>
268 <?
echo rbcell('form_matchtype', '5', 'Championship Match' , 'fimatchtype') ?
>
269 <?
echo rbcell('form_matchtype', '6', 'League One Match' , 'fimatchtype') ?
>
270 <?
echo rbcell('form_matchtype', '7', 'League Two Match' , 'fimatchtype') ?
>
271 <?
echo rbcell('form_matchtype', '8', 'International Match' , 'fimatchtype') ?
>
274 <?
echo rbcell('form_matchtype', '9', 'Friendly' , 'fimatchtype') ?
>
275 <td width
='25%'> 
;</td
>
276 <td width
='25%'> 
;</td
>
277 <td width
='25%'> 
;</td
>
283 <tr bgcolor
='#dddddd'>
284 <td colspan
='2' align
='center'><b
>Mechanism of Injury
</b
></td
>
288 <td nowrap
>Contact
</td
>
292 <?
echo cbcell('form_mech_tackling' , 'Tackling' , 'fimech_tackling' ) ?
>
293 <?
echo cbcell('form_mech_tackled' , 'Tackled' , 'fimech_tackled' ) ?
>
294 <?
echo cbcell('form_mech_collision', 'Collision', 'fimech_collision') ?
>
295 <?
echo cbcell('form_mech_kicked' , 'Kicked' , 'fimech_kicked' ) ?
>
298 <?
echo cbcell('form_mech_elbow' , 'Use of Elbow' , 'fimech_elbow' ) ?
>
299 <td colspan
='3' nowrap
>
301 <input type
='text' name
='form_mech_othercon' size
='10'
302 title
='Describe other'
303 value
='<? echo addslashes($row['fimech_othercon
']) ?>' />
311 <td nowrap
>Referee
's Sanction</td>
315 <? echo cbcell('form_mech_nofoul
' , 'No Foul
' , 'fimech_nofoul
' ) ?>
316 <? echo cbcell('form_mech_oppfoul
', 'Opponent Foul
', 'fimech_oppfoul
') ?>
317 <? echo cbcell('form_mech_ownfoul
', 'Own Foul
' , 'fimech_ownfoul
') ?>
318 <td width='25%
'> </td>
321 <? echo cbcell('form_mech_yellow
' , 'Yellow Card
' , 'fimech_yellow
' ) ?>
322 <? echo cbcell('form_mech_red
' , 'Red Card
' , 'fimech_red
' ) ?>
323 <td width='25%
'> </td>
324 <td width='25%
'> </td>
331 <td nowrap>Non Contact</td>
335 <? echo cbcell('form_mech_passing
' , 'Passing
' , 'fimech_passing
' ) ?>
336 <? echo cbcell('form_mech_shooting
' , 'Shooting
' , 'fimech_shooting
' ) ?>
337 <? echo cbcell('form_mech_running
' , 'Running
' , 'fimech_running
' ) ?>
338 <? echo cbcell('form_mech_dribbling
', 'Dribbling
', 'fimech_dribbling
') ?>
341 <? echo cbcell('form_mech_heading
' , 'Heading
' , 'fimech_heading
' ) ?>
342 <? echo cbcell('form_mech_jumping
' , 'Jumping
' , 'fimech_jumping
' ) ?>
343 <? echo cbcell('form_mech_landing
' , 'Landing
' , 'fimech_landing
' ) ?>
344 <? echo cbcell('form_mech_fall
' , 'Fall
' , 'fimech_fall
' ) ?>
347 <? echo cbcell('form_mech_stretching
', 'Stretching
' , 'fimech_stretching
') ?>
348 <? echo cbcell('form_mech_turning
' , 'Twisting
/Turning
', 'fimech_turning
' ) ?>
349 <? echo cbcell('form_mech_throwing
' , 'Throwing
' , 'fimech_throwing
' ) ?>
350 <? echo cbcell('form_mech_diving
' , 'Diving
' , 'fimech_diving
' ) ?>
353 <? echo cbcell('form_mech_overuse
', 'Overuse
', 'fimech_overuse
' ) ?>
354 <td colspan='3' nowrap>
356 <input type='text
' name='form_mech_othernon
' size='10'
357 title='Describe other
'
358 value='<?
echo addslashes($row['fimech_othernon']) ?
>' />
365 <tr bgcolor='#dddddd'>
366 <td colspan
='2' align
='center'><b
>Conditions
</b
></td
>
370 <td nowrap
>Surface
</td
>
374 <?
echo rbcell('form_surface', '1', 'Pitch' , 'fisurface') ?
>
375 <?
echo rbcell('form_surface', '2', 'Training' , 'fisurface') ?
>
376 <?
echo rbcell('form_surface', '3', 'Artificial' , 'fisurface') ?
>
377 <?
echo rbcell('form_surface', '4', 'Indoor' , 'fisurface') ?
>
380 <?
echo rbcell('form_surface', '5', 'Gym' , 'fisurface') ?
>
381 <?
echo rbcell('form_surface', '6', 'Other' , 'fisurface') ?
>
382 <td width
='25%'> 
;</td
>
383 <td width
='25%'> 
;</td
>
390 <td nowrap
>Position
</td
>
394 <?
echo rbcell('form_position', '1', 'Defender' , 'fiposition') ?
>
395 <?
echo rbcell('form_position', '2', 'Midfield Offensive', 'fiposition') ?
>
396 <?
echo rbcell('form_position', '3', 'Midfield Defensive', 'fiposition') ?
>
397 <?
echo rbcell('form_position', '4', 'Forward' , 'fiposition') ?
>
400 <?
echo rbcell('form_position', '5', 'Goal Keeper' , 'fiposition') ?
>
401 <?
echo rbcell('form_position', '6', 'Substitute' , 'fiposition') ?
>
402 <td width
='25%'> 
;</td
>
403 <td width
='25%'> 
;</td
>
410 <td nowrap
>Footwear
</td
>
414 <?
echo rbcell('form_footwear', '1', 'Molded Stud' , 'fifootwear') ?
>
415 <?
echo rbcell('form_footwear', '2', 'Detachable Stud', 'fifootwear') ?
>
416 <?
echo rbcell('form_footwear', '3', 'Indoor Shoes' , 'fifootwear') ?
>
417 <?
echo rbcell('form_footwear', '4', 'Blades' , 'fifootwear') ?
>
424 <td nowrap
>Side of Injury
</td
>
428 <?
echo rbcell('form_side', '1', 'Left' , 'fiside') ?
>
429 <?
echo rbcell('form_side', '2', 'Right' , 'fiside') ?
>
430 <?
echo rbcell('form_side', '3', 'Bilateral' , 'fiside') ?
>
431 <?
echo rbcell('form_side', '4', 'Not Applicable', 'fiside') ?
>
437 <tr bgcolor
='#dddddd'>
438 <td colspan
='2' align
='center'><b
>Post Injury Sequelae
</b
></td
>
442 <td nowrap
>Removed from
<br
>Play
/Training
<br
>after Injury
</td
>
446 <?
echo rbcell('form_removed', '1', 'Immediately', 'firemoved') ?
>
447 <?
echo rbcell('form_removed', '2', 'Later' , 'firemoved') ?
>
448 <?
echo rbcell('form_removed', '3', 'Not at All' , 'firemoved') ?
>
449 <td width
='25%'> 
;</td
>
458 <input type
='submit' name
='bn_save' value
='Save' />
460 <input type
='button' value
='Cancel' onclick
="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
462 <input type
='button' value
='Add Injury Diagnosis...' onclick
='docoding();'
463 title
='Add or change coding for this encounter'
464 style
='background-color:#ffff00;' />
472 // TBD: If $alertmsg, display it with a JavaScript alert().