2 //------------Forms generated from formsWiz
3 require_once("../../globals.php");
4 require_once("$srcdir/api.inc");
5 require_once("$srcdir/forms.inc");
6 foreach ($_POST as $k => $var) {
7 $_POST[$k] = add_escape_custom($var);
11 if ($encounter == "") {
12 $encounter = date("Ymd");
15 if ($_GET["mode"] == "new") {
16 $newid = formSubmit("form_pain", $_POST, $_GET["id"], $userauthorized);
17 addForm($encounter, "Pain Evaluation", $newid, "pain", $pid, $userauthorized);
18 } elseif ($_GET["mode"] == "update") {
20 sqlInsert("update form_pain set pid = ?,groupname = ?, user = ?, authorized = ?, activity = 1, date = NOW(), history_of_pain = ?,
21 dull = ?, colicky = ?, sharp = ?, duration_of_pain = ?, pain_referred_to_other_sites= ?, what_relieves_pain= ?,
22 what_makes_pain_worse= ?, accompanying_symptoms_vomitting= ?, accompanying_symptoms_nausea= ?,
23 accompanying_symptoms_headache = ?, accompanying_symptoms_other = ?, additional_notes= ? WHERE id = ?", array($_SESSION["pid"], $_SESSION["authProvider"], $_SESSION["authUser"], $userauthorized, $_POST["history_of_pain"], $_POST["dull"], $_POST["colicky"], $_POST["sharp"], $_POST["duration_of_pain"], $_POST["pain_referred_to_other_sites"],
24 $_POST["what_relieves_pain"], $_POST["what_makes_pain_worse"], $_POST["accompanying_symptoms_vomitting"], $_POST["accompanying_symptoms_nausea"], $_POST["accompanying_symptoms_headache"],
25 $_POST["accompanying_symptoms_other"], $_POST["additional_notes"], $id));
28 $_SESSION["encounter"] = $encounter;
29 formHeader("Redirecting....");