Changed query that gets the date of the last encounter for date calculations. It...
[openemr.git] / contrib / forms / ped_GI / save.php
blob0554fa43f4bed1792bc6c5803838149661620c9f
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] = mysql_escape_string($var);
10 echo "$var\n";
13 if ($encounter == "") $encounter = date("Ymd");
15 if ($_GET["mode"] == "new"){
16 $newid = formSubmit("form_ped_GI", $_POST, $_GET["id"], $userauthorized);
17 addForm($encounter, "Pediatric GI Evaluation", $newid, "ped_GI", $pid, $userauthorized);
18 } elseif ($_GET["mode"] == "update") {
19 sqlInsert("update form_ped_GI set `pid` = {$_SESSION["pid"]},
20 `groupname`='".$_SESSION["authProvider"]."',
21 `user`='".$_SESSION["authUser"]."',
22 `authorized`=$userauthorized,
23 `activity`=1,
24 `date` = NOW(),
25 `diarrhea`='".$_POST["diarrhea"]."',
26 `with_every_bowel_movement`='".$_POST["with_every_bowel_movement"]."',
27 `after_every_meal`='".$_POST["after_every_meal"]."',
28 `blood_or_mucus_in_stool`='".$_POST["blood_or_mucus_in_stool"]."',
29 `diarrhea_onset`='".$_POST["diarrhea_onset"]."',
30 `worms`='".$_POST["worms"]."',
31 `vomits`='".$_POST["vomits"]."',
32 `duration`='".$_POST["duration"]."',
33 `projectile`='".$_POST["projectile"]."',
34 `more_often_than_2_hours`='".$_POST["more_often_than_2_hours"]."',
35 `vomit_after_every_meal`='".$_POST["vomit_after_every_meal"]."',
36 `blood_in_vomitus`='".$_POST["blood_in_vomitus"]."',
37 `taking_medication`='".$_POST["taking_medication"]."',
38 `oral_rehydration`='".$_POST["oral_rehydration"]."',
39 `eating_solid_food`='".$_POST["eating_solid_food"]."',
40 `fever`='".$_POST["fever"]."',
41 `pain`='".$_POST["pain"]."',
42 `lethargy`='".$_POST["lethargy"]."',
43 `oral_hydration_capable`='".$_POST["oral_hydration_capable"]."',
44 `urine_output_last_6_hours`='".$_POST["urine_output_last_6_hours"]."',
45 `pain_with_urination`='".$_POST["pain_with_urination"]."',
46 `cough_or_breathing_difficulty`='".$_POST["cough_or_breathing_difficulty"]."',
47 `able_to_sleep`='".$_POST["able_to_sleep"]."',
48 `nasal_discharge`='".$_POST["nasal_discharge"]."',
49 `previous_hospitalization`='".$_POST["previous_hospitalization"]."',
50 `siblings_affected`='".$_POST["siblings_affected"]."',
51 `immunization_up_to_date`='".$_POST["immunization_up_to_date"]."',
52 `notes`='".$_POST["notes"]."'
53 WHERE id=$id");
56 $_SESSION["encounter"] = $encounter;
58 formHeader("Redirecting....");
59 formJump();
60 formFooter();