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