Change support desk contact information (#7561)
[openemr.git] / contrib / forms / soccer_injury / view.php
blob30b54b5a7af0c9a9f9f3c17d983bd574f5c56c4b
1 <?php
3 //////////////////////////////////////////////////////////////////////
4 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
5 // View.php is an exact duplicate of new.php. If you wish to make
6 // any changes, then change new.php and either (recommended) make
7 // view.php a symbolic link to new.php, or copy new.php to view.php.
8 //
9 // And if you check in a change to either module, be sure to check
10 // in the other (identical) module also.
12 // This nonsense will go away if we ever move to subversion.
13 //////////////////////////////////////////////////////////////////////
15 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
17 // This program is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU General Public License
19 // as published by the Free Software Foundation; either version 2
20 // of the License, or (at your option) any later version.
22 require_once("../../globals.php");
23 require_once("$srcdir/api.inc.php");
24 require_once("$srcdir/forms.inc.php");
26 use OpenEMR\Core\Header;
28 $row = array();
30 if (! $encounter) { // comes from globals.php
31 die("Internal error: we do not seem to be in an encounter!");
34 function rbvalue($rbname)
36 $tmp = $_POST[$rbname];
37 if (! $tmp) {
38 $tmp = '0';
41 return $tmp;
44 function cbvalue($cbname)
46 return $_POST[$cbname] ? '1' : '0';
49 function rbinput($name, $value, $desc, $colname)
51 global $row;
52 $ret = "<input type='radio' name='" . attr($name) . "' value='" . attr($value) . "'";
53 if ($row[$colname] == $value) {
54 $ret .= " checked";
57 $ret .= " />" . text($desc);
58 return $ret;
61 function rbcell($name, $value, $desc, $colname)
63 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
66 function cbinput($name, $colname)
68 global $row;
69 $ret = "<input type='checkbox' name='" . attr($name) . "' value='1'";
70 if ($row[$colname]) {
71 $ret .= " checked";
74 $ret .= " />";
75 return $ret;
78 function cbcell($name, $desc, $colname)
80 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
83 $formid = $_GET['id'];
85 // If Save was clicked, save the info.
87 if ($_POST['bn_save']) {
88 $tmp = strtotime($_POST['time'] . $_POST['timeampm']);
89 if ($tmp < 0) {
90 die("Time is not valid!");
93 $siinjtime = date("H:i:s", $tmp);
95 $simech_other = '';
96 if ($_POST['activity'] == '7') {
97 $simech_other = $_POST['activity_other'];
98 } elseif ($_POST['activity'] == '23') {
99 $simech_other = $_POST['activity_nc_other'];
102 $sitreat_other = '';
103 if ($_POST['treat_10']) {
104 $sitreat_other = $_POST['treat_other'];
107 // If updating an existing form...
109 if ($formid) {
110 $query = "UPDATE form_soccer_injury SET
111 siinjtime = ?,
112 sigametime = ?,
113 simechanism ?,
114 simech_other= ?,
115 sisurface = ?,
116 siposition = ?,
117 sifootwear = ?,
118 siequip_1 = ?,
119 siequip_2 = ?,
120 siequip_3 = ?,
121 siequip_4 = ?,
122 siequip_5 = ?,
123 siequip_6 = ?,
124 siside = ?,
125 siremoved = ?,
126 sitreat_1 = ?,
127 sitreat_2 = ?,
128 sitreat_3 = ?,
129 sitreat_4 = ?,
130 sitreat_5 = ?,
131 sitreat_6 = ?,
132 sitreat_7 = ?,
133 sitreat_8 = ?,
134 sitreat_9 = ?,
135 sitreat_10 = ?,
136 sitreat_other = ?,
137 sinoreturn = ?,
138 WHERE id = ?";
139 sqlStatement($query, array( $siinjtime, rbvalue('gameplay'), rbvalue('activity'), $simech_other, rbvalue('surface'), rbvalue('position'), rbvalue('footwear'), cbvalue('equip_1'),
140 cbvalue('equip_2'), cbvalue('equip_3'), cbvalue('equip_4'), cbvalue('equip_5'), cbvalue('equip_6'), rbvalue('side'), rbvalue('removed'), cbvalue('treat_1'), cbvalue('treat_2'),
141 cbvalue('treat_3'), cbvalue('treat_4'), cbvalue('treat_5'), cbvalue('treat_6'), cbvalue('treat_7'), cbvalue('treat_8'), cbvalue('treat_9'), cbvalue('treat_10'), $sistreat_other, cbvalue('noreturn'),
142 $formid));
143 } else { // If adding a new form...
144 $query = "INSERT INTO form_soccer_injury ( " .
145 "siinjtime, sigametime, simechanism, simech_other, sisurface, " .
146 "siposition, sifootwear, " .
147 "siequip_1, siequip_2, siequip_3, siequip_4, siequip_5, siequip_6, " .
148 "siside, siremoved, " .
149 "sitreat_1, sitreat_2, sitreat_3, sitreat_4, sitreat_5, " .
150 "sitreat_6, sitreat_7, sitreat_8, sitreat_9, sitreat_10, " .
151 "sitreat_other, sinoreturn " .
152 ") VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,
153 ?,?,?,?,?,?,?,?,?,?,?,?,
154 ?,?,?)";
156 $newid = sqlInsert($query, array($siinjtime, rbvalue('gameplay'), rbvalue('activity'), $simech_other, rbvalue('surface'), rbvalue('position'), rbvalue('footwear'), cbvalue('equip_1'),
157 cbvalue('equip_2'), cbvalue('equip_3'), cbvalue('equip_4'), cbvalue('equip_5'), cbvalue('equip_6'), rbvalue('side'), rbvalue('removed'), cbvalue('treat_1'), cbvalue('treat_2'),
158 cbvalue('treat_3'), cbvalue('treat_4'), cbvalue('treat_5'), cbvalue('treat_6'), cbvalue('treat_7'), cbvalue('treat_8'), cbvalue('treat_9'), cbvalue('treat_10'), $sistreat_other, cbvalue('noreturn')));
160 addForm($encounter, "Football Injury", $newid, "soccer_injury", $pid, $userauthorized);
163 formHeader("Redirecting....");
164 formJump();
165 formFooter();
166 exit;
169 $siinjtime = '';
170 $siampm = '';
171 if ($formid) {
172 $row = sqlQuery("SELECT * FROM form_soccer_injury WHERE " .
173 "id = ? AND activity = '1'", array($formid));
174 $siinjtime = substr($row['siinjtime'], 0, 5);
175 $siampm = 'am';
176 $siinjhour = substr($siinjtime, 0, 2);
177 if ($siinjhour > 12) {
178 $siampm = 'pm';
179 $siinjtime = substr($siinjhour + 500 - 12, 1, 2) . substr($siinjtime, 2);
183 <html>
184 <head>
185 <?php Header::setupHeader(); ?>
186 <style>
187 .billcell { font-family: sans-serif; font-size: 10pt }
188 </style>
189 <script>
191 </script>
192 </head>
194 <body class="body_top">
195 <form method="post" action="<?php echo $rootdir ?>/forms/soccer_injury/new.php?id=<?php echo attr_url($formid); ?>" onsubmit="return top.restoreSession()">
197 <center>
199 <p class='title' style='margin-top:8px;margin-bottom:8px'>Football Injury Statistics</p>
201 <table border='1'>
203 <tr bgcolor='#dddddd'>
204 <td colspan='2' align='center'><b>Time of Injury</b></td>
205 </tr>
207 <tr>
208 <td nowrap>Time</td>
209 <td nowrap>
210 <input type='text' name='time' size='5' title='Hour or hh:mm' value='<?php echo attr($siinjtime); ?>' />&nbsp;
211 <input type='radio' name='timeampm' value='am'<?php if ($siampm == 'am') {
212 echo ' checked';
213 } ?> />am&nbsp;
214 <input type='radio' name='timeampm' value='pm'<?php if ($siampm == 'pm') {
215 echo ' checked';
216 } ?> />pm&nbsp;
217 </td>
218 </tr>
220 <tr>
221 <td nowrap>Game Play</td>
222 <td nowrap>
223 <table width='100%'>
224 <tr>
225 <?php echo rbcell('gameplay', '1', '1st Quarter', 'sigametime') ?>
226 <?php echo rbcell('gameplay', '2', '2nd Quarter', 'sigametime') ?>
227 <?php echo rbcell('gameplay', '3', '3rd Quarter', 'sigametime') ?>
228 <?php echo rbcell('gameplay', '4', '4th Quarter', 'sigametime') ?>
229 </tr>
230 <tr>
231 <?php echo rbcell('gameplay', '5', 'Warm Up', 'sigametime') ?>
232 <?php echo rbcell('gameplay', '6', 'Extra Time', 'sigametime') ?>
233 <?php echo rbcell('gameplay', '7', 'Cool Down', 'sigametime') ?>
234 <td width='25%'>&nbsp;</td>
235 </tr>
236 </table>
237 </td>
238 </tr>
240 <tr>
241 <td nowrap>Training</td>
242 <td nowrap>
243 <table width='100%'>
244 <tr>
245 <?php echo rbcell('gameplay', '11', 'Warm Up', 'sigametime') ?>
246 <?php echo rbcell('gameplay', '12', 'During Session', 'sigametime') ?>
247 <?php echo rbcell('gameplay', '13', 'Cool Down', 'sigametime') ?>
248 <td width='25%'>&nbsp;</td>
249 </tr>
250 </table>
251 </td>
252 </tr>
254 <tr bgcolor='#dddddd'>
255 <td colspan='2' align='center'><b>Mechanism of Injury</b></td>
256 </tr>
258 <tr>
259 <td nowrap>Contact</td>
260 <td nowrap>
261 <table width='100%'>
262 <tr>
263 <?php echo rbcell('activity', '1', 'Tackling', 'simechanism') ?>
264 <?php echo rbcell('activity', '2', 'Tackled', 'simechanism') ?>
265 <?php echo rbcell('activity', '3', 'Collision', 'simechanism') ?>
266 <?php echo rbcell('activity', '4', 'Kicked', 'simechanism') ?>
267 </tr>
268 <tr>
269 <?php echo rbcell('activity', '5', 'Use of Elbow', 'simechanism') ?>
270 <?php echo rbcell('activity', '6', 'Hit by Ball', 'simechanism') ?>
271 <td colspan='2' nowrap>
272 <?php echo rbinput('activity', '7', 'Other:', 'simechanism') ?>
273 <input type='text' name='activity_other' size='10'
274 title='Describe other'
275 value='<?php echo attr($row['simech_other']); ?>' />
276 </td>
277 </tr>
278 </table>
279 </td>
280 </tr>
282 <tr>
283 <td nowrap>Non Contact</td>
284 <td nowrap>
285 <table width='100%'>
286 <tr>
287 <?php echo rbcell('activity', '11', 'Passing', 'simechanism') ?>
288 <?php echo rbcell('activity', '12', 'Shooting', 'simechanism') ?>
289 <?php echo rbcell('activity', '13', 'Running', 'simechanism') ?>
290 <?php echo rbcell('activity', '14', 'Dribbling', 'simechanism') ?>
291 </tr>
292 <tr>
293 <?php echo rbcell('activity', '15', 'Heading', 'simechanism') ?>
294 <?php echo rbcell('activity', '16', 'Jumping', 'simechanism') ?>
295 <?php echo rbcell('activity', '17', 'Landing', 'simechanism') ?>
296 <?php echo rbcell('activity', '18', 'Fall', 'simechanism') ?>
297 </tr>
298 <tr>
299 <?php echo rbcell('activity', '19', 'Stretching', 'simechanism') ?>
300 <?php echo rbcell('activity', '20', 'Twist/Turning', 'simechanism') ?>
301 <?php echo rbcell('activity', '21', 'Throwing', 'simechanism') ?>
302 <?php echo rbcell('activity', '22', 'Diving', 'simechanism') ?>
303 </tr>
304 <tr>
305 <td colspan='4' nowrap>
306 <?php echo rbinput('activity', '23', 'Other:', 'simechanism') ?>
307 <input type='text' name='activity_nc_other' size='10'
308 title='Describe other'
309 value='<?php echo attr($row['simech_other']) ?>' />
310 </td>
311 </tr>
312 </table>
313 </td>
314 </tr>
316 <tr bgcolor='#dddddd'>
317 <td colspan='2' align='center'><b>Conditions</b></td>
318 </tr>
320 <tr>
321 <td nowrap>Surface</td>
322 <td nowrap>
323 <table width='100%'>
324 <tr>
325 <?php echo rbcell('surface', '1', 'Pitch', 'sisurface') ?>
326 <?php echo rbcell('surface', '2', 'Training', 'sisurface') ?>
327 <?php echo rbcell('surface', '3', 'Artificial', 'sisurface') ?>
328 <?php echo rbcell('surface', '4', 'All Weather', 'sisurface') ?>
329 </tr>
330 <tr>
331 <?php echo rbcell('surface', '5', 'Indoor', 'sisurface') ?>
332 <?php echo rbcell('surface', '6', 'Gym', 'sisurface') ?>
333 <?php echo rbcell('surface', '7', 'Other', 'sisurface') ?>
334 <td width='25%'>&nbsp;</td>
335 </tr>
336 </table>
337 </td>
338 </tr>
340 <tr>
341 <td nowrap>Position</td>
342 <td nowrap>
343 <table width='100%'>
344 <tr>
345 <?php echo rbcell('position', '1', 'Defender', 'siposition') ?>
346 <?php echo rbcell('position', '2', 'Midfield Offense', 'siposition') ?>
347 <?php echo rbcell('position', '3', 'Midfield Defense', 'siposition') ?>
348 <?php echo rbcell('position', '4', 'Wing Back', 'siposition') ?>
349 </tr>
350 <tr>
351 <?php echo rbcell('position', '5', 'Forward', 'siposition') ?>
352 <?php echo rbcell('position', '6', 'Striker', 'siposition') ?>
353 <?php echo rbcell('position', '7', 'Goal Keeper', 'siposition') ?>
354 <?php echo rbcell('position', '8', 'Starting Lineup', 'siposition') ?>
355 </tr>
356 <tr>
357 <?php echo rbcell('position', '9', 'Substitute', 'siposition') ?>
358 <td width='25%'>&nbsp;</td>
359 <td width='25%'>&nbsp;</td>
360 <td width='25%'>&nbsp;</td>
361 </tr>
362 </table>
363 </td>
364 </tr>
366 <tr>
367 <td nowrap>Footwear</td>
368 <td nowrap>
369 <table width='100%'>
370 <tr>
371 <?php echo rbcell('footwear', '1', 'Molded Cleat', 'sifootwear') ?>
372 <?php echo rbcell('footwear', '2', 'Detachable Cleats', 'sifootwear') ?>
373 <?php echo rbcell('footwear', '3', 'Indoor Shoes', 'sifootwear') ?>
374 <?php echo rbcell('footwear', '4', 'Turf Shoes', 'sifootwear') ?>
375 </tr>
376 </table>
377 </td>
378 </tr>
380 <tr>
381 <td nowrap>Other Equipment</td>
382 <td nowrap>
383 <table width='100%'>
384 <tr>
385 <?php echo cbcell('equip_1', 'Shin Pads', 'siequip_1') ?>
386 <?php echo cbcell('equip_2', 'Gloves', 'siequip_2') ?>
387 <?php echo cbcell('equip_3', 'Ankle Strapping', 'siequip_3') ?>
388 <?php echo cbcell('equip_4', 'Knee Strapping', 'siequip_4') ?>
389 </tr>
390 <tr>
391 <?php echo cbcell('equip_5', 'Bracing', 'siequip_5') ?>
392 <?php echo cbcell('equip_6', 'Synthetic Cast', 'siequip_6') ?>
393 <td width='25%'>&nbsp;</td>
394 <td width='25%'>&nbsp;</td>
395 </tr>
396 </table>
397 </td>
398 </tr>
400 <tr>
401 <td nowrap>Side of Injury</td>
402 <td nowrap>
403 <table width='100%'>
404 <tr>
405 <?php echo rbcell('side', '1', 'Left', 'siside') ?>
406 <?php echo rbcell('side', '2', 'Right', 'siside') ?>
407 <?php echo rbcell('side', '3', 'Bilateral', 'siside') ?>
408 <?php echo rbcell('side', '4', 'Not Applicable', 'siside') ?>
409 </tr>
410 </table>
411 </td>
412 </tr>
414 <tr bgcolor='#dddddd'>
415 <td colspan='2' align='center'><b>Post Injury Sequelae</b></td>
416 </tr>
418 <tr>
419 <td nowrap>Removed from<br />Play/Training<br />after Injury</td>
420 <td nowrap>
421 <table width='100%'>
422 <tr>
423 <?php echo rbcell('removed', '1', 'Immediately', 'siremoved') ?>
424 <?php echo rbcell('removed', '2', 'Later', 'siremoved') ?>
425 <?php echo rbcell('removed', '3', 'Not at All', 'siremoved') ?>
426 <td width='25%'>&nbsp;</td>
427 </tr>
428 </table>
429 </td>
430 </tr>
432 <tr>
433 <td nowrap>Medical Treatment<br />Sought from</td>
434 <td nowrap>
435 <table width='100%'>
436 <tr>
437 <?php echo cbcell('treat_1', 'Hospital A&amp;E Dept', 'sitreat_1') ?>
438 <?php echo cbcell('treat_2', 'General Practitioner', 'sitreat_2') ?>
439 <?php echo cbcell('treat_3', 'Physiotherapist', 'sitreat_3') ?>
440 <?php echo cbcell('treat_4', 'Nurse', 'sitreat_4') ?>
441 </tr>
442 <tr>
443 <?php echo cbcell('treat_5', 'Hospital Specialist', 'sitreat_5') ?>
444 <?php echo cbcell('treat_6', 'Osteopath', 'sitreat_6') ?>
445 <?php echo cbcell('treat_7', 'Chiropractor', 'sitreat_7') ?>
446 <?php echo cbcell('treat_8', 'Sports Massage Th', 'sitreat_8') ?>
447 </tr>
448 <tr>
449 <?php echo cbcell('treat_9', 'Sports Physician', 'sitreat_9') ?>
450 <td colspan='3' nowrap>
451 <?php echo cbinput('treat_10', 'sitreat_10') ?>Other:
452 <input type='text' name='treat_other' size='10'
453 title='Describe other'
454 value='<?php echo attr($row['sitreat_other']) ?>' />
455 </td>
456 </tr>
457 </table>
458 </td>
459 </tr>
461 <tr>
462 <td colspan='2' nowrap>
463 If player is unlikely to return to play please check here:
464 <?php echo cbinput('noreturn', 'sinoreturn') ?>
465 </td>
466 </tr>
468 </table>
471 <input type='submit' name='bn_save' value='Save' />
472 &nbsp;
473 <input type='button' value='Cancel' onclick="parent.closeTab(window.name, false)" />
474 </p>
476 </center>
478 </form>
479 <?php
481 // TBD: If $alertmsg, display it with a JavaScript alert().
484 </body>
485 </html>