Fix for web site change courtesy of info from whimmel.
[openemr.git] / custom / search.php
blob3a021581b624d599cd8631b2dc117880052f3afe
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.
9 include_once("../interface/globals.php");
10 require_once("../library/sql.inc");
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 xl('Select All','e'); ?>" ) {
29 selector.value = "<?php xl('Unselect All','e'); ?>";
30 value = true;
31 } else {
32 selector.value = "<?php xl('Select All','e'); ?>";
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 for (i = 0; i < checkBoxes.length; i++) {
50 if ( checkBoxes[i].checked ) {
51 if ( fieldString != '' ) {
52 fieldString += "~";
54 fieldString += checkBoxes[i].value;
57 if ( opener != null ) {
58 if ( fieldString == '' || fieldString == undefined ) {
59 alert("<?php xl('You must select some fields to continue.','e'); ?>");
60 return false;
62 opener.processFilter( fieldString );
66 </script>
67 </head>
69 <body>
70 <table>
71 <tr>
72 <td>
73 <b><?php xl('Select Fields', 'e'); ?>:</b>
74 </td>
75 <td>
76 <input type="button" value="<?php xl('Submit','e'); ?>" id="submit" onclick="javascript:doSubmit();"></input>
77 </td>
78 <td>
79 <input type="button" value="<?php xl('Select All','e'); ?>" id="selectorButton" onclick="javascript:doSelectorButton();"></input>
80 </td>
81 </tr>
82 </table>
84 <?php
85 function echoFilterItem($iter, $fieldId, $fieldTitle) {
86 if ( $iter == 0 || ($iter % 3 == 0) ) {
87 if ( $iter > 0 ) {
88 echo "</tr>";
90 echo "<tr>";
92 echo "<td>";
93 echo "<input type='checkbox' value='${fieldId}' name='searchFields'/> <b>$fieldTitle</b>";
94 echo "</td>";
97 $layoutCols = sqlStatement( "SELECT field_id, description, group_name "
98 . "FROM layout_options "
99 . "WHERE form_id='DEM' "
100 . "AND group_name not like ('%Employer%' ) AND uor !=0 "
101 . "ORDER BY group_name,seq"
104 echo "<table>";
106 for($iter=0; $row=sqlFetchArray($layoutCols); $iter++) {
107 echoFilterItem($iter, $row['field_id'],
108 xl_layout_label($row['description'] ? $row['description'] : $fieldId));
110 echoFilterItem($iter, 'pid', xl('Internal Identifier (pid)'));
112 echo "</table>";
115 </body>