Added 3 forms (Aftercare Plan, Transfer Summary, Treatment Plan)
[openemr.git] / interface / forms / transfer_summary / save.php
blob4d18420f4b6edd8c769a7a439d6045c5b26eda60
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");
32 if (! $encounter) { // comes from globals.php
33 die(xl("Internal error: we do not seem to be in an encounter!"));
37 $id = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
39 $sets = "pid = {$_SESSION["pid"]},
40 groupname = '" . $_SESSION["authProvider"] . "',
41 user = '" . $_SESSION["authUser"] . "',
42 authorized = $userauthorized, activity=1, date = NOW(),
43 provider = '" . add_escape_custom(formData("provider")) . "',
44 client_name = '" . add_escape_custom(formData("client_name")) . "',
45 transfer_to = '" . add_escape_custom(formData("transfer_to")) . "',
46 transfer_date = '" . add_escape_custom(formData("transfer_date")) . "',
47 status_of_admission = '" . add_escape_custom(formData("status_of_admission")) . "',
48 diagnosis = '" . add_escape_custom(formData("diagnosis")) . "',
49 intervention_provided = '" . add_escape_custom(formData("intervention_provided")) . "',
50 overall_status_of_discharge = '" . add_escape_custom(formData("overall_status_of_discharge")) ."'";
53 if (empty($id)) {
54 $newid = sqlInsert("INSERT INTO form_transfer_summary SET $sets");
55 addForm($encounter, "Transfer Summary", $newid, "transfer_summary", $pid, $userauthorized);
57 else {
58 sqlStatement("UPDATE form_transfer_summary SET $sets WHERE id = '". add_escape_custom("$id"). "'");
61 $_SESSION["encounter"] = htmlspecialchars($encounter);
62 formHeader("Redirecting....");
63 formJump();
64 formFooter();