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 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 "fimech_tackling = " . cbvalue('form_mech_tackling') . ", " .
87 "fimech_tackled = " . cbvalue('form_mech_tackled') . ", " .
88 "fimech_collision = " . cbvalue('form_mech_collision') . ", " .
89 "fimech_kicked = " . cbvalue('form_mech_kicked') . ", " .
90 "fimech_elbow = " . cbvalue('form_mech_elbow') . ", " .
91 "fimech_nofoul = " . cbvalue('form_mech_nofoul') . ", " .
92 "fimech_oppfoul = " . cbvalue('form_mech_oppfoul') . ", " .
93 "fimech_ownfoul = " . cbvalue('form_mech_ownfoul') . ", " .
94 "fimech_yellow = " . cbvalue('form_mech_yellow') . ", " .
95 "fimech_red = " . cbvalue('form_mech_red') . ", " .
96 "fimech_passing = " . cbvalue('form_mech_passing') . ", " .
97 "fimech_shooting = " . cbvalue('form_mech_shooting') . ", " .
98 "fimech_running = " . cbvalue('form_mech_running') . ", " .
99 "fimech_dribbling = " . cbvalue('form_mech_dribbling') . ", " .
100 "fimech_heading = " . cbvalue('form_mech_heading') . ", " .
101 "fimech_jumping = " . cbvalue('form_mech_jumping') . ", " .
102 "fimech_landing = " . cbvalue('form_mech_landing') . ", " .
103 "fimech_fall = " . cbvalue('form_mech_fall') . ", " .
104 "fimech_stretching = " . cbvalue('form_mech_stretching') . ", " .
105 "fimech_turning = " . cbvalue('form_mech_turning') . ", " .
106 "fimech_throwing = " . cbvalue('form_mech_throwing') . ", " .
107 "fimech_diving = " . cbvalue('form_mech_diving') . ", " .
108 "fimech_overuse = " . cbvalue('form_mech_overuse') . ", " .
109 "fimech_othercon = " . txvalue('form_mech_othercon') . ", " .
110 "fimech_othernon = " . txvalue('form_mech_othernon') . ", " .
111 "fisurface = " . rbvalue('form_surface') . ", " .
112 "fiposition = " . rbvalue('form_position') . ", " .
113 "fifootwear = " . rbvalue('form_footwear') . ", " .
114 "fiside = " . rbvalue('form_side') . ", " .
115 "firemoved = " . rbvalue('form_removed') . " " .
116 "WHERE id = '$formid'";
117 sqlStatement($query);
120 // If adding a new form...
123 $query = "INSERT INTO form_football_injury_audit ( " .
124 "fiinjmin, fiinjtime, fimech_tackling, fimech_tackled, fimech_collision, " .
125 "fimech_kicked, fimech_elbow, fimech_nofoul, fimech_oppfoul, " .
126 "fimech_ownfoul, fimech_yellow, fimech_red, fimech_passing, " .
127 "fimech_shooting, fimech_running, fimech_dribbling, fimech_heading, " .
128 "fimech_jumping, fimech_landing, fimech_fall, fimech_stretching, " .
129 "fimech_turning, fimech_throwing, fimech_diving, fimech_overuse, " .
130 "fimech_othercon, fimech_othernon, fisurface, fiposition, fifootwear, " .
131 "fiside, firemoved " .
133 invalue('form_injmin') . ", " .
134 rbvalue('form_injtime') . ", " .
135 cbvalue('form_mech_tackling') . ", " .
136 cbvalue('form_mech_tackled') . ", " .
137 cbvalue('form_mech_collision') . ", " .
138 cbvalue('form_mech_kicked') . ", " .
139 cbvalue('form_mech_elbow') . ", " .
140 cbvalue('form_mech_nofoul') . ", " .
141 cbvalue('form_mech_oppfoul') . ", " .
142 cbvalue('form_mech_ownfoul') . ", " .
143 cbvalue('form_mech_yellow') . ", " .
144 cbvalue('form_mech_red') . ", " .
145 cbvalue('form_mech_passing') . ", " .
146 cbvalue('form_mech_shooting') . ", " .
147 cbvalue('form_mech_running') . ", " .
148 cbvalue('form_mech_dribbling') . ", " .
149 cbvalue('form_mech_heading') . ", " .
150 cbvalue('form_mech_jumping') . ", " .
151 cbvalue('form_mech_landing') . ", " .
152 cbvalue('form_mech_fall') . ", " .
153 cbvalue('form_mech_stretching') . ", " .
154 cbvalue('form_mech_turning') . ", " .
155 cbvalue('form_mech_throwing') . ", " .
156 cbvalue('form_mech_diving') . ", " .
157 cbvalue('form_mech_overuse') . ", " .
158 txvalue('form_mech_othercon') . ", " .
159 txvalue('form_mech_othernon') . ", " .
160 rbvalue('form_surface') . ", " .
161 rbvalue('form_position') . ", " .
162 rbvalue('form_footwear') . ", " .
163 rbvalue('form_side') . ", " .
164 rbvalue('form_removed') . " " .
166 $newid = sqlInsert($query);
167 addForm($encounter, "Football Injury Audit", $newid, "football_injury_audit", $pid, $userauthorized);
170 formHeader("Redirecting....");
177 $row = sqlQuery ("SELECT * FROM form_football_injury_audit WHERE " .
178 "id = '$formid' AND activity = '1'") ;
183 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
185 .billcell
{ font
-family
: sans
-serif
; font
-size
: 10pt
}
188 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
190 <script language
="JavaScript">
192 // Pop up the coding window.
193 function docoding() {
194 var width
= screen
.width
- 50;
195 if (!isNaN(top
.screenX
)) {
196 width
-= top
.screenX
;
197 } else if (!isNaN(top
.screenLeft
)) {
198 width
-= top
.screenLeft
;
200 if (width
> 1000) width
= 1000;
201 dlgopen('../../patient_file/encounter/coding_popup.php', '_blank', width
, 550);
207 <body
<?
echo $top_bg_line;?
> topmargin
="0" rightmargin
="0" leftmargin
="2" bottommargin
="0" marginwidth
="2" marginheight
="0">
208 <form method
="post" action
="<? echo $rootdir ?>/forms/football_injury_audit/new.php?id=<? echo $formid ?>">
212 <p
class='title' style
='margin-top:8px;margin-bottom:8px'>Football Injury Statistics
</p
>
214 <table border
='1' width
='98%'>
216 <tr bgcolor
='#dddddd'>
217 <td colspan
='2' align
='center'><b
>Time of Injury
</b
></td
>
221 <td nowrap
>Match Play
</td
>
227 <input type
='text' name
='form_injmin' size
='4'
228 value
='<? echo addslashes($row['fiinjmin
']) ?>' />
230 <?
echo rbcell('form_injtime', '1', 'Warm Up' , 'fiinjtime') ?
>
231 <?
echo rbcell('form_injtime', '2', 'Extra Time', 'fiinjtime') ?
>
232 <?
echo rbcell('form_injtime', '3', 'Cool Down' , 'fiinjtime') ?
>
239 <td nowrap
>Training
</td
>
243 <?
echo rbcell('form_injtime', '4', 'Warm Up' , 'fiinjtime') ?
>
244 <?
echo rbcell('form_injtime', '5', 'During Session', 'fiinjtime') ?
>
245 <?
echo rbcell('form_injtime', '6', 'Cool Down' , 'fiinjtime') ?
>
246 <?
echo rbcell('form_injtime', '7', 'Rehabilitation', 'fiinjtime') ?
>
252 <tr bgcolor
='#dddddd'>
253 <td colspan
='2' align
='center'><b
>Mechanism of Injury
</b
></td
>
257 <td nowrap
>Contact
</td
>
261 <?
echo cbcell('form_mech_tackling' , 'Tackling' , 'fimech_tackling' ) ?
>
262 <?
echo cbcell('form_mech_tackled' , 'Tackled' , 'fimech_tackled' ) ?
>
263 <?
echo cbcell('form_mech_collision', 'Collision', 'fimech_collision') ?
>
264 <?
echo cbcell('form_mech_kicked' , 'Kicked' , 'fimech_kicked' ) ?
>
267 <?
echo cbcell('form_mech_elbow' , 'Use of Elbow' , 'fimech_elbow' ) ?
>
268 <td colspan
='3' nowrap
>
270 <input type
='text' name
='form_mech_othercon' size
='10'
271 title
='Describe other'
272 value
='<? echo addslashes($row['fimech_othercon
']) ?>' />
280 <td nowrap
>Referee
's Sanction</td>
284 <? echo cbcell('form_mech_nofoul
' , 'No Foul
' , 'fimech_nofoul
' ) ?>
285 <? echo cbcell('form_mech_oppfoul
', 'Opponent Foul
', 'fimech_oppfoul
') ?>
286 <? echo cbcell('form_mech_ownfoul
', 'Own Foul
' , 'fimech_ownfoul
') ?>
287 <td width='25%
'> </td>
290 <? echo cbcell('form_mech_yellow
' , 'Yellow Card
' , 'fimech_yellow
' ) ?>
291 <? echo cbcell('form_mech_red
' , 'Red Card
' , 'fimech_red
' ) ?>
292 <td width='25%
'> </td>
293 <td width='25%
'> </td>
300 <td nowrap>Non Contact</td>
304 <? echo cbcell('form_mech_passing
' , 'Passing
' , 'fimech_passing
' ) ?>
305 <? echo cbcell('form_mech_shooting
' , 'Shooting
' , 'fimech_shooting
' ) ?>
306 <? echo cbcell('form_mech_running
' , 'Running
' , 'fimech_running
' ) ?>
307 <? echo cbcell('form_mech_dribbling
', 'Dribbling
', 'fimech_dribbling
') ?>
310 <? echo cbcell('form_mech_heading
' , 'Heading
' , 'fimech_heading
' ) ?>
311 <? echo cbcell('form_mech_jumping
' , 'Jumping
' , 'fimech_jumping
' ) ?>
312 <? echo cbcell('form_mech_landing
' , 'Landing
' , 'fimech_landing
' ) ?>
313 <? echo cbcell('form_mech_fall
' , 'Fall
' , 'fimech_fall
' ) ?>
316 <? echo cbcell('form_mech_stretching
', 'Stretching
' , 'fimech_stretching
') ?>
317 <? echo cbcell('form_mech_turning
' , 'Twisting
/Turning
', 'fimech_turning
' ) ?>
318 <? echo cbcell('form_mech_throwing
' , 'Throwing
' , 'fimech_throwing
' ) ?>
319 <? echo cbcell('form_mech_diving
' , 'Diving
' , 'fimech_diving
' ) ?>
322 <? echo cbcell('form_mech_overuse
', 'Overuse
', 'fimech_overuse
' ) ?>
323 <td colspan='3' nowrap>
325 <input type='text
' name='form_mech_othernon
' size='10'
326 title='Describe other
'
327 value='<?
echo addslashes($row['fimech_othernon']) ?
>' />
334 <tr bgcolor='#dddddd'>
335 <td colspan
='2' align
='center'><b
>Conditions
</b
></td
>
339 <td nowrap
>Surface
</td
>
343 <?
echo rbcell('form_surface', '1', 'Pitch' , 'fisurface') ?
>
344 <?
echo rbcell('form_surface', '2', 'Training' , 'fisurface') ?
>
345 <?
echo rbcell('form_surface', '3', 'Artificial' , 'fisurface') ?
>
346 <?
echo rbcell('form_surface', '4', 'Indoor' , 'fisurface') ?
>
349 <?
echo rbcell('form_surface', '5', 'Gym' , 'fisurface') ?
>
350 <?
echo rbcell('form_surface', '6', 'Other' , 'fisurface') ?
>
351 <td width
='25%'> 
;</td
>
352 <td width
='25%'> 
;</td
>
359 <td nowrap
>Position
</td
>
363 <?
echo rbcell('form_position', '1', 'Defender' , 'fiposition') ?
>
364 <?
echo rbcell('form_position', '2', 'Midfield Offensive', 'fiposition') ?
>
365 <?
echo rbcell('form_position', '3', 'Midfield Defensive', 'fiposition') ?
>
366 <?
echo rbcell('form_position', '4', 'Forward' , 'fiposition') ?
>
369 <?
echo rbcell('form_position', '5', 'Goal Keeper' , 'fiposition') ?
>
370 <?
echo rbcell('form_position', '6', 'Substitute' , 'fiposition') ?
>
371 <td width
='25%'> 
;</td
>
372 <td width
='25%'> 
;</td
>
379 <td nowrap
>Footwear
</td
>
383 <?
echo rbcell('form_footwear', '1', 'Molded Stud' , 'fifootwear') ?
>
384 <?
echo rbcell('form_footwear', '2', 'Detachable Stud', 'fifootwear') ?
>
385 <?
echo rbcell('form_footwear', '3', 'Indoor Shoes' , 'fifootwear') ?
>
386 <?
echo rbcell('form_footwear', '4', 'Blades' , 'fifootwear') ?
>
393 <td nowrap
>Side of Injury
</td
>
397 <?
echo rbcell('form_side', '1', 'Left' , 'fiside') ?
>
398 <?
echo rbcell('form_side', '2', 'Right' , 'fiside') ?
>
399 <?
echo rbcell('form_side', '3', 'Bilateral' , 'fiside') ?
>
400 <?
echo rbcell('form_side', '4', 'Not Applicable', 'fiside') ?
>
406 <tr bgcolor
='#dddddd'>
407 <td colspan
='2' align
='center'><b
>Post Injury Sequelae
</b
></td
>
411 <td nowrap
>Removed from
<br
>Play
/Training
<br
>after Injury
</td
>
415 <?
echo rbcell('form_removed', '1', 'Immediately', 'firemoved') ?
>
416 <?
echo rbcell('form_removed', '2', 'Later' , 'firemoved') ?
>
417 <?
echo rbcell('form_removed', '3', 'Not at All' , 'firemoved') ?
>
418 <td width
='25%'> 
;</td
>
427 <input type
='submit' name
='bn_save' value
='Save' />
429 <input type
='button' value
='Cancel' onclick
="location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
431 <input type
='button' value
='Add Injury Diagnosis...' onclick
='docoding();'
432 title
='Add or change coding for this encounter'
433 style
='background-color:#ffff00;' />
441 // TBD: If $alertmsg, display it with a JavaScript alert().