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)
33 $tmp = $_POST[$rbname];
41 function cbvalue($cbname)
43 return $_POST[$cbname] ?
'1' : '0';
46 function rbinput($name, $value, $desc, $colname)
49 $ret = "<input type='radio' name='$name' value='$value'";
50 if ($row[$colname] == $value) {
58 function rbcell($name, $value, $desc, $colname)
60 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
63 function cbinput($name, $colname)
66 $ret = "<input type='checkbox' name='$name' value='1'";
75 function cbcell($name, $desc, $colname)
77 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
80 $formid = $_GET['id'];
82 // If Save was clicked, save the info.
84 if ($_POST['bn_save']) {
85 $tmp = strtotime($_POST['time'] . $_POST['timeampm']);
87 die("Time is not valid!");
90 $siinjtime = date("H:i:s", $tmp);
93 if ($_POST['activity'] == '7') {
94 $simech_other = $_POST['activity_other'];
95 } else if ($_POST['activity'] == '23') {
96 $simech_other = $_POST['activity_nc_other'];
100 if ($_POST['treat_10']) {
101 $sitreat_other = $_POST['treat_other'];
104 // If updating an existing form...
107 $query = "UPDATE form_soccer_injury SET " .
108 "siinjtime = '$siinjtime', " .
109 "sigametime = " . rbvalue('gameplay') . ", " .
110 "simechanism = " . rbvalue('activity') . ", " .
111 "simech_other = '$simech_other', " .
112 "sisurface = " . rbvalue('surface') . ", " .
113 "siposition = " . rbvalue('position') . ", " .
114 "sifootwear = " . rbvalue('footwear') . ", " .
115 "siequip_1 = " . cbvalue('equip_1') . ", " .
116 "siequip_2 = " . cbvalue('equip_2') . ", " .
117 "siequip_3 = " . cbvalue('equip_3') . ", " .
118 "siequip_4 = " . cbvalue('equip_4') . ", " .
119 "siequip_5 = " . cbvalue('equip_5') . ", " .
120 "siequip_6 = " . cbvalue('equip_6') . ", " .
121 "siside = " . rbvalue('side') . ", " .
122 "siremoved = " . rbvalue('removed') . ", " .
123 "sitreat_1 = " . cbvalue('treat_1') . ", " .
124 "sitreat_2 = " . cbvalue('treat_2') . ", " .
125 "sitreat_3 = " . cbvalue('treat_3') . ", " .
126 "sitreat_4 = " . cbvalue('treat_4') . ", " .
127 "sitreat_5 = " . cbvalue('treat_5') . ", " .
128 "sitreat_6 = " . cbvalue('treat_6') . ", " .
129 "sitreat_7 = " . cbvalue('treat_7') . ", " .
130 "sitreat_8 = " . cbvalue('treat_8') . ", " .
131 "sitreat_9 = " . cbvalue('treat_9') . ", " .
132 "sitreat_10 = " . cbvalue('treat_10') . ", " .
133 "sitreat_other = '$sitreat_other', " .
134 "sinoreturn = " . cbvalue('noreturn') . " " .
135 "WHERE id = '$formid'";
136 sqlStatement($query);
137 } // If adding a new form...
140 $query = "INSERT INTO form_soccer_injury ( " .
141 "siinjtime, sigametime, simechanism, simech_other, sisurface, " .
142 "siposition, sifootwear, " .
143 "siequip_1, siequip_2, siequip_3, siequip_4, siequip_5, siequip_6, " .
144 "siside, siremoved, " .
145 "sitreat_1, sitreat_2, sitreat_3, sitreat_4, sitreat_5, " .
146 "sitreat_6, sitreat_7, sitreat_8, sitreat_9, sitreat_10, " .
147 "sitreat_other, sinoreturn " .
150 rbvalue('gameplay') . ", " .
151 rbvalue('activity') . ", " .
152 "'$simech_other', " .
153 rbvalue('surface') . ", " .
154 rbvalue('position') . ", " .
155 rbvalue('footwear') . ", " .
156 cbvalue('equip_1') . ", " .
157 cbvalue('equip_2') . ", " .
158 cbvalue('equip_3') . ", " .
159 cbvalue('equip_4') . ", " .
160 cbvalue('equip_5') . ", " .
161 cbvalue('equip_6') . ", " .
162 rbvalue('side') . ", " .
163 rbvalue('removed') . ", " .
164 cbvalue('treat_1') . ", " .
165 cbvalue('treat_2') . ", " .
166 cbvalue('treat_3') . ", " .
167 cbvalue('treat_4') . ", " .
168 cbvalue('treat_5') . ", " .
169 cbvalue('treat_6') . ", " .
170 cbvalue('treat_7') . ", " .
171 cbvalue('treat_8') . ", " .
172 cbvalue('treat_9') . ", " .
173 cbvalue('treat_10') . ", " .
174 "'$sitreat_other', " .
175 cbvalue('noreturn') . " " .
177 $newid = sqlInsert($query);
178 addForm($encounter, "Football Injury", $newid, "soccer_injury", $pid, $userauthorized);
181 formHeader("Redirecting....");
190 $row = sqlQuery("SELECT * FROM form_soccer_injury WHERE " .
191 "id = '$formid' AND activity = '1'") ;
192 $siinjtime = substr($row['siinjtime'], 0, 5);
194 $siinjhour = substr($siinjtime, 0, 2);
195 if ($siinjhour > 12) {
197 $siinjtime = substr($siinjhour +
500 - 12, 1, 2) . substr($siinjtime, 2);
203 <?php
html_header_show();?
>
204 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
206 .billcell
{ font
-family
: sans
-serif
; font
-size
: 10pt
}
208 <script language
="JavaScript">
213 <body
class="body_top">
214 <form method
="post" action
="<?php echo $rootdir ?>/forms/soccer_injury/new.php?id=<?php echo $formid ?>"
215 onsubmit
="return top.restoreSession()">
219 <p
class='title' style
='margin-top:8px;margin-bottom:8px'>Football Injury Statistics
</p
>
223 <tr bgcolor
='#dddddd'>
224 <td colspan
='2' align
='center'><b
>Time of Injury
</b
></td
>
230 <input type
='text' name
='time' size
='5' title
='Hour or hh:mm' value
='<?php echo $siinjtime ?>' /> 
;
231 <input type
='radio' name
='timeampm' value
='am'<?php
if ($siampm == 'am') {
234 <input type
='radio' name
='timeampm' value
='pm'<?php
if ($siampm == 'pm') {
241 <td nowrap
>Game Play
</td
>
245 <?php
echo rbcell('gameplay', '1', '1st Quarter', 'sigametime') ?
>
246 <?php
echo rbcell('gameplay', '2', '2nd Quarter', 'sigametime') ?
>
247 <?php
echo rbcell('gameplay', '3', '3rd Quarter', 'sigametime') ?
>
248 <?php
echo rbcell('gameplay', '4', '4th Quarter', 'sigametime') ?
>
251 <?php
echo rbcell('gameplay', '5', 'Warm Up', 'sigametime') ?
>
252 <?php
echo rbcell('gameplay', '6', 'Extra Time', 'sigametime') ?
>
253 <?php
echo rbcell('gameplay', '7', 'Cool Down', 'sigametime') ?
>
254 <td width
='25%'> 
;</td
>
261 <td nowrap
>Training
</td
>
265 <?php
echo rbcell('gameplay', '11', 'Warm Up', 'sigametime') ?
>
266 <?php
echo rbcell('gameplay', '12', 'During Session', 'sigametime') ?
>
267 <?php
echo rbcell('gameplay', '13', 'Cool Down', 'sigametime') ?
>
268 <td width
='25%'> 
;</td
>
274 <tr bgcolor
='#dddddd'>
275 <td colspan
='2' align
='center'><b
>Mechanism of Injury
</b
></td
>
279 <td nowrap
>Contact
</td
>
283 <?php
echo rbcell('activity', '1', 'Tackling', 'simechanism') ?
>
284 <?php
echo rbcell('activity', '2', 'Tackled', 'simechanism') ?
>
285 <?php
echo rbcell('activity', '3', 'Collision', 'simechanism') ?
>
286 <?php
echo rbcell('activity', '4', 'Kicked', 'simechanism') ?
>
289 <?php
echo rbcell('activity', '5', 'Use of Elbow', 'simechanism') ?
>
290 <?php
echo rbcell('activity', '6', 'Hit by Ball', 'simechanism') ?
>
291 <td colspan
='2' nowrap
>
292 <?php
echo rbinput('activity', '7', 'Other:', 'simechanism') ?
>
293 <input type
='text' name
='activity_other' size
='10'
294 title
='Describe other'
295 value
='<?php echo addslashes($row['simech_other
']) ?>' />
303 <td nowrap
>Non Contact
</td
>
307 <?php
echo rbcell('activity', '11', 'Passing', 'simechanism') ?
>
308 <?php
echo rbcell('activity', '12', 'Shooting', 'simechanism') ?
>
309 <?php
echo rbcell('activity', '13', 'Running', 'simechanism') ?
>
310 <?php
echo rbcell('activity', '14', 'Dribbling', 'simechanism') ?
>
313 <?php
echo rbcell('activity', '15', 'Heading', 'simechanism') ?
>
314 <?php
echo rbcell('activity', '16', 'Jumping', 'simechanism') ?
>
315 <?php
echo rbcell('activity', '17', 'Landing', 'simechanism') ?
>
316 <?php
echo rbcell('activity', '18', 'Fall', 'simechanism') ?
>
319 <?php
echo rbcell('activity', '19', 'Stretching', 'simechanism') ?
>
320 <?php
echo rbcell('activity', '20', 'Twist/Turning', 'simechanism') ?
>
321 <?php
echo rbcell('activity', '21', 'Throwing', 'simechanism') ?
>
322 <?php
echo rbcell('activity', '22', 'Diving', 'simechanism') ?
>
325 <td colspan
='4' nowrap
>
326 <?php
echo rbinput('activity', '23', 'Other:', 'simechanism') ?
>
327 <input type
='text' name
='activity_nc_other' size
='10'
328 title
='Describe other'
329 value
='<?php echo addslashes($row['simech_other
']) ?>' />
336 <tr bgcolor
='#dddddd'>
337 <td colspan
='2' align
='center'><b
>Conditions
</b
></td
>
341 <td nowrap
>Surface
</td
>
345 <?php
echo rbcell('surface', '1', 'Pitch', 'sisurface') ?
>
346 <?php
echo rbcell('surface', '2', 'Training', 'sisurface') ?
>
347 <?php
echo rbcell('surface', '3', 'Artificial', 'sisurface') ?
>
348 <?php
echo rbcell('surface', '4', 'All Weather', 'sisurface') ?
>
351 <?php
echo rbcell('surface', '5', 'Indoor', 'sisurface') ?
>
352 <?php
echo rbcell('surface', '6', 'Gym', 'sisurface') ?
>
353 <?php
echo rbcell('surface', '7', 'Other', 'sisurface') ?
>
354 <td width
='25%'> 
;</td
>
361 <td nowrap
>Position
</td
>
365 <?php
echo rbcell('position', '1', 'Defender', 'siposition') ?
>
366 <?php
echo rbcell('position', '2', 'Midfield Offense', 'siposition') ?
>
367 <?php
echo rbcell('position', '3', 'Midfield Defense', 'siposition') ?
>
368 <?php
echo rbcell('position', '4', 'Wing Back', 'siposition') ?
>
371 <?php
echo rbcell('position', '5', 'Forward', 'siposition') ?
>
372 <?php
echo rbcell('position', '6', 'Striker', 'siposition') ?
>
373 <?php
echo rbcell('position', '7', 'Goal Keeper', 'siposition') ?
>
374 <?php
echo rbcell('position', '8', 'Starting Lineup', 'siposition') ?
>
377 <?php
echo rbcell('position', '9', 'Substitute', 'siposition') ?
>
378 <td width
='25%'> 
;</td
>
379 <td width
='25%'> 
;</td
>
380 <td width
='25%'> 
;</td
>
387 <td nowrap
>Footwear
</td
>
391 <?php
echo rbcell('footwear', '1', 'Molded Cleat', 'sifootwear') ?
>
392 <?php
echo rbcell('footwear', '2', 'Detachable Cleats', 'sifootwear') ?
>
393 <?php
echo rbcell('footwear', '3', 'Indoor Shoes', 'sifootwear') ?
>
394 <?php
echo rbcell('footwear', '4', 'Turf Shoes', 'sifootwear') ?
>
401 <td nowrap
>Other Equipment
</td
>
405 <?php
echo cbcell('equip_1', 'Shin Pads', 'siequip_1') ?
>
406 <?php
echo cbcell('equip_2', 'Gloves', 'siequip_2') ?
>
407 <?php
echo cbcell('equip_3', 'Ankle Strapping', 'siequip_3') ?
>
408 <?php
echo cbcell('equip_4', 'Knee Strapping', 'siequip_4') ?
>
411 <?php
echo cbcell('equip_5', 'Bracing', 'siequip_5') ?
>
412 <?php
echo cbcell('equip_6', 'Synthetic Cast', 'siequip_6') ?
>
413 <td width
='25%'> 
;</td
>
414 <td width
='25%'> 
;</td
>
421 <td nowrap
>Side of Injury
</td
>
425 <?php
echo rbcell('side', '1', 'Left', 'siside') ?
>
426 <?php
echo rbcell('side', '2', 'Right', 'siside') ?
>
427 <?php
echo rbcell('side', '3', 'Bilateral', 'siside') ?
>
428 <?php
echo rbcell('side', '4', 'Not Applicable', 'siside') ?
>
434 <tr bgcolor
='#dddddd'>
435 <td colspan
='2' align
='center'><b
>Post Injury Sequelae
</b
></td
>
439 <td nowrap
>Removed from
<br
>Play
/Training
<br
>after Injury
</td
>
443 <?php
echo rbcell('removed', '1', 'Immediately', 'siremoved') ?
>
444 <?php
echo rbcell('removed', '2', 'Later', 'siremoved') ?
>
445 <?php
echo rbcell('removed', '3', 'Not at All', 'siremoved') ?
>
446 <td width
='25%'> 
;</td
>
453 <td nowrap
>Medical Treatment
<br
>Sought from
</td
>
457 <?php
echo cbcell('treat_1', 'Hospital A&E Dept', 'sitreat_1') ?
>
458 <?php
echo cbcell('treat_2', 'General Practitioner', 'sitreat_2') ?
>
459 <?php
echo cbcell('treat_3', 'Physiotherapist', 'sitreat_3') ?
>
460 <?php
echo cbcell('treat_4', 'Nurse', 'sitreat_4') ?
>
463 <?php
echo cbcell('treat_5', 'Hospital Specialist', 'sitreat_5') ?
>
464 <?php
echo cbcell('treat_6', 'Osteopath', 'sitreat_6') ?
>
465 <?php
echo cbcell('treat_7', 'Chiropractor', 'sitreat_7') ?
>
466 <?php
echo cbcell('treat_8', 'Sports Massage Th', 'sitreat_8') ?
>
469 <?php
echo cbcell('treat_9', 'Sports Physician', 'sitreat_9') ?
>
470 <td colspan
='3' nowrap
>
471 <?php
echo cbinput('treat_10', 'sitreat_10') ?
>Other
:
472 <input type
='text' name
='treat_other' size
='10'
473 title
='Describe other'
474 value
='<?php echo addslashes($row['sitreat_other
']) ?>' />
482 <td colspan
='2' nowrap
>
483 If player is unlikely to
return to play please check here
:
484 <?php
echo cbinput('noreturn', 'sinoreturn') ?
>
491 <input type
='submit' name
='bn_save' value
='Save' />
493 <input type
='button' value
='Cancel' onclick
="top.restoreSession();location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
501 // TBD: If $alertmsg, display it with a JavaScript alert().