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.
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
;
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];
44 function rbinput($name, $value, $desc, $colname)
47 $ret = "<input type='radio' name='" . attr($name) . "' value='" . attr($value) . "'";
48 if ($row[$colname] == $value) {
52 $ret .= " />" . text($desc);
56 $formid = $_GET['id'];
58 // If Save was clicked, save the info.
60 if ($_POST['bn_save']) {
61 // If updating an existing form...
64 $query = "UPDATE form_sports_fitness SET
77 vertical_jump_meters = ?,
82 sqlStatement($query, array($_POST['form_height_meters'], $_POST['form_weight_kg'], $_POST['form_skin_folds_9x'], $_POST['form_skin_folds_5x'], $_POST['form_pct_body_fat'], rbvalue('form_method_body_fat'),
83 $_POST['form_pulse'], $_POST['form_bps'], $_POST['form_bpd'], $_POST['form_beep_level'], $_POST['form_beep_shuttles'], $_POST['form_beep_vo2_max'], $_POST['form_vertical_jump_meters'],
84 $_POST['form_agility_505'], $_POST['form_sit_and_reach_cm'], $_POST['form_other'], $formid));
85 } else { // If adding a new form...
86 $query = "INSERT INTO form_sports_fitness ( " .
87 "height_meters, weight_kg, skin_folds_9x, skin_folds_5x, " .
88 "pct_body_fat, method_body_fat, pulse, bps, bpd, " .
89 "beep_level, beep_shuttles, beep_vo2_max, " .
90 "vertical_jump_meters, agility_505, sit_and_reach_cm, other " .
91 ") VALUES ( ?, ?, ?, ?, ?, ?, ?, ?,
92 ?, ?, ?, ?, ?, ?, ?, ?)";
94 $newid = sqlInsert($query, array($_POST['form_height_meters'], $_POST['form_weight_kg'], $_POST['form_skin_folds_9x'], $_POST['form_skin_folds_5x'], $_POST['form_pct_body_fat'], rbvalue('form_method_body_fat'),
95 $_POST['form_pulse'], $_POST['form_bps'], $_POST['form_bpd'], $_POST['form_beep_level'], $_POST['form_beep_shuttles'], $_POST['form_beep_vo2_max'], $_POST['form_vertical_jump_meters'],
96 $_POST['form_agility_505'], $_POST['form_sit_and_reach_cm'], $_POST['form_other']));
97 addForm($encounter, "Sports Fitness", $newid, "sports_fitness", $pid, $userauthorized);
101 formHeader("Redirecting....");
108 $row = sqlQuery("SELECT * FROM form_sports_fitness WHERE " .
109 "id = ? AND activity = '1'", [$formid]) ;
114 <?php Header
::setupHeader(); ?
>
117 <body
class="body_top">
118 <form method
="post" action
="<?php echo $rootdir ?>/forms/sports_fitness/new.php?id=<?php echo attr_url($formid); ?>"
119 onsubmit
="return top.restoreSession()">
124 <table border
='1' width
='95%'>
126 <tr bgcolor
='#dddddd'>
127 <td colspan
='2' align
='center'><b
>Physical + Fitness Tests
</b
></td
>
131 <td nowrap
>Vitals
</td
>
135 <td width
='20%' nowrap
>
138 <td width
='13%' nowrap
>
139 <input type
='text' name
='form_height_meters' size
='6'
140 title
='Height in meters'
141 value
='<?php echo attr($row['height_meters
']) ?>' />  
;
143 <td width
='20%' nowrap
>
146 <td width
='13%' nowrap
>
147 <input type
='text' name
='form_weight_kg' size
='6'
148 title
='Weight in kilograms'
149 value
='<?php echo attr($row['weight_kg
']) ?>' />  
;
151 <td width
='20%' nowrap
>
163 <input type
='text' name
='form_pulse' size
='6'
164 title
='Resting pulse rate per minute'
165 value
='<?php echo attr($row['pulse
']) ?>' />  
;
171 <input type
='text' name
='form_bps' size
='6'
173 value
='<?php echo attr($row['bps
']) ?>' />  
;
179 <input type
='text' name
='form_bpd' size
='6'
181 value
='<?php echo attr($row['bps
']) ?>' />  
;
189 <td
>Body
<br
/>Composition
</td
>
193 <td width
='20%' nowrap
>
196 <td width
='13%' nowrap
>
197 <input type
='text' name
='form_skin_folds_9x' size
='6'
198 title
='Total of 9 skin fold readings in cm'
199 value
='<?php echo attr($row['skin_folds_9x
']) ?>' />  
;
201 <td width
='20%' nowrap
>
204 <td width
='13%' nowrap
>
205 <input type
='text' name
='form_skin_folds_5x' size
='6'
206 title
='Total of 5 skin fold readings in cm'
207 value
='<?php echo attr($row['skin_folds_5x
']) ?>' />  
;
209 <td width
='20%' nowrap
>
213 <input type
='text' name
='form_pct_body_fat' size
='6'
214 title
='Percent body fat'
215 value
='<?php echo attr($row['pct_body_fat
']) ?>' />  
;
219 <td colspan
='6' nowrap
>
220 B
.F
. Method Used
: 
;
221 <?php
echo rbinput('form_method_body_fat', 'Caliper', 'Caliper', 'method_body_fat') ?
> 
;
222 <?php
echo rbinput('form_method_body_fat', 'Electronic', 'Electronic', 'method_body_fat') ?
> 
;
223 <?php
echo rbinput('form_method_body_fat', 'Hydrostatic', 'Hydrostatic', 'method_body_fat') ?
>
231 <td nowrap
>Beep Test
</td
>
235 <td width
='20%' nowrap
>
238 <td width
='13%' nowrap
>
239 <input type
='text' name
='form_beep_level' size
='6'
240 title
='Level Reached'
241 value
='<?php echo attr($row['beep_level
']) ?>' />  
;
243 <td width
='20%' nowrap
>
246 <td width
='13%' nowrap
>
247 <input type
='text' name
='form_beep_shuttles' size
='6'
248 title
='Number of shuttles at this level'
249 value
='<?php echo attr($row['beep_shuttles
']) ?>' />  
;
251 <td width
='20%' nowrap
>
255 <input type
='text' name
='form_beep_vo2_max' size
='6'
257 value
='<?php echo attr($row['beep_vo2_max
']) ?>' />  
;
265 <td nowrap
>Other Tests
</td
>
269 <td width
='20%' nowrap
>
272 <td width
='13%' nowrap
>
273 <input type
='text' name
='form_vertical_jump_meters' size
='6'
274 title
='Vertical Jump Test in Meters'
275 value
='<?php echo attr($row['vertical_jump_meters
']) ?>' />  
;
277 <td width
='20%' nowrap
>
280 <td width
='13%' nowrap
>
281 <input type
='text' name
='form_agility_505' size
='6'
282 title
='505 Agility Test in Seconds'
283 value
='<?php echo attr($row['agility_505
']) ?>' />  
;
285 <td width
='20%' nowrap
>
289 <input type
='text' name
='form_sit_and_reach_cm' size
='6'
290 title
='Sit and Reach Test in cm + or - ve'
291 value
='<?php echo attr($row['sit_and_reach_cm
']) ?>' />  
;
299 <td nowrap
>Still More
</td
>
301 <textarea name
='form_other' rows
='8' style
='width:100%'><?php
echo text($row['other']); ?
></textarea
>
308 <input type
='submit' name
='bn_save' value
='Save' />
310 <input type
='button' value
='Cancel' onclick
="parent.closeTab(window.name, false)" />
318 // TBD: If $alertmsg, display it with a JavaScript alert().