Highway to PSR2
[openemr.git] / contrib / forms / ped_GI / save.php
bloba39250e961d5cd9ae7a1386cb0a3930d12435953
1 <?php
2 //
4 include_once("../../globals.php");
5 include_once("$srcdir/api.inc");
6 include_once("$srcdir/forms.inc");
8 foreach ($_POST as $k => $var) {
9 $_POST[$k] = add_escape_custom($var);
10 echo "$var\n";
13 if ($encounter == "") {
14 $encounter = date("Ymd");
17 if ($_GET["mode"] == "new") {
18 $newid = formSubmit("form_ped_GI", $_POST, $_GET["id"], $userauthorized);
19 addForm($encounter, "Pediatric GI Evaluation", $newid, "ped_GI", $pid, $userauthorized);
20 } elseif ($_GET["mode"] == "update") {
21 sqlInsert("update form_ped_GI set `pid` = {$_SESSION["pid"]},
22 `groupname`='".$_SESSION["authProvider"]."',
23 `user`='".$_SESSION["authUser"]."',
24 `authorized`=$userauthorized,
25 `activity`=1,
26 `date` = NOW(),
27 `diarrhea`='".$_POST["diarrhea"]."',
28 `with_every_bowel_movement`='".$_POST["with_every_bowel_movement"]."',
29 `after_every_meal`='".$_POST["after_every_meal"]."',
30 `blood_or_mucus_in_stool`='".$_POST["blood_or_mucus_in_stool"]."',
31 `diarrhea_onset`='".$_POST["diarrhea_onset"]."',
32 `worms`='".$_POST["worms"]."',
33 `vomits`='".$_POST["vomits"]."',
34 `duration`='".$_POST["duration"]."',
35 `projectile`='".$_POST["projectile"]."',
36 `more_often_than_2_hours`='".$_POST["more_often_than_2_hours"]."',
37 `vomit_after_every_meal`='".$_POST["vomit_after_every_meal"]."',
38 `blood_in_vomitus`='".$_POST["blood_in_vomitus"]."',
39 `taking_medication`='".$_POST["taking_medication"]."',
40 `oral_rehydration`='".$_POST["oral_rehydration"]."',
41 `eating_solid_food`='".$_POST["eating_solid_food"]."',
42 `fever`='".$_POST["fever"]."',
43 `pain`='".$_POST["pain"]."',
44 `lethargy`='".$_POST["lethargy"]."',
45 `oral_hydration_capable`='".$_POST["oral_hydration_capable"]."',
46 `urine_output_last_6_hours`='".$_POST["urine_output_last_6_hours"]."',
47 `pain_with_urination`='".$_POST["pain_with_urination"]."',
48 `cough_or_breathing_difficulty`='".$_POST["cough_or_breathing_difficulty"]."',
49 `able_to_sleep`='".$_POST["able_to_sleep"]."',
50 `nasal_discharge`='".$_POST["nasal_discharge"]."',
51 `previous_hospitalization`='".$_POST["previous_hospitalization"]."',
52 `siblings_affected`='".$_POST["siblings_affected"]."',
53 `immunization_up_to_date`='".$_POST["immunization_up_to_date"]."',
54 `notes`='".$_POST["notes"]."'
55 WHERE id=$id");
58 $_SESSION["encounter"] = $encounter;
60 formHeader("Redirecting....");
61 formJump();
62 formFooter();