fixed inactivity timeout failure
[openemr.git] / interface / forms / misc_billing_options / save.php
blobd4e47edc4d44e5e0a0130c41f81b026bac259676
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/api.inc");
4 include_once("$srcdir/forms.inc");
6 if ($_POST["off_work_from"] == "0000-00-00" || $_POST["off_work_from"] == "")
7 { $_POST["is_unable_to_work"] = "0"; $_POST["off_work_to"] = "";}
8 else {$_POST["is_unable_to_work"] = "1";}
10 if ($_POST["hospitalization_date_from"] == "0000-00-00" || $_POST["hospitalization_date_from"] == "")
11 { $_POST["is_hospitalized"] = "0"; $_POST["hospitalization_date_to"] = "";}
12 else {$_POST["is_hospitalized"] = "1";}
14 foreach ($_POST as $k => $var) {
15 $_POST[$k] = mysql_escape_string($var);
16 echo "$var\n";
18 if ($encounter == "")
19 $encounter = date("Ymd");
20 if ($_GET["mode"] == "new"){
21 $newid = formSubmit("form_misc_billing_options", $_POST, $_GET["id"], $userauthorized);
22 addForm($encounter, "Misc Billing Options", $newid, "misc_billing_options", $pid, $userauthorized);
23 }elseif ($_GET["mode"] == "update") {
24 sqlInsert("update form_misc_billing_options set pid = {$_SESSION["pid"]},
25 groupname='".$_SESSION["authProvider"]."',
26 user='".$_SESSION["authUser"]."',
27 authorized=$userauthorized,activity=1, date = NOW(),
28 employment_related='".$_POST["employment_related"]."',
29 auto_accident='".$_POST["auto_accident"]."',
30 accident_state='".$_POST["accident_state"]."',
31 other_accident='".$_POST["other_accident"]."',
32 outside_lab='".$_POST["outside_lab"]."',
33 lab_amount='".$_POST["lab_amount"]."',
34 is_unable_to_work='".$_POST["is_unable_to_work"]."',
35 off_work_from='".$_POST["off_work_from"]."',
36 off_work_to='".$_POST["off_work_to"]."',
37 is_hospitalized='".$_POST["is_hospitalized"]."',
38 hospitalization_date_from='".$_POST["hospitalization_date_from"]."',
39 hospitalization_date_to='".$_POST["hospitalization_date_to"]."',
40 medicaid_resubmission_code='".$_POST["medicaid_resubmission_code"]."',
41 medicaid_original_reference='".$_POST["medicaid_original_reference"]."',
42 prior_auth_number='".$_POST["prior_auth_number"]."',
43 comments='".$_POST["comments"]."'
44 where id=$id");
46 $_SESSION["encounter"] = $encounter;
47 formHeader("Redirecting....");
48 formJump();
49 formFooter();