Added the Persian language
[openemr.git] / interface / forms / aftercare_plan / save.php
blob4ea29bd170050e32f714962a4634f3cbe6f1782b
1 <?php
2 /**
4 * Copyright (C) 2012-2013 Naina Mohamed <naina@capminds.com> CapMinds Technologies
6 * LICENSE: This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @package OpenEMR
18 * @author Naina Mohamed <naina@capminds.com>
19 * @link http://www.open-emr.org
22 //SANITIZE ALL ESCAPES
23 $sanitize_all_escapes=$_POST['true'];
25 //STOP FAKE REGISTER GLOBALS
26 $fake_register_globals=$_POST['false'];
28 include_once("../../globals.php");
29 include_once("$srcdir/api.inc");
30 include_once("$srcdir/forms.inc");
31 require_once("$srcdir/formdata.inc.php");
33 if (! $encounter) { // comes from globals.php
34 die(xl("Internal error: we do not seem to be in an encounter!"));
36 $id = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
38 $sets = "pid = {$_SESSION["pid"]},
39 groupname = '" . $_SESSION["authProvider"] . "',
40 user = '" . $_SESSION["authUser"] . "',
41 authorized = $userauthorized, activity=1, date = NOW(),
42 provider = '" .add_escape_custom($_POST["provider"]) . "',
43 client_name = '" .add_escape_custom($_POST["client_name"]) . "',
44 admit_date = '" .add_escape_custom($_POST["admit_date"]) . "',
45 discharged = '" .add_escape_custom($_POST["discharged"]) . "',
46 goal_a_acute_intoxication = '" . add_escape_custom($_POST["goal_a_acute_intoxication"]) . "',
47 goal_a_acute_intoxication_I = '" . add_escape_custom($_POST["goal_a_acute_intoxication_I"]) . "',
48 goal_a_acute_intoxication_II = '" . add_escape_custom($_POST["goal_a_acute_intoxication_II"]) . "',
49 goal_b_emotional_behavioral_conditions = '" . add_escape_custom($_POST["goal_b_emotional_behavioral_conditions"]) . "',
50 goal_b_emotional_behavioral_conditions_I = '" . add_escape_custom($_POST["goal_b_emotional_behavioral_conditions_I"]) . "',
51 goal_c_relapse_potential = '" . add_escape_custom($_POST["goal_c_relapse_potential"]) . "',
52 goal_c_relapse_potential_I = '" . add_escape_custom($_POST["goal_c_relapse_potential_I"]) . "'";
55 if (empty($id)) {
56 $newid = sqlInsert("INSERT INTO form_aftercare_plan SET $sets");
57 addForm($encounter, "Aftercare Plan", $newid, "aftercare_plan", $pid, $userauthorized);
59 else {
60 sqlStatement("UPDATE form_aftercare_plan SET $sets WHERE id = '". add_escape_custom("$id"). "'");
63 $_SESSION["encounter"] = $encounter;
64 formHeader("Redirecting....");
65 formJump();
66 formFooter();