payment gui remove fancybox
[openemr.git] / interface / orders / find_order_popup.php
blob60e85bd03cda74ee351e314c5cb5cfadfc2f48ad
1 <?php
2 /**
3 * Script to pick a procedure order type from the compendium.
5 * Copyright (C) 2013 Rod Roark <rod@sunsetsystems.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
18 * @package OpenEMR
19 * @author Rod Roark <rod@sunsetsystems.com>
25 require_once("../globals.php");
27 $order = 0 + $_GET['order'];
28 $labid = 0 + $_GET['labid'];
30 //////////////////////////////////////////////////////////////////////
31 // The form was submitted with the selected code type.
32 if (isset($_GET['typeid'])) {
33 $typeid = $_GET['typeid'] + 0;
34 $name = '';
35 if ($typeid) {
36 $ptrow = sqlQuery("SELECT name FROM procedure_type WHERE " .
37 "procedure_type_id = '$typeid'");
38 $name = addslashes($ptrow['name']);
41 <script type="text/javascript" src="<?php echo $webroot ?>/interface/main/tabs/js/include_opener.js"></script>
42 <script language="JavaScript">
43 if (opener.closed || !opener.set_proc_type) {
44 alert('<?php xl('The destination form was closed; I cannot act on your selection.', 'e'); ?>');
46 else {
47 opener.set_proc_type(<?php echo "$typeid, '$name'"; ?>);
48 <?php
49 // This is to generate the "Questions at Order Entry" for the Procedure Order form.
50 // GET parms needed for this are: formid, formseq.
51 if (isset($_GET['formid'])) {
52 if ($typeid) {
53 require_once("qoe.inc.php");
54 $qoe_init_javascript = '';
55 echo ' opener.set_proc_html("';
56 echo generate_qoe_html($typeid, intval($_GET['formid']), 0, intval($_GET['formseq']));
57 echo '", "' . $qoe_init_javascript . '");' . "\n";
58 } else {
59 echo ' opener.set_proc_html("", "");' . "\n";
64 window.close();
65 </script>
66 <?php
67 exit();
70 // End Submission.
71 //////////////////////////////////////////////////////////////////////
74 <html>
75 <head>
76 <?php html_header_show(); ?>
77 <script type="text/javascript" src="<?php echo $webroot ?>/interface/main/tabs/js/include_opener.js"></script>
78 <title><?php echo xlt('Procedure Picker'); ?></title>
79 <link rel="stylesheet" href='<?php echo attr($css_header) ?>' type='text/css'>
81 <style>
82 td { font-size:10pt; }
83 </style>
85 <script language="JavaScript">
87 // Reload the script with the select procedure type ID.
88 function selcode(typeid) {
89 location.href = 'find_order_popup.php<?php
90 echo "?order=$order&labid=$labid";
91 if (isset($_GET['formid' ])) {
92 echo '&formid=' . $_GET['formid'];
95 if (isset($_GET['formseq'])) {
96 echo '&formseq=' . $_GET['formseq'];
98 ?>&typeid=' + typeid;
99 return false;
102 </script>
104 </head>
106 <body class="body_top">
108 <form method='post' name='theform' action='find_order_popup.php<?php
109 echo "?order=$order&labid=$labid";
110 if (isset($_GET['formid' ])) {
111 echo '&formid=' . $_GET['formid'];
114 if (isset($_GET['formseq'])) {
115 echo '&formseq=' . $_GET['formseq'];
117 ?>'>
119 <center>
121 <table border='0' cellpadding='5' cellspacing='0'>
123 <tr>
124 <td height="1">
125 </td>
126 </tr>
128 <tr bgcolor='#ddddff'>
129 <td>
132 <?php echo xlt('Search for:'); ?>
133 <input type='text' name='search_term' size='12' value='<?php echo attr($_REQUEST['search_term']); ?>'
134 title='<?php echo xla('Any part of the desired code or its description'); ?>' />
135 &nbsp;
136 <input type='submit' name='bn_search' value='<?php echo xla('Search'); ?>' />
137 &nbsp;&nbsp;&nbsp;
138 <input type='button' value='<?php echo xla('Erase'); ?>' onclick="selcode(0)" />
139 </b>
140 </td>
141 </tr>
143 <tr>
144 <td height="1">
145 </td>
146 </tr>
148 </table>
150 <?php if ($_REQUEST['bn_search']) { ?>
152 <table border='0'>
153 <tr>
154 <td><b><?php echo xlt('Code'); ?></b></td>
155 <td><b><?php echo xlt('Description'); ?></b></td>
156 </tr>
157 <?php
158 $search_term = '%' . $_REQUEST['search_term'] . '%';
160 $query = "SELECT procedure_type_id, procedure_code, name " .
161 "FROM procedure_type WHERE " .
162 "lab_id = ? AND " .
163 "procedure_type LIKE 'ord' AND " .
164 "activity = 1 AND " .
165 "(procedure_code LIKE ? OR name LIKE ?) " .
166 "ORDER BY seq, procedure_code";
168 // echo "<!-- $query $labid $search_term -->\n"; // debugging
170 $res = sqlStatement($query, array($labid, $search_term, $search_term));
172 while ($row = sqlFetchArray($res)) {
173 $itertypeid = $row['procedure_type_id'];
174 $itercode = $row['procedure_code'];
175 $itertext = trim($row['name']);
176 $anchor = "<a href='' onclick='return selcode(" .
177 "\"" . $itertypeid . "\")'>";
178 echo " <tr>";
179 echo " <td>$anchor" . text($itercode) . "</a></td>\n";
180 echo " <td>$anchor" . text($itertext) . "</a></td>\n";
181 echo " </tr>";
184 </table>
186 <?php } ?>
188 </center>
189 </form>
190 </body>
191 </html>