Nation Notes module contributed by Z&H Healthcare.
[openemr.git] / library / custom_template / upgrade_version.php
blobddec961754d80740f970e1eda2375cbfb9edf020
1 <?php
2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
4 //
5 //
6 // 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 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 //
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Jacob T Paul <jacob@zhservices.com>
26 // +------------------------------------------------------------------------------+
28 //SANITIZE ALL ESCAPES
29 $sanitize_all_escapes=true;
32 //STOP FAKE REGISTER GLOBALS
33 $fake_register_globals=false;
36 include_once('../../interface/globals.php');
37 $sql="select distinct tu_user_id from template_users";
38 $rs=SqlStatement($sql);
39 while($row=SqlFetchArray($rs))
41 $sql="select * from template_users join customlists on cl_list_slno=tu_template_id where
42 cl_deleted=0 and tu_user_id=?";
43 $rs2=SqlStatement($sql,array($row['tu_user_id']));
44 while($row2=SqlFetchArray($rs2))
46 $sql="select cl_list_slno from customlists where cl_deleted=0 and cl_list_id=?";
47 $rs3=SqlStatement($sql,array($row2['cl_list_slno']));
48 while($row3=SqlFetchArray($rs3))
50 SqlStatement("insert into template_users (tu_template_id,tu_user_id) values(?,?)",array($row3['cl_list_slno'],$row['tu_user_id']));