2 //------------ sava.php for Ankleinjury Form created by Nikolai Vitsyn by 2004/01/23
3 include_once("../../globals.php");
4 include_once("$srcdir/api.inc");
5 include_once("$srcdir/forms.inc");
6 foreach ($_POST as $k => $var) {
7 $_POST[$k] = add_escape_custom($var);
11 if ($encounter == "") {
12 $encounter = date("Ymd");
15 if ($_GET["mode"] == "new") {
16 $newid = formSubmit("form_ankleinjury", $_POST, $_GET["id"], $userauthorized);
17 addForm($encounter, "Ankle Evaluation Form", $newid, "ankleinjury", $pid, $userauthorized);
18 } elseif ($_GET["mode"] == "update") {
19 sqlInsert("update form_ankleinjury set pid = {$_SESSION["pid
"]},groupname='".$_SESSION["authProvider"]."',user='".$_SESSION["authUser"]."',authorized=$userauthorized,activity=1, date = NOW(),
20 ankle_date_of_injuary='".$_POST["ankle_date_of_injuary"]."',
21 ankle_work_related='".$_POST["ankle_work_related"]."',
22 ankle_foot='".$_POST["ankle_foot"]."',
23 ankle_severity_of_pain='".$_POST["ankle_severity_of_pain"]."',
24 ankle_significant_swelling='".$_POST["ankle_significant_swelling"]."',
25 ankle_onset_of_swelling='".$_POST["ankle_onset_of_swelling"]."',
26 ankle_how_did_injury_occur='".$_POST["ankle_how_did_injury_occur"]."',
27 ankle_ottawa_bone_tenderness='".$_POST["ankle_ottawa_bone_tenderness"]."',
28 ankle_able_to_bear_weight_steps='".$_POST["ankle_able_to_bear_weight_steps"]."',
29 ankle_x_ray_interpretation='".$_POST["ankle_x_ray_interpretation"]."',
30 ankle_additional_x_ray_notes='".$_POST["ankle_additional_x_ray_notes"]."',
31 ankle_diagnosis1='".$_POST["ankle_diagnosis1"]."',
32 ankle_diagnosis2='".$_POST["ankle_diagnosis2"]."',
33 ankle_diagnosis3='".$_POST["ankle_diagnosis3"]."',
34 ankle_diagnosis4='".$_POST["ankle_diagnosis4"]."',
35 ankle_plan='".$_POST["ankle_plan"]."',
36 ankle_additional_diagnisis='".$_POST["ankle_additional_diagnisis"]."' where id=$id");
39 $_SESSION["encounter"] = $encounter;
40 formHeader("Redirecting....");