function issue_football_injury_save($issue) { global $arr_activity, $arr_sanction, $arr_weather; $query = "REPLACE INTO lists_football_injury ( " . "id, fiinjmin, fiinjtime, fimatchtype, "; foreach ($arr_activity as $key => $value) { $query .= "fimech_{$key}, "; } foreach ($arr_sanction as $key => $value) { $query .= "fimech_{$key}, "; } foreach ($arr_weather as $key => $value) { $query .= "fiweather_{$key}, "; } $query .= "fimech_othercon, fimech_othernon, fiweather_temperature, " . "fisurface, fiposition, fifootwear, firemoved, ficondition " . ") VALUES ( " . $issue . ", " . invalue('form_injmin') . ", " . rbvalue('form_injtime') . ", " . rbvalue('form_matchtype') . ", "; foreach ($arr_activity as $key => $value) { $query .= cbvalue("form_mech_{$key}") . ", "; } foreach ($arr_sanction as $key => $value) { $query .= cbvalue("form_mech_{$key}") . ", "; } foreach ($arr_weather as $key => $value) { $query .= cbvalue("form_weather_{$key}") . ", "; } $query .= txvalue('form_mech_othercon') . ", " . txvalue('form_mech_othernon') . ", " . txvalue('form_weather_temperature') . ", " . rbvalue('form_surface') . ", " . rbvalue('form_position') . ", " . rbvalue('form_footwear') . ", " . rbvalue('form_removed') . ", " . rbvalue('form_condition') . " " . ")"; sqlStatement($query); }
function cbcell($name, $desc, $colname) { return "<td width='25%' nowrap>" . cbinput($name, $colname) . "{$desc}</td>\n"; } $formid = $_GET['id']; // If Save was clicked, save the info. // if ($_POST['bn_save']) { $fiinjmin = (int) $_POST['form_injmin']; // If updating an existing form... // if ($formid) { $query = "UPDATE form_football_injury_audit SET " . "fiinjmin = " . invalue('form_injmin') . ", " . "fiinjtime = " . rbvalue('form_injtime') . ", " . "fimatchtype = " . rbvalue('form_matchtype') . ", " . "fimech_tackling = " . cbvalue('form_mech_tackling') . ", " . "fimech_tackled = " . cbvalue('form_mech_tackled') . ", " . "fimech_collision = " . cbvalue('form_mech_collision') . ", " . "fimech_kicked = " . cbvalue('form_mech_kicked') . ", " . "fimech_elbow = " . cbvalue('form_mech_elbow') . ", " . "fimech_nofoul = " . cbvalue('form_mech_nofoul') . ", " . "fimech_oppfoul = " . cbvalue('form_mech_oppfoul') . ", " . "fimech_ownfoul = " . cbvalue('form_mech_ownfoul') . ", " . "fimech_yellow = " . cbvalue('form_mech_yellow') . ", " . "fimech_red = " . cbvalue('form_mech_red') . ", " . "fimech_passing = " . cbvalue('form_mech_passing') . ", " . "fimech_shooting = " . cbvalue('form_mech_shooting') . ", " . "fimech_running = " . cbvalue('form_mech_running') . ", " . "fimech_dribbling = " . cbvalue('form_mech_dribbling') . ", " . "fimech_heading = " . cbvalue('form_mech_heading') . ", " . "fimech_jumping = " . cbvalue('form_mech_jumping') . ", " . "fimech_landing = " . cbvalue('form_mech_landing') . ", " . "fimech_fall = " . cbvalue('form_mech_fall') . ", " . "fimech_stretching = " . cbvalue('form_mech_stretching') . ", " . "fimech_turning = " . cbvalue('form_mech_turning') . ", " . "fimech_throwing = " . cbvalue('form_mech_throwing') . ", " . "fimech_diving = " . cbvalue('form_mech_diving') . ", " . "fimech_overuse = " . cbvalue('form_mech_overuse') . ", " . "fimech_othercon = " . txvalue('form_mech_othercon') . ", " . "fimech_othernon = " . txvalue('form_mech_othernon') . ", " . "fisurface = " . rbvalue('form_surface') . ", " . "fiposition = " . rbvalue('form_position') . ", " . "fifootwear = " . rbvalue('form_footwear') . ", " . "fiside = " . rbvalue('form_side') . ", " . "firemoved = " . rbvalue('form_removed') . " " . "WHERE id = '{$formid}'"; sqlStatement($query); } else { $query = "INSERT INTO form_football_injury_audit ( " . "fiinjmin, fiinjtime, fimatchtype, " . "fimech_tackling, fimech_tackled, fimech_collision, " . "fimech_kicked, fimech_elbow, fimech_nofoul, fimech_oppfoul, " . "fimech_ownfoul, fimech_yellow, fimech_red, fimech_passing, " . "fimech_shooting, fimech_running, fimech_dribbling, fimech_heading, " . "fimech_jumping, fimech_landing, fimech_fall, fimech_stretching, " . "fimech_turning, fimech_throwing, fimech_diving, fimech_overuse, " . "fimech_othercon, fimech_othernon, fisurface, fiposition, fifootwear, " . "fiside, firemoved " . ") VALUES ( " . invalue('form_injmin') . ", " . rbvalue('form_injtime') . ", " . rbvalue('form_matchtype') . ", " . cbvalue('form_mech_tackling') . ", " . cbvalue('form_mech_tackled') . ", " . cbvalue('form_mech_collision') . ", " . cbvalue('form_mech_kicked') . ", " . cbvalue('form_mech_elbow') . ", " . cbvalue('form_mech_nofoul') . ", " . cbvalue('form_mech_oppfoul') . ", " . cbvalue('form_mech_ownfoul') . ", " . cbvalue('form_mech_yellow') . ", " . cbvalue('form_mech_red') . ", " . cbvalue('form_mech_passing') . ", " . cbvalue('form_mech_shooting') . ", " . cbvalue('form_mech_running') . ", " . cbvalue('form_mech_dribbling') . ", " . cbvalue('form_mech_heading') . ", " . cbvalue('form_mech_jumping') . ", " . cbvalue('form_mech_landing') . ", " . cbvalue('form_mech_fall') . ", " . cbvalue('form_mech_stretching') . ", " . cbvalue('form_mech_turning') . ", " . cbvalue('form_mech_throwing') . ", " . cbvalue('form_mech_diving') . ", " . cbvalue('form_mech_overuse') . ", " . txvalue('form_mech_othercon') . ", " . txvalue('form_mech_othernon') . ", " . rbvalue('form_surface') . ", " . rbvalue('form_position') . ", " . rbvalue('form_footwear') . ", " . rbvalue('form_side') . ", " . rbvalue('form_removed') . " " . ")"; $newid = sqlInsert($query); addForm($encounter, "Football Injury Audit", $newid, "football_injury_audit", $pid, $userauthorized); } formHeader("Redirecting...."); formJump(); formFooter(); exit; } if ($formid) { $row = sqlQuery("SELECT * FROM form_football_injury_audit WHERE " . "id = '{$formid}' AND activity = '1'"); } ?> <html> <head> <?php
function issue_football_injury_save($issue) { $query = "REPLACE INTO lists_football_injury ( " . "id, fiinjmin, fiinjtime, fimatchtype, " . "fimech_tackling, fimech_tackled, fimech_collision, " . "fimech_kicked, fimech_elbow, fimech_nofoul, fimech_oppfoul, " . "fimech_ownfoul, fimech_yellow, fimech_red, fimech_passing, " . "fimech_shooting, fimech_running, fimech_dribbling, fimech_heading, " . "fimech_jumping, fimech_landing, fimech_fall, fimech_stretching, " . "fimech_turning, fimech_throwing, fimech_diving, fimech_overuse, " . "fimech_othercon, fimech_othernon, fisurface, fiposition, fifootwear, " . "fiside, firemoved " . ") VALUES ( " . $issue . ", " . invalue('form_injmin') . ", " . rbvalue('form_injtime') . ", " . rbvalue('form_matchtype') . ", " . cbvalue('form_mech_tackling') . ", " . cbvalue('form_mech_tackled') . ", " . cbvalue('form_mech_collision') . ", " . cbvalue('form_mech_kicked') . ", " . cbvalue('form_mech_elbow') . ", " . cbvalue('form_mech_nofoul') . ", " . cbvalue('form_mech_oppfoul') . ", " . cbvalue('form_mech_ownfoul') . ", " . cbvalue('form_mech_yellow') . ", " . cbvalue('form_mech_red') . ", " . cbvalue('form_mech_passing') . ", " . cbvalue('form_mech_shooting') . ", " . cbvalue('form_mech_running') . ", " . cbvalue('form_mech_dribbling') . ", " . cbvalue('form_mech_heading') . ", " . cbvalue('form_mech_jumping') . ", " . cbvalue('form_mech_landing') . ", " . cbvalue('form_mech_fall') . ", " . cbvalue('form_mech_stretching') . ", " . cbvalue('form_mech_turning') . ", " . cbvalue('form_mech_throwing') . ", " . cbvalue('form_mech_diving') . ", " . cbvalue('form_mech_overuse') . ", " . txvalue('form_mech_othercon') . ", " . txvalue('form_mech_othernon') . ", " . rbvalue('form_surface') . ", " . rbvalue('form_position') . ", " . rbvalue('form_footwear') . ", " . rbvalue('form_side') . ", " . rbvalue('form_removed') . " " . ")"; sqlStatement($query); }