2 //While creating new encounter this code is used to change the "Billing Facility:".
3 //This happens on change of the "Facility:" field.
5 // +-----------------------------------------------------------------------------+
6 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
21 // A copy of the GNU General Public License is included along with this program:
22 // openemr/interface/login/GnuGPL.html
23 // For more information write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 // Author: Eldho Chacko <eldho@zhservices.com>
27 // Jacob T.Paul <jacob@zhservices.com>
29 // +------------------------------------------------------------------------------+
30 //SANITIZE ALL ESCAPES
32 $sanitize_all_escapes=true;
36 //STOP FAKE REGISTER GLOBALS
38 $fake_register_globals=false;
41 require_once("../../interface/globals.php");
42 require_once("$srcdir/sql.inc");
43 require_once("$srcdir/formatting.inc.php");
44 require_once("$srcdir/options.inc.php");
46 $pid=$_REQUEST['pid'];
47 $facility=$_REQUEST['facility'];
48 $date=$_REQUEST['date'];
49 $q=sqlStatement("SELECT pc_billing_location FROM openemr_postcalendar_events WHERE pc_pid=? AND pc_eventDate=? AND pc_facility=?", array($pid,$date,$facility) );
50 $row=sqlFetchArray($q);
51 billing_facility('billing_facility',$row['pc_billing_location']);