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 require_once("$srcdir/lists.inc");
38 // mdsupport : li code
39 function listitemCode ($strDisp, $strInsert) {
41 echo '<li><span><a href="#" onclick="top.restoreSession();CKEDITOR.instances.textarea1.insertText('.
42 "'" . htmlspecialchars($strInsert,ENT_QUOTES
) . "'" .');">'. htmlspecialchars($strDisp,ENT_QUOTES
) . '</a></span></li>';
46 $contextName = $_REQUEST['contextName'];
47 $type = $_REQUEST['type'];
48 $rowContext = sqlQuery("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_list_item_long=?",array($contextName));
53 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
54 <script type
="text/javascript" src
="ckeditor/ckeditor.js"></script
>
55 <script src
="ckeditor/_samples/sample.js" type
="text/javascript"></script
>
56 <link href
="ckeditor/_samples/sample.css" rel
="stylesheet" type
="text/css" />
57 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
58 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
59 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script
>
60 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui-1.7.1.custom.min.js"></script
>
61 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
62 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
63 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script
>
64 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.easydrag.handler.beta2.js"></script
>
65 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/ajax_functions_writer.js"></script
>
66 <script language
="JavaScript" type
="text/javascript">
67 $
(document
).ready(function(){
75 $
(".iframe_small").fancybox( {
76 'overlayOpacity' : 0.0,
77 'showCloseButton' : true,
81 $
(".iframe_medium").fancybox( {
82 'overlayOpacity' : 0.0,
83 'showCloseButton' : true,
87 $
(".iframe_abvmedium").fancybox( {
88 'overlayOpacity' : 0.0,
89 'showCloseButton' : true,
94 // add drag and drop functionality to fancybox
95 $
("#fancy_outer").easydrag();
98 $
("#menu5 > li > a.expanded + ul").slideToggle("medium");
99 $
("#menu5 > li > a").click(function() {
100 $
("#menu5 > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
101 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
105 <script type
="text/javascript">
106 $
(document
).ready(function(){
109 $
("#menu5 div").sortable({ opacity
: 0.3, cursor
: 'move', update
: function() {
110 var order
= $
(this
).sortable("serialize") +
'&action=updateRecordsListings';
111 $
.post("updateDB.php", order
);
117 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
120 <body
class="body_top">
121 <input type
="hidden" name
="list_id" id
="list_id" value
="<?php echo $rowContext['cl_list_id'];?>">
122 <table width
=100% align
=left cellpadding
=0 cellspacing
=0 margin
-left
=0px
>
124 if($rowContext['cl_list_item_long']){
126 <tr
class="text"><th colspan
="2" align
="center"><?php
echo strtoupper(htmlspecialchars(xl($rowContext['cl_list_item_long']),ENT_QUOTES
));?
></th
></tr
>
129 <div id
="tab1" class="tabset_content tabset_content_active">
134 <a href
="#" onclick
="return SelectToSave('<?php echo $type;?>')" class="css_button" ><span
><?php
echo htmlspecialchars(xl('SAVE'),ENT_QUOTES
);?
></span
></a
>
139 <select name
="template" id
="template" onchange
="TemplateSentence(this.value)" style
="width:180px">
140 <option value
=""><?php
echo htmlspecialchars(xl('Select category'),ENT_QUOTES
);?
></option
>
142 $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']));
143 while($rowTemplates = sqlFetchArray($resTemplates)){
144 echo "<option value='".htmlspecialchars($rowTemplates['cl_list_slno'],ENT_QUOTES
)."'>".htmlspecialchars(xl($rowTemplates['cl_list_item_long']),ENT_QUOTES
)."</option>";
150 <div id
="share" style
="display:none"></div
>
151 <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
> 
;
152 <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
> 
;
153 <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
> 
;
154 <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
>
156 $res=sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN customlists AS cl ON cl.cl_list_slno=tu.tu_template_id
157 WHERE tu.tu_user_id=? AND cl.cl_list_type=6 AND cl.cl_deleted=0 ORDER BY cl.cl_order",array($_SESSION['authId']));
158 while($row=sqlFetchArray($res)){
160 <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
>
167 <td valign
=top style
="width:180px;">
168 <div style
="background-color:#DFEBFE">
169 <div style
="overflow-y:scroll;overflow-x:hidden;height:400px">
170 <ul id
="menu5" class="example_menu" style
="width:100%;">
171 <li
><a
class="expanded"><?php
echo htmlspecialchars(xl('Components'),ENT_QUOTES
);?
></a
>
173 <div id
="template_sentence">
179 $row = sqlQuery("SELECT p.*, IF(ISNULL(p.providerID), NULL, CONCAT(u.lname,',',u.fname)) pcp ".
180 "FROM patient_data p LEFT OUTER JOIN users u ".
181 "ON u.id=p.providerID WHERE pid=?"
184 <li
><a
class="collapsed"><?php
echo htmlspecialchars(xl('Patient Details'),ENT_QUOTES
);?
></a
>
187 listitemCode(xl('First name'), $row['fname']);
188 listitemCode(xl('Last name'), $row['lname']);
189 listitemCode(xl('Phone'), $row['phone_home']);
190 listitemCode(xl('SSN'), $row['ss']);
191 listitemCode(xl('Date Of Birth'), $row['DOB']);
192 listitemCode(xl('PCP'), $row['pcp']);
197 foreach ($ISSUE_TYPES as $issType => $issTypeDesc) {
198 $res = sqlStatement('SELECT title, IF(diagnosis="","",CONCAT(" [",diagnosis,"]")) codes FROM lists WHERE pid=? AND type=? AND enddate IS NULL ORDER BY title'
199 ,array($pid, $issType));
200 if (sqlNumRows($res)) {
202 <li
><a
class="collapsed"><?php
echo htmlspecialchars(xl($issTypeDesc[0]),ENT_QUOTES
);?
></a
>
205 while ($row = sqlFetchArray($res)) {
206 listitemCode((strlen($row['title'])>20) ?
(substr($row['title'], 0, 18).'..') : $row['title'], ($row['title'].$row['codes']));
219 <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
>
220 <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
>
222 <td valign
=top style
="width:700px;">
223 <textarea
class="ckeditor" cols
="100" id
="textarea1" name
="textarea1" rows
="80"></textarea
>
235 echo htmlspecialchars(xl('NO SUCH CONTEXT NAME').$contextName,ENT_QUOTES
);
240 <script type
="text/javascript">
241 edit('<?php echo $type;?>');