increment database counter for prior commits
[openemr.git] / custom / search.php
blob650d0f1804a5b57e3fc8f68da40235dfe8ab634d
1 <?php
2 //// Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
11 require_once("../interface/globals.php");
13 <html>
14 <head>
15 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
16 <style type="text/css">
17 body {
18 font-size:8pt;
19 font-weight:normal;
20 padding: 5px 3px 5px 3px;
21 background: #94D6E7;
23 </style>
24 <script language="javascript">
25 function doSelectorButton() {
26 var selector = document.getElementById('selectorButton');
27 var value;
28 if ( selector.value == "<?php echo htmlspecialchars(xl('Select All'), ENT_QUOTES); ?>" ) {
29 selector.value = "<?php echo htmlspecialchars(xl('Unselect All'), ENT_QUOTES); ?>";
30 value = true;
31 } else {
32 selector.value = "<?php echo htmlspecialchars(xl('Select All'), ENT_QUOTES); ?>";
33 value = false;
35 var checkBoxes = document.getElementsByName( "searchFields" );
36 setAll( checkBoxes, value );
39 function setAll(field, value) {
40 for (i = 0; i < field.length; i++) {
41 field[i].checked = value ;
45 function doSubmit() {
46 // buildup fieldstring
47 var checkBoxes = document.getElementsByName( "searchFields" );
48 var fieldString = '';
49 var ssc = document.forms[0].search_service_code.value;
50 for (i = 0; i < checkBoxes.length; i++) {
51 if ( checkBoxes[i].checked ) {
52 if ( fieldString != '' ) {
53 fieldString += "~";
55 fieldString += checkBoxes[i].value;
58 if ( opener != null ) {
59 if (fieldString == undefined || (fieldString == '' && ssc.length == '')) {
60 alert("<?php echo htmlspecialchars(xl('You must select some fields to continue.'), ENT_QUOTES); ?>");
61 return false;
63 opener.processFilter(fieldString, ssc);
67 </script>
68 </head>
70 <body>
71 <form>
73 <table>
74 <tr>
75 <td>
76 <b><?php echo htmlspecialchars(xl('Select Fields')); ?>:</b>
77 </td>
78 <td>
79 <input type="button" value="<?php echo htmlspecialchars(xl('Submit'), ENT_QUOTES); ?>" id="submit" onclick="javascript:doSubmit();"></input>
80 </td>
81 <td>
82 <input type="button" value="<?php echo htmlspecialchars(xl('Select All'), ENT_QUOTES); ?>" id="selectorButton" onclick="javascript:doSelectorButton();"></input>
83 </td>
84 </tr>
85 </table>
87 <?php
88 function echoFilterItem($iter, $fieldId, $fieldTitle)
90 if ($iter % 3 == 0) {
91 if ($iter > 0) {
92 echo "</tr>\n";
95 echo "<tr>\n";
98 echo "<td>";
99 echo "<input type='checkbox' value='".htmlspecialchars(${fieldId}, ENT_QUOTES)."' name='searchFields'/> <b>".htmlspecialchars($fieldTitle, ENT_NOQUOTES)."</b>";
100 echo "</td>\n";
103 $layoutCols = sqlStatement("SELECT field_id, title, description, group_name "
104 . "FROM layout_options "
105 . "WHERE form_id='DEM' "
106 . "AND group_name not like ('%Employer%' ) AND uor != 0 "
107 . "ORDER BY group_name,seq");
109 echo "<table>";
111 for ($iter=0; $row=sqlFetchArray($layoutCols); $iter++) {
112 $label = $row['title'] ? $row['title'] : $row['description'];
113 if (!$label) {
114 $label = $row['field_id'];
117 echoFilterItem(
118 $iter,
119 $row['field_id'],
120 xl_layout_label($label)
124 echoFilterItem($iter++, 'pid', xl('Internal Identifier (pid)'));
126 // Finish the row gracefully.
127 while ($iter++ % 3) {
128 echo "<td>&nbsp;</td>\n";
131 echo "</tr>\n";
133 // Write a final line to solicit an optional service code.
134 echo "<tr>\n";
135 echo "<td colspan='3'>";
136 echo "<input type='text' value='' name='search_service_code' size='8' /> " .
137 "<b>" . htmlspecialchars(xl('Service Code')) . "</b> (" .
138 htmlspecialchars(xl('if entered, select only those who have had this service')) . ")";
139 echo "</td>\n";
140 echo "</tr>\n";
142 echo "</table>";
145 </form>
146 </body>
147 </html>