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");
15 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
16 <style type
="text/css">
20 padding
: 5px
3px
5px
3px
;
24 <script language
="javascript">
25 function doSelectorButton() {
26 var selector
= document
.getElementById('selectorButton');
28 if ( selector
.value
== "<?php xl('Select All','e'); ?>" ) {
29 selector
.value
= "<?php xl('Unselect All','e'); ?>";
32 selector
.value
= "<?php xl('Select All','e'); ?>";
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
;
46 // buildup fieldstring
47 var checkBoxes
= document
.getElementsByName( "searchFields" );
49 for (i
= 0; i
< checkBoxes
.length
; i++
) {
50 if ( checkBoxes
[i
].checked
) {
51 if ( 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'); ?>");
62 opener
.processFilter( fieldString
);
73 <b
><?php
xl('Select Fields', 'e'); ?
>:</b
>
76 <input type
="button" value
="<?php xl('Submit','e'); ?>" id
="submit" onclick
="javascript:doSubmit();"></input
>
79 <input type
="button" value
="<?php xl('Select All','e'); ?>" id
="selectorButton" onclick
="javascript:doSelectorButton();"></input
>
85 function echoFilterItem($iter, $fieldId, $fieldTitle) {
86 if ( $iter == 0 ||
($iter %
3 == 0) ) {
93 echo "<input type='checkbox' value='${fieldId}' name='searchFields'/> <b>$fieldTitle</b>";
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"
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)'));