Highway to PSR2
[openemr.git] / contrib / forms / ped_pain / save.php
blob891b3a63ada485dcbe90f4745f80d65a75af31e5
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_pain", $_POST, $_GET["id"], $userauthorized);
19 addForm($encounter, "Pediatric Pain Evaluation", $newid, "ped_pain", $pid, $userauthorized);
20 } elseif ($_GET["mode"] == "update") {
21 sqlInsert("update form_ped_pain set `pid` = {$_SESSION["pid"]},
22 `groupname`='".$_SESSION["authProvider"]."',
23 `user`='".$_SESSION["authUser"]."',
24 `authorized`=$userauthorized,
25 `activity`=1,
26 `date` = NOW(),
27 `location`='".$_POST["location"]."',
28 `duration`='".$_POST["duration"]."',
29 `severity`='".$_POST["severity"]."',
30 `fever`='".$_POST["fever"]."',
31 `lethargy`='".$_POST["lethargy"]."',
32 `vomiting`='".$_POST["vomiting"]."',
33 `oral_hydration_capable`='".$_POST["oral_hydration_capable"]."',
34 `urine_output_last_6_hours`='".$_POST["urine_output_last_6_hours"]."',
35 `pain_with_urination`='".$_POST["pain_with_urination"]."',
36 `cough_or_breathing_difficulty`='".$_POST["cough_or_breathing_difficulty"]."',
37 `able_to_sleep`='".$_POST["able_to_sleep"]."',
38 `nasal_discharge`='".$_POST["nasal_discharge"]."',
39 `previous_hospitalization`='".$_POST["previous_hospitalization"]."',
40 `siblings_affected`='".$_POST["siblings_affected"]."',
41 `immunization_up_to_date`='".$_POST["immunization_up_to_date"]."',
42 `notes`='".$_POST["notes"]."'
43 WHERE id=$id");
46 $_SESSION["encounter"] = $encounter;
48 formHeader("Redirecting....");
49 formJump();
50 formFooter();