Added translation to encounter reason
[openemr.git] / interface / de_identification_forms / find_immunization_popup.php
blob4ac1887e4a4270d06a9f210280a3a07d2fc7bdf7
1 <?php
2 /********************************************************************************\
3 * Copyright (C) ViCarePlus, Visolve (vicareplus_engg@visolve.com) *
4 * *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 \********************************************************************************/
19 require_once("../globals.php");
20 require_once("$srcdir/patient.inc");
21 require_once("../../custom/code_types.inc.php");
23 $info_msg = "";
24 $codetype = $_REQUEST['codetype'];
25 $form_code_type = $_POST['form_code_type'];
27 <html>
28 <head>
29 <?php html_header_show(); ?>
30 <title><?php xl('Immunization', 'e'); ?></title>
31 <link rel="stylesheet" href='<?php echo $css_header ?>' type='text/css'>
32 <style>
33 td { font-size:10pt; }
34 </style>
35 <script language="JavaScript">
36 //pass value selected to the parent window
37 function window_submit(chk)
39 var str;
40 var len=chk.length;
41 if (len==undefined && chk.checked==1)
43 if(!str)
44 str = chk.value;
45 else
46 str = "#"+chk.value;
48 else
50 for (pr = 0; pr < chk.length; pr++)
52 if(chk[pr].checked == 1)
54 if(!str)
55 str = chk[pr].value;
56 else
57 str = str+"#"+chk[pr].value;
61 if(!str)
62 alert('<?php echo xl("Select Immunizations");?>');
63 if (opener.closed || ! opener.set_related)
64 alert("<?php echo xl('The destination form was closed');?>");
65 else
66 opener.set_related(str,"immunizations");
68 window.close();
72 function window_close(chk)
74 window.close();
77 function chkbox_select_none(chk)
79 var len=chk.length;
80 if (len==undefined) {chk.checked=false;}
81 else
83 for (pr = 0; pr < chk.length; pr++)
85 chk[pr].checked=false;
90 function chkbox_select_all(chk)
92 var len=chk.length;
93 if (len==undefined) {chk.checked=true;}
94 else
96 for (pr = 0; pr < chk.length; pr++)
98 chk[pr].checked=true;
103 function check_search_str()
105 var search_str = document.getElementById('search_term').value;
106 if(search_str.length < 3)
108 alert('<?php echo xl("Search string should have at least three characters");?>');
109 return false;
111 top.restoreSession();
112 return true;
114 </script>
115 </head>
116 <body class="body_top">
117 <form method='post' name='theform' action='find_immunization_popup.php' onsubmit="return check_search_str();">
118 <center>
119 <table border='0' cellpadding='5' cellspacing='0'>
120 <tr>
121 <td height="1">
122 </td>
123 </tr>
124 <tr>
125 <td>
127 <?php xl('Search for', 'e'); ?>
128 <input type='text' name='search_term' id='search_term' size='12' value='<?php echo $_REQUEST['search_term']; ?>'
129 title='<?php xl('Any part of the immunization id or immunization name', 'e'); ?>' />
130 &nbsp;
131 <input type='submit' name='bn_search' value='<?php xl('Search', 'e'); ?>' />
132 </b>
133 </td>
134 </tr>
135 <tr>
136 <td height="1">
137 </td>
138 </tr>
139 </table>
140 </center>
141 </form>
142 <form method='post' name='select_immunization'>
143 <?php if ($_REQUEST['bn_search']) { ?>
144 <table border='0'>
145 <tr>
146 <td colspan="4">
147 <?php
148 $search_term = $_REQUEST['search_term'];
150 $query = "SELECT count(*) as count FROM list_options " .
151 "WHERE (list_id = 'immunizations' and title LIKE '%$search_term%' AND activity = 1) " ;
152 $res = sqlStatement($query);
153 if ($row = sqlFetchArray($res)) {
154 $no_of_items = addslashes($row['count']);
155 if ($no_of_items < 1) {
157 <script language='JavaScript'>
158 alert("<?php echo xl('Search string does not match with list in database');
159 echo '\n';
160 echo xl('Please enter new search string');?>");
161 document.theform.search_term.value=" ";
162 document.theform.search_term.focus();
163 </script>
164 <?php
167 $query = "SELECT option_id,title FROM list_options " .
168 "WHERE (list_id = 'immunizations' and title LIKE '%$search_term%' AND activity = 1) " .
169 "ORDER BY title";
170 $res = sqlStatement($query);
171 $row_count = 0;
172 while ($row = sqlFetchArray($res)) {
173 $row_count = $row_count + 1;
174 $itercode = addslashes($row['option_id']);
175 $itertext = addslashes(ucfirst(strtolower(trim($row['title']))));
177 <input type="checkbox" id="chkbox" value= "<?php echo $itercode."-".$itertext; ?>" > <?php echo $itercode." ".$itertext."</br>";
183 </td>
184 </tr>
185 </table>
186 <center>
187 <input type='button' name='select_all' value='<?php xl('Select All', 'e'); ?>' onclick="chkbox_select_all(document.select_immunization.chkbox);"/>
189 <input type='button' name='select_none' value='<?php xl('Unselect All', 'e'); ?>' onclick="chkbox_select_none(document.select_immunization.chkbox);"/>
191 <input type='button' name='submit' value='<?php xl('Submit', 'e'); ?>' onclick="window_submit(document.select_immunization.chkbox);"/>
193 <input type='button' name='cancel' value='<?php xl('Cancel', 'e'); ?>' onclick="window_close();"/>
195 </center>
196 <?php } ?>
197 </form>
198 </body>
199 </html>