adding ubuntu 3.1.0 production package scripts with other pieces
[openemr.git] / custom / search.php
blobde886f1281ca3d11b581e84e4becc8b708bab8df
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
8 include_once("../interface/globals.php");
9 require_once("../library/sql.inc");
13 <head>
14 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
15 <style type="text/css">
16 body {
17 font-size:8pt;
18 font-weight:normal;
19 padding: 5px 3px 5px 3px;
20 background: #94D6E7;
22 </style>
23 <script language="javascript">
24 function doSelectorButton() {
25 var selector = document.getElementById('selectorButton');
26 var value;
27 if ( selector.value == "<?php xl('Select All','e'); ?>" ) {
28 selector.value = "<?php xl('Unselect All','e'); ?>";
29 value = true;
30 } else {
31 selector.value = "<?php xl('Select All','e'); ?>";
32 value = false;
34 var checkBoxes = document.getElementsByName( "searchFields" );
35 setAll( checkBoxes, value );
38 function setAll(field, value) {
39 for (i = 0; i < field.length; i++) {
40 field[i].checked = value ;
44 function doSubmit() {
45 // buildup fieldstring
46 var checkBoxes = document.getElementsByName( "searchFields" );
47 var fieldString = '';
48 for (i = 0; i < checkBoxes.length; i++) {
49 if ( checkBoxes[i].checked ) {
50 if ( fieldString != '' ) {
51 fieldString += "~";
53 fieldString += checkBoxes[i].value;
56 if ( opener != null ) {
57 if ( fieldString == '' || fieldString == undefined ) {
58 alert("<?php xl('You must select some fields to continue.','e'); ?>");
59 return false;
61 opener.processFilter( fieldString );
65 </script>
66 </head>
68 <body>
69 <table>
70 <tr>
71 <td>
72 <b><?php xl('Select Fields', 'e'); ?>:</b>
73 </td>
74 <td>
75 <input type="button" value="<?php xl('Submit','e'); ?>" id="submit" onclick="javascript:doSubmit();"></input>
76 </td>
77 <td>
78 <input type="button" value="<?php xl('Select All','e'); ?>" id="selectorButton" onclick="javascript:doSelectorButton();"></input>
79 </td>
80 </tr>
81 </table>
83 <?php
84 $layoutCols = sqlStatement( "SELECT field_id, description, group_name "
85 . "FROM layout_options "
86 . "WHERE form_id='DEM' "
87 . "AND group_name not like ('%Employer%' ) AND uor !=0 "
88 . "ORDER BY group_name,seq"
92 echo "<table>";
94 $groupNameLabel = "";
95 for($iter=0; $row=sqlFetchArray($layoutCols); $iter++) {
96 if ( $iter == 0 || ($iter % 3 == 0) ) {
97 if ( $iter > 0 ) {
98 echo "</tr>";
100 echo "<tr>";
102 echo "<td>";
103 $fieldId = $row['field_id'];
104 $fieldTitle = $row['description'] ? $row['description'] : $fieldId;
105 echo "<input type='checkbox' value='${fieldId}' name='searchFields'/> <b>" . xl_layout_label($fieldTitle) . "</b>";
106 echo "</td>";
109 echo "</table>";
112 </body>