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 // +------------------------------------------------------------------------------+
30 require_once("../../interface/globals.php");
31 require_once("$srcdir/lists.inc");
33 use OpenEMR\Core\Header
;
35 // mdsupport : li code
36 function listitemCode($strDisp, $strInsert)
39 echo '<li><span><a href="#" onclick="top.restoreSession();CKEDITOR.instances.textarea1.insertText('.
40 "'" . htmlspecialchars($strInsert, ENT_QUOTES
) . "'" .');">'. htmlspecialchars($strDisp, ENT_QUOTES
) . '</a></span></li>';
44 $contextName = $_REQUEST['contextName'];
45 $type = $_REQUEST['type'];
46 $rowContext = sqlQuery("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_list_item_long=?", array($contextName));
52 <?php Header
::setupHeader(['common', 'opener', 'jquery-ui',]); ?
>
53 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/ckeditor-4-7-0/ckeditor.js"></script
>
54 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/ajax_functions_writer.js"></script
>
56 <script language
="JavaScript" type
="text/javascript">
57 function refreshme() {
59 document
.location
.reload();
61 CKEDITOR
.config
.customConfig
= top
.webroot_url +
'/library/js/nncustom_config.js';
62 $
(document
).ready(function () {
66 $
(".iframe_small").on('click', function (e
) {
69 dlgopen('', '', 330, 120, '', '', {
71 {text
: '<?php echo xla('Close
'); ?>', close
: true, style
: 'default btn-sm'}
73 onClosed
: 'refreshme',
75 url
: $
(this
).attr('href')
79 $
(".iframe_medium").on('click', function (e
) {
82 dlgopen('', '', 725, 500, '', '', {
84 {text
: '<?php echo xla('Close
'); ?>', close
: true, style
: 'default btn-sm'}
86 onClosed
: 'refreshme',
88 url
: $
(this
).attr('href')
92 $
(".iframe_abvmedium").on('click', function (e
) {
95 dlgopen('', '', 700, 500, '', '', {
97 {text
: '<?php echo xla('Close
'); ?>', close
: true, style
: 'default btn-sm'}
99 onClosed
: 'refreshme',
101 url
: $
(this
).attr('href')
105 $
("#menu5 > li > a.expanded + ul").slideToggle("medium");
106 $
("#menu5 > li > a").click(function () {
107 $
("#menu5 > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
108 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
112 <script type
="text/javascript">
113 $
(document
).ready(function () {
116 $
("#menu5 div").sortable({
117 opacity
: 0.3, cursor
: 'move', update
: function () {
118 var order
= $
(this
).sortable("serialize") +
'&action=updateRecordsListings';
119 $
.post("updateDB.php", order
);
125 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
128 <body
class="body_top">
129 <input type
="hidden" name
="list_id" id
="list_id" value
="<?php echo $rowContext['cl_list_id'];?>">
130 <table width
=100% align
=left cellpadding
=0 cellspacing
=0 margin
-left
=0px
>
132 if ($rowContext['cl_list_item_long']) {
134 <tr
class="text"><th colspan
="2" align
="center"><?php
echo strtoupper(htmlspecialchars(xl($rowContext['cl_list_item_long']), ENT_QUOTES
));?
></th
></tr
>
137 <div id
="tab1" class="tabset_content tabset_content_active">
142 <a href
="#" onclick
="return SelectToSave('<?php echo $type;?>')" class="css_button" ><span
><?php
echo htmlspecialchars(xl('SAVE'), ENT_QUOTES
);?
></span
></a
>
147 <select name
="template" id
="template" onchange
="TemplateSentence(this.value)" style
="width:180px">
148 <option value
=""><?php
echo htmlspecialchars(xl('Select category'), ENT_QUOTES
);?
></option
>
150 $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']));
151 while ($rowTemplates = sqlFetchArray($resTemplates)) {
152 echo "<option value='".htmlspecialchars($rowTemplates['cl_list_slno'], ENT_QUOTES
)."'>".htmlspecialchars(xl($rowTemplates['cl_list_item_long']), ENT_QUOTES
)."</option>";
158 <div id
="share" style
="display:none"></div
>
159 <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
> 
;
160 <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
> 
;
161 <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
> 
;
162 <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
>
164 $res=sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN customlists AS cl ON cl.cl_list_slno=tu.tu_template_id
165 WHERE tu.tu_user_id=? AND cl.cl_list_type=6 AND cl.cl_deleted=0 ORDER BY cl.cl_order", array($_SESSION['authId']));
166 while ($row=sqlFetchArray($res)) {
168 <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
>
175 <td valign
=top style
="width:180px;">
176 <div style
="background-color:#DFEBFE">
177 <div style
="overflow-y:scroll;overflow-x:hidden;height:400px">
178 <ul id
="menu5" class="example_menu" style
="width:100%;">
179 <li
><a
class="expanded"><?php
echo htmlspecialchars(xl('Components'), ENT_QUOTES
);?
></a
>
181 <div id
="template_sentence">
187 $row = sqlQuery("SELECT p.*, IF(ISNULL(p.providerID), NULL, CONCAT(u.lname,',',u.fname)) pcp ".
188 "FROM patient_data p LEFT OUTER JOIN users u ".
189 "ON u.id=p.providerID WHERE pid=?", array($pid));
191 <li
><a
class="collapsed"><?php
echo htmlspecialchars(xl('Patient Details'), ENT_QUOTES
);?
></a
>
194 listitemCode(xl('First name'), $row['fname']);
195 listitemCode(xl('Last name'), $row['lname']);
196 listitemCode(xl('Phone'), $row['phone_home']);
197 listitemCode(xl('SSN'), $row['ss']);
198 listitemCode(xl('Date Of Birth'), $row['DOB']);
199 listitemCode(xl('PCP'), $row['pcp']);
204 foreach ($ISSUE_TYPES as $issType => $issTypeDesc) {
205 $res = sqlStatement('SELECT title, IF(diagnosis="","",CONCAT(" [",diagnosis,"]")) codes FROM lists WHERE pid=? AND type=? AND enddate IS NULL ORDER BY title', array($pid, $issType));
206 if (sqlNumRows($res)) {
208 <li
><a
class="collapsed"><?php
echo htmlspecialchars(xl($issTypeDesc[0]), ENT_QUOTES
);?
></a
>
211 while ($row = sqlFetchArray($res)) {
212 listitemCode((strlen($row['title'])>20) ?
(substr($row['title'], 0, 18).'..') : $row['title'], ($row['title'].$row['codes']));
225 <a href
="personalize.php?list_id=<?php echo $rowContext['cl_list_id'];?>" id
="personalize_link" class="iframe_medium css_button_small"><span
><?php
echo htmlspecialchars(xl('Personalize'), ENT_QUOTES
);?
></span
></a
>
226 <a href
="add_custombutton.php" id
="custombutton" class="iframe_medium css_button_small" 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
>
228 <td valign
=top style
="width:700px;">
229 <textarea
class="ckeditor" cols
="100" id
="textarea1" name
="textarea1" rows
="80"></textarea
>
240 echo htmlspecialchars(xl('NO SUCH CONTEXT NAME').$contextName, ENT_QUOTES
);
245 <script type
="text/javascript">
246 edit('<?php echo $type;?>');