fix in tab ui for top.restoreSession
[openemr.git] / contrib / forms / pain / save.php
blobc56b0f3fd5ad1ef9e21a4b8a76444c024bb5a227
1 <?php
2 //------------Forms generated from formsWiz
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);
8 echo "$var\n";
10 if ($encounter == "")
11 $encounter = date("Ymd");
12 if ($_GET["mode"] == "new"){
13 $newid = formSubmit("form_pain", $_POST, $_GET["id"], $userauthorized);
14 addForm($encounter, "Pain Evaluation", $newid, "pain", $pid, $userauthorized);
15 }elseif ($_GET["mode"] == "update") {
16 sqlInsert("update form_pain set pid = {$_SESSION["pid"]},groupname='".$_SESSION["authProvider"]."',user='".$_SESSION["authUser"]."',authorized=$userauthorized,activity=1, date = NOW(), history_of_pain='".$_POST["history_of_pain"]."', dull='".$_POST["dull"]."', colicky='".$_POST["colicky"]."', sharp='".$_POST["sharp"]."', duration_of_pain='".$_POST["duration_of_pain"]."', pain_referred_to_other_sites='".$_POST["pain_referred_to_other_sites"]."', what_relieves_pain='".$_POST["what_relieves_pain"]."', what_makes_pain_worse='".$_POST["what_makes_pain_worse"]."', accompanying_symptoms_vomitting='".$_POST["accompanying_symptoms_vomitting"]."', accompanying_symptoms_nausea='".$_POST["accompanying_symptoms_nausea"]."', accompanying_symptoms_headache='".$_POST["accompanying_symptoms_headache"]."', accompanying_symptoms_other='".$_POST["accompanying_symptoms_other"]."', additional_notes='".$_POST["additional_notes"]."' where id=$id");
18 $_SESSION["encounter"] = $encounter;
19 formHeader("Redirecting....");
20 formJump();
21 formFooter();