POS default selection for encounter (#1088)
[openemr.git] / library / custom_template / quest_popup.php
blob1a9648c4e2f544e154e4e56b5a68739fc73ef996
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 // +------------------------------------------------------------------------------+
30 require_once("../../interface/globals.php");
31 $content = $_REQUEST['content'];
33 <html>
34 <head>
35 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
36 <script type="text/javascript">
37 function showWhereInTextarea(){
38 opener.restoreSession();
39 var textarea = document.getElementById('quest');
40 start = textarea.value.indexOf("??");
41 len =2;
42 if(textarea.setSelectionRange){
43 textarea.setSelectionRange(parseInt(start), (parseInt(start)+parseInt(len)));
45 else{
46 var range = textarea.createTextRange();
47 range.collapse(true);
49 range.moveStart('character',parseInt(start) );
50 range.moveEnd('character',parseInt(len));
51 range.select();
54 document.getElementById('quest').focus();
56 function replace_quest(val){
57 opener.restoreSession();
58 var textarea = document.getElementById('quest').value;
59 textarea=textarea.replace(/\?\?/i,val);
60 document.getElementById('quest').value=textarea;
62 function save_this(){
63 opener.restoreSession();
64 var textFrom = document.getElementById('quest').value;
65 window.opener.CKEDITOR.instances.textarea1.insertText(textFrom);
66 window.close();
68 </script>
69 </head>
70 <body class="body_top" onload="showWhereInTextarea()">
71 <table>
72 <tr class="text">
73 <td>
74 <?php
75 $res = sqlStatement("SELECT * FROM list_options WHERE list_id = 'nation_notes_replace_buttons' AND activity = 1 ORDER BY seq");
76 while($row = sqlFetchArray($res)){
78 <a href="#" onclick="replace_quest('<?php echo htmlspecialchars($row['option_id'],ENT_QUOTES);?>')" class="css_button"><span><?php echo htmlspecialchars($row['title'],ENT_QUOTES);?></span></a>
79 <?php
82 </td>
83 </tr>
84 <tr class="text">
85 <td>
86 <textarea name="quest" id="quest" rows="5" cols="70"><?php echo htmlspecialchars($content,ENT_QUOTES);?></textarea>
87 </td>
88 </tr>
89 <tr>
90 <td colspan="2" align="center">
91 <input type="button" name="save" value="<?php echo htmlspecialchars(xl('Save'),ENT_QUOTES);?>" onclick="save_this()">
92 <input type="button" name="cancel" value="<?php echo htmlspecialchars(xl('Cancel'),ENT_QUOTES);?>" onclick="javascript:window.close()">
93 </td>
94 </tr>
95 </table>
97 </body>
98 </html>