2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
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.
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 require_once("../../interface/globals.php");
37 $contextName = $_REQUEST['contextName'];
38 $type = $_REQUEST['type'];
39 $rowContext = sqlQuery("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_list_item_long=?",array($contextName));
44 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
45 <script type
="text/javascript" src
="ckeditor/ckeditor.js"></script
>
46 <script src
="ckeditor/_samples/sample.js" type
="text/javascript"></script
>
47 <link href
="ckeditor/_samples/sample.css" rel
="stylesheet" type
="text/css" />
48 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
49 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
50 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script
>
51 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui-1.7.1.custom.min.js"></script
>
52 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
53 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
54 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script
>
55 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.easydrag.handler.beta2.js"></script
>
56 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/ajax_functions_writer.js"></script
>
57 <script language
="JavaScript" type
="text/javascript">
58 $
(document
).ready(function(){
66 $
(".iframe_small").fancybox( {
67 'overlayOpacity' : 0.0,
68 'showCloseButton' : true,
72 $
(".iframe_medium").fancybox( {
73 'overlayOpacity' : 0.0,
74 'showCloseButton' : true,
78 $
(".iframe_abvmedium").fancybox( {
79 'overlayOpacity' : 0.0,
80 'showCloseButton' : true,
85 // add drag and drop functionality to fancybox
86 $
("#fancy_outer").easydrag();
89 $
("#menu5 > li > a.expanded + ul").slideToggle("medium");
90 $
("#menu5 > li > a").click(function() {
91 $
("#menu5 > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
92 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
96 <script type
="text/javascript">
97 $
(document
).ready(function(){
100 $
("#menu5 div").sortable({ opacity
: 0.3, cursor
: 'move', update
: function() {
101 var order
= $
(this
).sortable("serialize") +
'&action=updateRecordsListings';
102 $
.post("updateDB.php", order
);
108 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
111 <body
class="body_top">
112 <input type
="hidden" name
="list_id" id
="list_id" value
="<?php echo $rowContext['cl_list_id'];?>">
113 <table width
=100% align
=left cellpadding
=0 cellspacing
=0 margin
-left
=0px
>
115 if($rowContext['cl_list_item_long']){
117 <tr
class="text"><th colspan
="2" align
="center"><?php
echo strtoupper(htmlspecialchars(xl($rowContext['cl_list_item_long']),ENT_QUOTES
));?
></th
></tr
>
120 <div id
="tab1" class="tabset_content tabset_content_active">
125 <a href
="#" onclick
="return SelectToSave('<?php echo $type;?>')" class="css_button" ><span
><?php
echo htmlspecialchars(xl('SAVE'),ENT_QUOTES
);?
></span
></a
>
130 <select name
="template" id
="template" onchange
="TemplateSentence(this.value)" style
="width:180px">
131 <option value
=""><?php
echo htmlspecialchars(xl('Select category'),ENT_QUOTES
);?
></option
>
133 $resTemplates = sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN customlists AS c ON tu.tu_template_id=c.cl_list_slno WHERE tu.tu_user_id=? AND c.cl_list_type=3 AND cl_list_id=? AND cl_deleted=0 ORDER BY c.cl_list_item_long",array($_SESSION['authId'],$rowContext['cl_list_id']));
134 while($rowTemplates = sqlFetchArray($resTemplates)){
135 echo "<option value='".htmlspecialchars($rowTemplates['cl_list_slno'],ENT_QUOTES
)."'>".htmlspecialchars(xl($rowTemplates['cl_list_item_long']),ENT_QUOTES
)."</option>";
141 <div id
="share" style
="display:none"></div
>
142 <a href
="#" id
="enter" onclick
="top.restoreSession();ascii_write('13','textarea1');" title
="<?php echo htmlspecialchars(xl('Enter Key'),ENT_QUOTES);?>"><img border
=0 src
="../../images/enter.gif"></a
> 
;
143 <a href
="#" id
="quest" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('? ');" title
="<?php echo htmlspecialchars(xl('Question Mark'),ENT_QUOTES);?>"><img border
=0 src
="../../images/question.png"></a
> 
;
144 <a href
="#" id
="para" onclick
="top.restoreSession();ascii_write('para','textarea1');" title
="<?php echo htmlspecialchars(xl('New Paragraph'),ENT_QUOTES);?>"><img border
=0 src
="../../images/paragraph.png"></a
> 
;
145 <a href
="#" id
="space" onclick
="top.restoreSession();ascii_write('32','textarea1');" class="css_button" title
="<?php echo htmlspecialchars(xl('Space'),ENT_QUOTES);?>"><span
><?php
echo htmlspecialchars(xl('SPACE'),ENT_QUOTES
);?
></span
></a
>
147 $res=sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN customlists AS cl ON cl.cl_list_slno=tu.tu_template_id
148 WHERE tu.tu_user_id=? AND cl.cl_list_type=6 AND cl.cl_deleted=0 ORDER BY cl.cl_order",array($_SESSION['authId']));
149 while($row=sqlFetchArray($res)){
151 <a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['cl_list_item_short'];?>');" class="css_button" title
="<?php echo htmlspecialchars(xl($row['cl_list_item_long']),ENT_QUOTES);?>"><span
><?php
echo ucfirst(htmlspecialchars(xl($row['cl_list_item_long']),ENT_QUOTES
));?
></span
></a
>
158 <td valign
=top style
="width:180px;">
159 <div style
="background-color:#DFEBFE">
160 <div style
="overflow-y:scroll;overflow-x:hidden;height:400px">
161 <ul id
="menu5" class="example_menu" style
="width:100%;">
162 <li
><a
class="expanded"><?php
echo htmlspecialchars(xl('Components'),ENT_QUOTES
);?
></a
>
164 <div id
="template_sentence">
170 $row = sqlQuery("SELECT * FROM patient_data WHERE pid=?",array($pid));
172 <li
><a
class="collapsed"><?php
echo htmlspecialchars(xl('Patient Details'),ENT_QUOTES
);?
></a
>
174 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['fname'];?>');"><?php
echo htmlspecialchars(xl('First name',ENT_QUOTES
));?
></a
></span
></li
>
175 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['lname'];?>');"><?php
echo htmlspecialchars(xl('Last name',ENT_QUOTES
));?
></a
></span
></li
>
177 if($row['phone_home']){
179 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['phone_home'];?>');"><?php
echo htmlspecialchars(xl('Phone',ENT_QUOTES
));?
></a
></span
></li
>
186 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['ss'];?>');"><?php
echo htmlspecialchars(xl('SSN',ENT_QUOTES
));?
></a
></span
></li
>
193 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $row['DOB'];?>');"><?php
echo htmlspecialchars(xl('Date Of Birth',ENT_QUOTES
));?
></a
></span
></li
>
198 if($row['providerID']){
199 $val=sqlQuery("SELECT CONCAT(lname,',',fname) AS name FROM users WHERE id='".$row['providerID']."'");
201 <li
><span
><a href
="#" onclick
="top.restoreSession();CKEDITOR.instances.textarea1.insertText('<?php echo $val['name'];?>');"><?php
echo htmlspecialchars(xl('PCP',ENT_QUOTES
));?
></a
></span
></li
>
213 <a href
="personalize.php?list_id=<?php echo $rowContext['cl_list_id'];?>" id
="personalize_link" class="iframe_medium css_button"><span
><?php
echo htmlspecialchars(xl('Personalize'),ENT_QUOTES
);?
></span
></a
>
214 <a href
="add_custombutton.php" id
="custombutton" class="iframe_medium css_button" title
="<?php echo htmlspecialchars(xl('Add Buttons for Special Chars,Texts to be Displayed on Top of the Editor for inclusion to the text on a Click'),ENT_QUOTES);?>"><span
><?php
echo htmlspecialchars(xl('Add Buttons'),ENT_QUOTES
);?
></span
></a
>
216 <td valign
=top style
="width:700px;">
217 <textarea
class="ckeditor" cols
="100" id
="textarea1" name
="textarea1" rows
="80"></textarea
>
229 echo htmlspecialchars(xl('NO SUCH CONTEXT NAME').$contextName,ENT_QUOTES
);
234 <script type
="text/javascript">
235 edit('<?php echo $type;?>');