2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Paul Simon K <paul@zhservices.com>
26 // +------------------------------------------------------------------------------+
28 <!-- This displays the search criteria
.The master processing is done here
.This page is included in the billing_report
.php
-->
30 .criteria_class1
{width
:125px
;}
31 .criteria_class2
{padding
-left
:5px
;}
34 $ThisPageSearchCriteriaKey=array();
35 $ThisPageSearchCriteriaDataType=array();
36 $ThisPageSearchCriteriaDisplay=array();
38 $ThisPageSearchCriteriaRadioKey=array();
39 $ThisPageSearchCriteriaDisplayRadio=array();
41 $ThisPageSearchCriteriaQueryDropDown=array();
42 $ThisPageSearchCriteriaQueryDropDownDefault=array();
43 $ThisPageSearchCriteriaQueryDropDownDefaultKey=array();
45 $ThisPageSearchCriteriaInclude=array();
46 //Filling the input array.
47 $ThisPageSearchCriteriaDisplay=$ThisPageSearchCriteriaDisplayMaster;
48 $ThisPageSearchCriteriaKey=explode(',', $ThisPageSearchCriteriaKeyMaster);
49 $ThisPageSearchCriteriaDataType=explode(',', $ThisPageSearchCriteriaDataTypeMaster);
50 //--------------------------------------------------------------
51 //Filling the input array.
52 $NumberOfRadioThisPageSearchCriteria=0;
53 $NumberOfQueryDropDownThisPageSearchCriteria=0;
54 $NumberOfIncludeThisPageSearchCriteria=0;
55 for ($ThisPageSearchCriteriaIndex=0; $ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaDataType); $ThisPageSearchCriteriaIndex++
) {
56 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio' ||
$ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like') {
57 $NumberOfRadioThisPageSearchCriteria++
;
58 $ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex]=$ThisPageSearchCriteriaDisplayRadioMaster[$NumberOfRadioThisPageSearchCriteria];
59 $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex]=explode(',', $ThisPageSearchCriteriaRadioKeyMaster[$NumberOfRadioThisPageSearchCriteria]);
62 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='query_drop_down') {
63 $NumberOfQueryDropDownThisPageSearchCriteria++
;
64 $ThisPageSearchCriteriaQueryDropDown[$ThisPageSearchCriteriaIndex]=$NumberOfQueryDropDownThisPageSearchCriteria;
65 $ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex]=
66 $ThisPageSearchCriteriaQueryDropDownMasterDefault[$NumberOfQueryDropDownThisPageSearchCriteria];
67 $ThisPageSearchCriteriaQueryDropDownDefaultKey[$ThisPageSearchCriteriaIndex]=
68 $ThisPageSearchCriteriaQueryDropDownMasterDefaultKey[$NumberOfQueryDropDownThisPageSearchCriteria];
71 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='include') {
72 $NumberOfIncludeThisPageSearchCriteria++
;
73 $ThisPageSearchCriteriaInclude[$ThisPageSearchCriteriaIndex]=$NumberOfIncludeThisPageSearchCriteria;
77 //------------------------------------------------------------------------------
79 <table width
="560" border
="0" cellspacing
="0" cellpadding
="0" >
81 <td
><fieldset style
="border-color:#000000; border-width:1px;padding-left:5px;padding-right:0px;padding-top:0px;padding-bottom:0px;" >
82 <legend
class='text'><b
><?php
echo htmlspecialchars(xl('Choose Criteria'), ENT_QUOTES
) ?
></b
></legend
>
83 <table width
="290" border
="0" cellspacing
="0" cellpadding
="0">
85 <td
class='text'><?php
echo htmlspecialchars(xl('Criteria'), ENT_QUOTES
) ?
></td
>
90 <select name
="choose_this_page_criteria" id
="choose_this_page_criteria" title
="Choose Criteria"
91 class="text" style
="width:140px;" onChange
="CriteriaVisible()" size
='8' >
93 for ($ThisPageSearchCriteriaIndex=0; $ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaKey); $ThisPageSearchCriteriaIndex++
) {
94 $optionValue = $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];
95 echo "<option value='".attr($optionValue)."'";
96 $optionLabel = $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex];
97 echo ">".text($optionLabel)."</option>\n";
102 <td width
="150" valign
="top">
103 <!-- Below section comes
as per the defined criteria arrays
.Initially all are hidden
.As per the click the corresponding items gets visible
. -->
105 for ($ThisPageSearchCriteriaIndex=0; $ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaKey); $ThisPageSearchCriteriaIndex++
) {
106 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='date' ||
107 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='datetime') {
108 $DateNamePart=str_replace('.', '_', $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
110 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
111 id
="table_<?php echo attr($ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]) ?>" style
="display:none">
113 <td
class='text criteria_class2' ><?php
echo text($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]); ?
></td
>
116 <td width
="150" class='text criteria_class2' >
118 echo generate_select_list(
119 "date_master_criteria_$DateNamePart",
120 "date_master_criteria",
121 $_REQUEST["date_master_criteria_$DateNamePart"],
124 "text criteria_class1",
125 'calendar_function(this.value,"master_from_date_'.$DateNamePart.'","master_to_date_'.$DateNamePart.'");
126 appendOptionDateCriteria("'.attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]).'","'.
127 $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex].'",this.options[this.selectedIndex].text,'.
128 'this.options[this.selectedIndex].value," = ","master_from_date_'.$DateNamePart.'","master_to_date_'.$DateNamePart.'",
129 "'.$ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex].'")'
135 <td
class='text' align
="right" style
="padding-right:5px;padding-bottom:2px;padding-top:2px">
136 <?php
echo htmlspecialchars(xl('From'), ENT_QUOTES
).':' ?
><input type
='text' size
='7'
137 name
='master_from_date_<?php echo $DateNamePart;?>'
138 id
='master_from_date_<?php echo $DateNamePart;?>' class="text datepicker"
139 value
="<?php echo attr($_REQUEST["master_from_date_
$DateNamePart"]) ?>"
140 onChange
="SetDateCriteriaCustom('date_master_criteria_<?php echo $DateNamePart;?>');
141 appendOptionDateCriteria('<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]);?>',
142 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];?>',
143 '<?php echo htmlspecialchars(xl('Custom'), ENT_QUOTES); ?>',
144 '<?php echo htmlspecialchars(xl('Custom'), ENT_QUOTES); ?>',
145 ' = ','master_from_date_<?php echo $DateNamePart;?>','master_to_date_<?php echo $DateNamePart;?>',
146 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" /> 
;
150 <td
class='text' align
="right" style
="padding-right:5px">
151 <?php
echo htmlspecialchars(xl('To'), ENT_QUOTES
).':' ?
><input type
='text' size
='7'
152 name
='master_to_date_<?php echo $DateNamePart;?>'
153 id
='master_to_date_<?php echo $DateNamePart;?>' class="text datepicker"
154 value
="<?php echo attr($_REQUEST["master_to_date_
$DateNamePart"]) ?>"
155 onChange
="SetDateCriteriaCustom('date_master_criteria_<?php echo $DateNamePart;?>');
156 appendOptionDateCriteria('<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]);?>',
157 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];?>',
158 '<?php echo htmlspecialchars(xl('Custom'), ENT_QUOTES); ?>',
159 '<?php echo htmlspecialchars(xl('Custom'), ENT_QUOTES); ?>',
160 ' = ','master_from_date_<?php echo $DateNamePart;?>','master_to_date_<?php echo $DateNamePart;?>',
161 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" /> 
;
168 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='query_drop_down') {
169 $array_query_drop_down=BuildArrayForReport($ThisPageSearchCriteriaQueryDropDownMaster[$ThisPageSearchCriteriaQueryDropDown[$ThisPageSearchCriteriaIndex]]);
170 $QueryDropDownNamePart=str_replace('.', '_', $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
172 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
173 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
175 <td
class='text criteria_class2' ><?php
echo text($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]); ?
></td
>
178 <td width
="150" class='text criteria_class2' >
180 <select style
="width:140px;" name
="query_drop_down_master_<?php echo $QueryDropDownNamePart;?>"
181 id
="query_drop_down_master_<?php echo $QueryDropDownNamePart;?>" onchange
="appendOptionRadioCriteria(
182 '<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]) ?>',
183 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.options[this.selectedIndex].text,
184 this.options[this.selectedIndex].value,' = ',
185 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')">
187 <option value
="<?php echo attr($ThisPageSearchCriteriaQueryDropDownDefaultKey[$ThisPageSearchCriteriaIndex]) ?>"
188 ><?php
echo text($ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex]) ?
></option
>
191 foreach ($array_query_drop_down as $array_query_drop_down_key => $array_query_drop_down_value) {
192 if ($_REQUEST["query_drop_down_master_".$QueryDropDownNamePart]==$array_query_drop_down_key) {
193 $Selected=' selected ';
198 <option value
="<?php echo attr($array_query_drop_down_key) ?>" <?php
echo $Selected ?
>
199 ><?php
echo text($array_query_drop_down_value) ?
></option
>
211 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='include') {
212 $IncludeNamePart=str_replace('.', '_', $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
214 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
215 id
="table_<?php echo attr($ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]) ?>" style
="display:none">
217 <td
class='text criteria_class2' ><?php
echo text($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]); ?
></td
>
220 <td width
="150" class='text criteria_class2' ><?php
221 $FunctionName=$ThisPageSearchCriteriaIncludeMaster[$ThisPageSearchCriteriaInclude[$ThisPageSearchCriteriaIndex]];
229 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text' ||
230 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text_like') {
231 $TextNamePart=str_replace('.', '_', $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
232 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text') {
233 $TextSeperator=' = ';
236 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text_like') {
237 $TextSeperator=' like ';
240 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
241 id
="table_<?php echo attr($ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]) ?>" style
="display:none">
243 <td
class='text criteria_class2' ><?php
echo text($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]); ?
></td
>
246 <td width
="150" class='text criteria_class2' ><input type
="text" name
="text_master_<?php echo attr($TextNamePart);?>"
247 id
="text_master_<?php echo attr($TextNamePart);?>" value
="<?php echo attr($_REQUEST["text_master_
$TextNamePart"]) ?>"
248 onkeyup
="appendOptionTextCriteria('<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]) ?>',
249 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.value,this.value,'<?php echo $TextSeperator ?>',
250 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')"
251 onchange
="appendOptionTextCriteria('<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]) ?>',
252 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.value,this.value,'<?php echo $TextSeperator ?>',
253 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')"
254 size
="15" autocomplete
="off" /></td
>
260 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio' ||
261 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like') {
263 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
264 id
="table_<?php echo attr($ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]) ?>" style
="display:none">
266 <td
class='text criteria_class2' width
="150" ><?php
echo text($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]); ?
></td
>
269 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio') {
270 $RadioSeperator=' = ';
273 if ($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like') {
274 $RadioSeperator=' like ';
277 for ($ThisPageSearchCriteriaRadioIndex=0;
278 $ThisPageSearchCriteriaRadioIndex<sizeof($ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex]);
279 $ThisPageSearchCriteriaRadioIndex++
) {
280 $RadioNamePart=str_replace('.', '_', $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
281 if ($_REQUEST["radio_".$RadioNamePart]==
282 $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex]) {
283 $Checked=' checked ';
289 <td
class='text'><input type
="radio" name
="radio_<?php echo attr($RadioNamePart) ?>"
290 id
="radio_<?php echo attr($RadioNamePart.$ThisPageSearchCriteriaRadioIndex) ?>"
291 value
="<?php echo attr($ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex]) ?>"
292 <?php
echo $Checked;?
>
293 onClick
="appendOptionRadioCriteria('<?php echo attr($ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]) ?>',
294 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',
295 '<?php echo attr($ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex]) ?>',
296 '<?php echo $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex] ?>',
297 '<?php echo $RadioSeperator ?>','<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" />
298 <?php
echo text($ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex]) ?
>
316 <td valign
="top"><fieldset style
="border-color:#000000; border-width:1px;padding-left:5px;padding-right:0px;padding-top:0px;padding-bottom:0px;" >
317 <legend
class='text'><b
><?php
echo htmlspecialchars(xl('Current Criteria'), ENT_QUOTES
) ?
></b
></legend
>
318 <table width
="260" border
="0" cellspacing
="0" cellpadding
="0">
320 <td width
="117" class='text'><?php
echo htmlspecialchars(xl('Criteria'), ENT_QUOTES
) ?
></td
>
321 <td width
="118" class='text'><?php
echo htmlspecialchars(xl('Set To'), ENT_QUOTES
) ?
></td
>
322 <td width
="25" class='text'></td
>
325 <td colspan
="2"><select name
='final_this_page_criteria[]' id
='final_this_page_criteria'
326 size
='8' style
="width:235px;" class='text' title
='Criteria' multiple
="multiple" >
328 for ($final_this_page_criteria_index=0; $final_this_page_criteria_index<sizeof($_REQUEST['final_this_page_criteria']);
329 $final_this_page_criteria_index++
) {
331 <option value
="<?php echo attr($_REQUEST['final_this_page_criteria'][$final_this_page_criteria_index]) ?>" >
332 <?php
echo xlt($_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index]) ?
></option
>
338 <select name
='final_this_page_criteria_text[]' id
='final_this_page_criteria_text' style
="display:none" multiple
="multiple" >
340 for ($final_this_page_criteria_index=0; $final_this_page_criteria_index<sizeof($_REQUEST['final_this_page_criteria']);
341 $final_this_page_criteria_index++
) {
343 <option value
="<?php echo attr($_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index]) ?>" >1</option
>
350 <td valign
="top"><a href
="#" onClick
="removeOptionSelected()"><img src
="<?php echo $web_root ?>/interface/pic/Delete.gif" border
="0" /></a
></td
>
356 </table
><?php
//print_r($_REQUEST['final_this_page_criteria']); ?>
357 <!-- ============================================================================================================================================= -->
358 <!-- Criteria section Ends
-->
359 <!-- ============================================================================================================================================= -->