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) 2005 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 rbinput($name, $value, $desc, $colname) {
43 $ret = "<input type='radio' name='$name' value='$value'";
44 if ($row[$colname] == $value) $ret .= " checked";
49 function rbcell($name, $value, $desc, $colname) {
50 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
53 function cbinput($name, $colname) {
55 $ret = "<input type='checkbox' name='$name' value='1'";
56 if ($row[$colname]) $ret .= " checked";
61 function cbcell($name, $desc, $colname) {
62 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
65 $formid = $_GET['id'];
67 // If Save was clicked, save the info.
69 if ($_POST['bn_save']) {
70 $tmp = strtotime($_POST['time'] . $_POST['timeampm']);
71 if ($tmp < 0) die("Time is not valid!");
72 $siinjtime = date("H:i:s", $tmp);
75 if ($_POST['activity'] == '7') {
76 $simech_other = $_POST['activity_other'];
78 else if ($_POST['activity'] == '23') {
79 $simech_other = $_POST['activity_nc_other'];
83 if ($_POST['treat_10']) {
84 $sitreat_other = $_POST['treat_other'];
87 // If updating an existing form...
90 $query = "UPDATE form_soccer_injury SET " .
91 "siinjtime = '$siinjtime', " .
92 "sigametime = " . rbvalue('gameplay') . ", " .
93 "simechanism = " . rbvalue('activity') . ", " .
94 "simech_other = '$simech_other', " .
95 "sisurface = " . rbvalue('surface') . ", " .
96 "siposition = " . rbvalue('position') . ", " .
97 "sifootwear = " . rbvalue('footwear') . ", " .
98 "siequip_1 = " . cbvalue('equip_1') . ", " .
99 "siequip_2 = " . cbvalue('equip_2') . ", " .
100 "siequip_3 = " . cbvalue('equip_3') . ", " .
101 "siequip_4 = " . cbvalue('equip_4') . ", " .
102 "siequip_5 = " . cbvalue('equip_5') . ", " .
103 "siequip_6 = " . cbvalue('equip_6') . ", " .
104 "siside = " . rbvalue('side') . ", " .
105 "siremoved = " . rbvalue('removed') . ", " .
106 "sitreat_1 = " . cbvalue('treat_1') . ", " .
107 "sitreat_2 = " . cbvalue('treat_2') . ", " .
108 "sitreat_3 = " . cbvalue('treat_3') . ", " .
109 "sitreat_4 = " . cbvalue('treat_4') . ", " .
110 "sitreat_5 = " . cbvalue('treat_5') . ", " .
111 "sitreat_6 = " . cbvalue('treat_6') . ", " .
112 "sitreat_7 = " . cbvalue('treat_7') . ", " .
113 "sitreat_8 = " . cbvalue('treat_8') . ", " .
114 "sitreat_9 = " . cbvalue('treat_9') . ", " .
115 "sitreat_10 = " . cbvalue('treat_10') . ", " .
116 "sitreat_other = '$sitreat_other', " .
117 "sinoreturn = " . cbvalue('noreturn') . " " .
118 "WHERE id = '$formid'";
119 sqlStatement($query);
122 // If adding a new form...
125 $query = "INSERT INTO form_soccer_injury ( " .
126 "siinjtime, sigametime, simechanism, simech_other, sisurface, " .
127 "siposition, sifootwear, " .
128 "siequip_1, siequip_2, siequip_3, siequip_4, siequip_5, siequip_6, " .
129 "siside, siremoved, " .
130 "sitreat_1, sitreat_2, sitreat_3, sitreat_4, sitreat_5, " .
131 "sitreat_6, sitreat_7, sitreat_8, sitreat_9, sitreat_10, " .
132 "sitreat_other, sinoreturn " .
135 rbvalue('gameplay') . ", " .
136 rbvalue('activity') . ", " .
137 "'$simech_other', " .
138 rbvalue('surface') . ", " .
139 rbvalue('position') . ", " .
140 rbvalue('footwear') . ", " .
141 cbvalue('equip_1') . ", " .
142 cbvalue('equip_2') . ", " .
143 cbvalue('equip_3') . ", " .
144 cbvalue('equip_4') . ", " .
145 cbvalue('equip_5') . ", " .
146 cbvalue('equip_6') . ", " .
147 rbvalue('side') . ", " .
148 rbvalue('removed') . ", " .
149 cbvalue('treat_1') . ", " .
150 cbvalue('treat_2') . ", " .
151 cbvalue('treat_3') . ", " .
152 cbvalue('treat_4') . ", " .
153 cbvalue('treat_5') . ", " .
154 cbvalue('treat_6') . ", " .
155 cbvalue('treat_7') . ", " .
156 cbvalue('treat_8') . ", " .
157 cbvalue('treat_9') . ", " .
158 cbvalue('treat_10') . ", " .
159 "'$sitreat_other', " .
160 cbvalue('noreturn') . " " .
162 $newid = sqlInsert($query);
163 addForm($encounter, "Football Injury", $newid, "soccer_injury", $pid, $userauthorized);
166 formHeader("Redirecting....");
175 $row = sqlQuery ("SELECT * FROM form_soccer_injury WHERE " .
176 "id = '$formid' AND activity = '1'") ;
177 $siinjtime = substr($row['siinjtime'], 0, 5);
179 $siinjhour = substr($siinjtime, 0, 2);
180 if ($siinjhour > 12) {
182 $siinjtime = substr($siinjhour +
500 - 12, 1, 2) . substr($siinjtime, 2);
188 <?php
html_header_show();?
>
189 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
191 .billcell
{ font
-family
: sans
-serif
; font
-size
: 10pt
}
193 <script language
="JavaScript">
198 <body
class="body_top">
199 <form method
="post" action
="<?php echo $rootdir ?>/forms/soccer_injury/new.php?id=<?php echo $formid ?>"
200 onsubmit
="return top.restoreSession()">
204 <p
class='title' style
='margin-top:8px;margin-bottom:8px'>Football Injury Statistics
</p
>
208 <tr bgcolor
='#dddddd'>
209 <td colspan
='2' align
='center'><b
>Time of Injury
</b
></td
>
215 <input type
='text' name
='time' size
='5' title
='Hour or hh:mm' value
='<?php echo $siinjtime ?>' /> 
;
216 <input type
='radio' name
='timeampm' value
='am'<?php
if ($siampm == 'am') echo ' checked' ?
> />am
 
;
217 <input type
='radio' name
='timeampm' value
='pm'<?php
if ($siampm == 'pm') echo ' checked' ?
> />pm
 
;
222 <td nowrap
>Game Play
</td
>
226 <?php
echo rbcell('gameplay', '1', '1st Quarter', 'sigametime') ?
>
227 <?php
echo rbcell('gameplay', '2', '2nd Quarter', 'sigametime') ?
>
228 <?php
echo rbcell('gameplay', '3', '3rd Quarter', 'sigametime') ?
>
229 <?php
echo rbcell('gameplay', '4', '4th Quarter', 'sigametime') ?
>
232 <?php
echo rbcell('gameplay', '5', 'Warm Up' , 'sigametime') ?
>
233 <?php
echo rbcell('gameplay', '6', 'Extra Time', 'sigametime') ?
>
234 <?php
echo rbcell('gameplay', '7', 'Cool Down' , 'sigametime') ?
>
235 <td width
='25%'> 
;</td
>
242 <td nowrap
>Training
</td
>
246 <?php
echo rbcell('gameplay', '11', 'Warm Up' , 'sigametime') ?
>
247 <?php
echo rbcell('gameplay', '12', 'During Session', 'sigametime') ?
>
248 <?php
echo rbcell('gameplay', '13', 'Cool Down' , 'sigametime') ?
>
249 <td width
='25%'> 
;</td
>
255 <tr bgcolor
='#dddddd'>
256 <td colspan
='2' align
='center'><b
>Mechanism of Injury
</b
></td
>
260 <td nowrap
>Contact
</td
>
264 <?php
echo rbcell('activity', '1', 'Tackling' , 'simechanism') ?
>
265 <?php
echo rbcell('activity', '2', 'Tackled' , 'simechanism') ?
>
266 <?php
echo rbcell('activity', '3', 'Collision' , 'simechanism') ?
>
267 <?php
echo rbcell('activity', '4', 'Kicked' , 'simechanism') ?
>
270 <?php
echo rbcell('activity', '5', 'Use of Elbow', 'simechanism') ?
>
271 <?php
echo rbcell('activity', '6', 'Hit by Ball' , 'simechanism') ?
>
272 <td colspan
='2' nowrap
>
273 <?php
echo rbinput('activity', '7', 'Other:', 'simechanism') ?
>
274 <input type
='text' name
='activity_other' size
='10'
275 title
='Describe other'
276 value
='<?php echo addslashes($row['simech_other
']) ?>' />
284 <td nowrap
>Non Contact
</td
>
288 <?php
echo rbcell('activity', '11', 'Passing' , 'simechanism') ?
>
289 <?php
echo rbcell('activity', '12', 'Shooting' , 'simechanism') ?
>
290 <?php
echo rbcell('activity', '13', 'Running' , 'simechanism') ?
>
291 <?php
echo rbcell('activity', '14', 'Dribbling' , 'simechanism') ?
>
294 <?php
echo rbcell('activity', '15', 'Heading' , 'simechanism') ?
>
295 <?php
echo rbcell('activity', '16', 'Jumping' , 'simechanism') ?
>
296 <?php
echo rbcell('activity', '17', 'Landing' , 'simechanism') ?
>
297 <?php
echo rbcell('activity', '18', 'Fall' , 'simechanism') ?
>
300 <?php
echo rbcell('activity', '19', 'Stretching' , 'simechanism') ?
>
301 <?php
echo rbcell('activity', '20', 'Twist/Turning', 'simechanism') ?
>
302 <?php
echo rbcell('activity', '21', 'Throwing' , 'simechanism') ?
>
303 <?php
echo rbcell('activity', '22', 'Diving' , 'simechanism') ?
>
306 <td colspan
='4' nowrap
>
307 <?php
echo rbinput('activity', '23', 'Other:', 'simechanism') ?
>
308 <input type
='text' name
='activity_nc_other' size
='10'
309 title
='Describe other'
310 value
='<?php echo addslashes($row['simech_other
']) ?>' />
317 <tr bgcolor
='#dddddd'>
318 <td colspan
='2' align
='center'><b
>Conditions
</b
></td
>
322 <td nowrap
>Surface
</td
>
326 <?php
echo rbcell('surface', '1', 'Pitch' , 'sisurface') ?
>
327 <?php
echo rbcell('surface', '2', 'Training' , 'sisurface') ?
>
328 <?php
echo rbcell('surface', '3', 'Artificial' , 'sisurface') ?
>
329 <?php
echo rbcell('surface', '4', 'All Weather', 'sisurface') ?
>
332 <?php
echo rbcell('surface', '5', 'Indoor' , 'sisurface') ?
>
333 <?php
echo rbcell('surface', '6', 'Gym' , 'sisurface') ?
>
334 <?php
echo rbcell('surface', '7', 'Other' , 'sisurface') ?
>
335 <td width
='25%'> 
;</td
>
342 <td nowrap
>Position
</td
>
346 <?php
echo rbcell('position', '1', 'Defender' , 'siposition') ?
>
347 <?php
echo rbcell('position', '2', 'Midfield Offense', 'siposition') ?
>
348 <?php
echo rbcell('position', '3', 'Midfield Defense', 'siposition') ?
>
349 <?php
echo rbcell('position', '4', 'Wing Back' , 'siposition') ?
>
352 <?php
echo rbcell('position', '5', 'Forward' , 'siposition') ?
>
353 <?php
echo rbcell('position', '6', 'Striker' , 'siposition') ?
>
354 <?php
echo rbcell('position', '7', 'Goal Keeper' , 'siposition') ?
>
355 <?php
echo rbcell('position', '8', 'Starting Lineup' , 'siposition') ?
>
358 <?php
echo rbcell('position', '9', 'Substitute' , 'siposition') ?
>
359 <td width
='25%'> 
;</td
>
360 <td width
='25%'> 
;</td
>
361 <td width
='25%'> 
;</td
>
368 <td nowrap
>Footwear
</td
>
372 <?php
echo rbcell('footwear', '1', 'Molded Cleat' , 'sifootwear') ?
>
373 <?php
echo rbcell('footwear', '2', 'Detachable Cleats', 'sifootwear') ?
>
374 <?php
echo rbcell('footwear', '3', 'Indoor Shoes' , 'sifootwear') ?
>
375 <?php
echo rbcell('footwear', '4', 'Turf Shoes' , 'sifootwear') ?
>
382 <td nowrap
>Other Equipment
</td
>
386 <?php
echo cbcell('equip_1', 'Shin Pads' , 'siequip_1') ?
>
387 <?php
echo cbcell('equip_2', 'Gloves' , 'siequip_2') ?
>
388 <?php
echo cbcell('equip_3', 'Ankle Strapping', 'siequip_3') ?
>
389 <?php
echo cbcell('equip_4', 'Knee Strapping' , 'siequip_4') ?
>
392 <?php
echo cbcell('equip_5', 'Bracing' , 'siequip_5') ?
>
393 <?php
echo cbcell('equip_6', 'Synthetic Cast' , 'siequip_6') ?
>
394 <td width
='25%'> 
;</td
>
395 <td width
='25%'> 
;</td
>
402 <td nowrap
>Side of Injury
</td
>
406 <?php
echo rbcell('side', '1', 'Left' , 'siside') ?
>
407 <?php
echo rbcell('side', '2', 'Right' , 'siside') ?
>
408 <?php
echo rbcell('side', '3', 'Bilateral' , 'siside') ?
>
409 <?php
echo rbcell('side', '4', 'Not Applicable', 'siside') ?
>
415 <tr bgcolor
='#dddddd'>
416 <td colspan
='2' align
='center'><b
>Post Injury Sequelae
</b
></td
>
420 <td nowrap
>Removed from
<br
>Play
/Training
<br
>after Injury
</td
>
424 <?php
echo rbcell('removed', '1', 'Immediately', 'siremoved') ?
>
425 <?php
echo rbcell('removed', '2', 'Later' , 'siremoved') ?
>
426 <?php
echo rbcell('removed', '3', 'Not at All' , 'siremoved') ?
>
427 <td width
='25%'> 
;</td
>
434 <td nowrap
>Medical Treatment
<br
>Sought from
</td
>
438 <?php
echo cbcell('treat_1', 'Hospital A&E Dept', 'sitreat_1') ?
>
439 <?php
echo cbcell('treat_2', 'General Practitioner' , 'sitreat_2') ?
>
440 <?php
echo cbcell('treat_3', 'Physiotherapist' , 'sitreat_3') ?
>
441 <?php
echo cbcell('treat_4', 'Nurse' , 'sitreat_4') ?
>
444 <?php
echo cbcell('treat_5', 'Hospital Specialist' , 'sitreat_5') ?
>
445 <?php
echo cbcell('treat_6', 'Osteopath' , 'sitreat_6') ?
>
446 <?php
echo cbcell('treat_7', 'Chiropractor' , 'sitreat_7') ?
>
447 <?php
echo cbcell('treat_8', 'Sports Massage Th' , 'sitreat_8') ?
>
450 <?php
echo cbcell('treat_9', 'Sports Physician' , 'sitreat_9') ?
>
451 <td colspan
='3' nowrap
>
452 <?php
echo cbinput('treat_10', 'sitreat_10') ?
>Other
:
453 <input type
='text' name
='treat_other' size
='10'
454 title
='Describe other'
455 value
='<?php echo addslashes($row['sitreat_other
']) ?>' />
463 <td colspan
='2' nowrap
>
464 If player is unlikely to
return to play please check here
:
465 <?php
echo cbinput('noreturn', 'sinoreturn') ?
>
472 <input type
='submit' name
='bn_save' value
='Save' />
474 <input type
='button' value
='Cancel' onclick
="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
482 // TBD: If $alertmsg, display it with a JavaScript alert().