Nation Notes module contributed by Z&H Healthcare.
[openemr.git] / library / custom_template / quest_popup.php
blob6fd0a42b28bc21fc35e52e35bd075f6d7789b412
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 require_once("../../interface/globals.php");
37 $content = $_REQUEST['content'];
39 <html>
40 <head>
41 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
42 <script type="text/javascript">
43 function showWhereInTextarea(){
44 top.restoreSession();
45 var textarea = document.getElementById('quest');
46 start = textarea.value.indexOf("??");
47 len =2;
48 if(textarea.setSelectionRange){
49 textarea.setSelectionRange(parseInt(start), (parseInt(start)+parseInt(len)));
51 else{
52 var range = textarea.createTextRange();
53 range.collapse(true);
55 range.moveStart('character',parseInt(start) );
56 range.moveEnd('character',parseInt(len));
57 range.select();
60 document.getElementById('quest').focus();
62 function replace_quest(val){
63 top.restoreSession();
64 var textarea = document.getElementById('quest').value;
65 textarea=textarea.replace(/\?\?/i,val);
66 document.getElementById('quest').value=textarea;
68 function save_this(){
69 top.restoreSession();
70 var textFrom = document.getElementById('quest').value;
71 window.opener.CKEDITOR.instances.textarea1.insertText(textFrom);
72 window.close();
74 </script>
75 </head>
76 <body class="body_top" onload="showWhereInTextarea()">
77 <table>
78 <tr class="text">
79 <td>
80 <a href="#" onclick="replace_quest('Yes')" class="css_button"><span><?php echo htmlspecialchars(xl('Yes'),ENT_QUOTES);?></span></a>
81 <a href="#" onclick="replace_quest('No')" class="css_button"><span><?php echo htmlspecialchars(xl('No'),ENT_QUOTES);?></span></a>
82 <a href="#" onclick="replace_quest('Normal')" class="css_button"><span><?php echo htmlspecialchars(xl('Normal'),ENT_QUOTES);?></span></a>
83 <a href="#" onclick="replace_quest('Abnormal')" class="css_button"><span><?php echo htmlspecialchars(xl('Abnormal'),ENT_QUOTES);?></span></a>
84 </td>
85 </tr>
86 <tr class="text">
87 <td>
88 <textarea name="quest" id="quest" rows="5" cols="70"><?php echo htmlspecialchars($content,ENT_QUOTES);?></textarea>
89 </td>
90 </tr>
91 <tr>
92 <td colspan="2" align="center">
93 <input type="button" name="save" value="<?php echo htmlspecialchars(xl('Save'),ENT_QUOTES);?>" onclick="save_this()">
94 <input type="button" name="cancel" value="<?php echo htmlspecialchars(xl('Cancel'),ENT_QUOTES);?>" onclick="javascript:window.close()">
95 </td>
96 </tr>
97 </table>
99 </body>
100 </html>