Moving towards HTML5 and CSS3 compatibility. revision 2.
[openemr.git] / contrib / forms / individual_treatment_plan / save.php
blob4a80a317622b443f0b5ba94a86d19b1eaad8415d
1 <?php
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] = mysql_escape_string($var);
8 echo "$var\n";
10 if ($encounter == "")
11 $encounter = date("Ymd");
12 if ($_GET["mode"] == "new"){
13 $newid = formSubmit("form_individual_treatment_plan", $_POST, $_GET["id"], $userauthorized);
15 addForm($encounter, "Individual Treatment Plan", $newid, "individual_treatment_plan", $pid, $userauthorized);
16 }elseif ($_GET["mode"] == "update") {
17 sqlInsert("update form_individual_treatment_plan set pid = {$_SESSION["pid"]},groupname='".$_SESSION["authProvider"]."',user='".$_SESSION["authUser"]."',authorized=$userauthorized,activity=1, date = NOW(),
18 date_of_referal ='".$_POST["date_of_referal"]."',
19 dcn ='".$_POST["dcn"]."',
20 icd9 ='".$_POST["icd9"]."',
21 prognosis ='".$_POST["prognosis"]."',
22 diagnosis_description ='".$_POST["diagnosis_description"]."',
23 presenting_problem ='".$_POST["presenting_problem"]."',
24 frequency ='".$_POST["frequency"]."',
25 duration ='".$_POST["duration"]."',
26 scope ='".$_POST["scope"]."',
27 short_term_goals_1 ='".$_POST["short_term_goals_1"]."',
28 time_frame_1 ='".$_POST["time_frame_1"]."',
29 short_term_goals_2 ='".$_POST["short_term_goals_2"]."',
30 time_frame_2 ='".$_POST["time_frame_2"]."',
31 short_term_goals_3 ='".$_POST["short_term_goals_3"]."',
32 time_frame_3 ='".$_POST["time_frame_3"]."',
33 long_term_goals ='".$_POST["long_term_goals"]."',
34 discharge_criteria ='".$_POST["discharge_criteria"]."',
35 individual_family_therapy ='".$_POST["individual_family_therapy"]."',
36 substance_abuse ='".$_POST["substance_abuse"]."',
37 group_therapy ='".$_POST["group_therapy"]."',
38 parenting ='".$_POST["parenting"]."',
39 action_steps_by_supports ='".$_POST["action_steps_by_supports"]."',
40 other_supports_name_1 ='".$_POST["other_supports_name_1"]."',
41 other_supports_name_2 ='".$_POST["other_supports_name_2"]."',
42 other_supports_contact_1 ='".$_POST["other_supports_contact_1"]."',
43 other_supports_contact_2 ='".$_POST["other_supports_contact_2"]."',
44 medications_1 ='".$_POST["medications_1"]."',
45 medications_2 ='".$_POST["medications_2"]."',
46 referrals_1 ='".$_POST["referrals_1"]."',
47 referrals_2 ='".$_POST["referrals_2"]."' where id=$id");
49 $_SESSION["encounter"] = $encounter;
50 formHeader("Redirecting....");
51 formJump();
52 formFooter();