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=split(',',$ThisPageSearchCriteriaDisplayMaster);
48 $ThisPageSearchCriteriaKey=split(',',$ThisPageSearchCriteriaKeyMaster);
49 $ThisPageSearchCriteriaDataType=split(',',$ThisPageSearchCriteriaDataTypeMaster);
50 //Putting htmlspecialchars.
51 foreach($ThisPageSearchCriteriaDisplay as $HtmlspecialcharsKey => $HtmlspecialcharsValue)
53 $ThisPageSearchCriteriaDisplay[$HtmlspecialcharsKey]=htmlspecialchars( xl($HtmlspecialcharsValue), ENT_QUOTES
);
55 //--------------------------------------------------------------
56 //Filling the input array.
57 $NumberOfRadioThisPageSearchCriteria=0;
58 $NumberOfQueryDropDownThisPageSearchCriteria=0;
59 $NumberOfIncludeThisPageSearchCriteria=0;
60 for($ThisPageSearchCriteriaIndex=0;$ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaDataType);$ThisPageSearchCriteriaIndex++
)
62 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio' ||
$ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like')
64 $NumberOfRadioThisPageSearchCriteria++
;
65 $ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex]=split(',',$ThisPageSearchCriteriaDisplayRadioMaster[$NumberOfRadioThisPageSearchCriteria]);
66 $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex]=split(',',$ThisPageSearchCriteriaRadioKeyMaster[$NumberOfRadioThisPageSearchCriteria]);
68 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='query_drop_down')
70 $NumberOfQueryDropDownThisPageSearchCriteria++
;
71 $ThisPageSearchCriteriaQueryDropDown[$ThisPageSearchCriteriaIndex]=$NumberOfQueryDropDownThisPageSearchCriteria;
72 $ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex]=
73 $ThisPageSearchCriteriaQueryDropDownMasterDefault[$NumberOfQueryDropDownThisPageSearchCriteria];
74 $ThisPageSearchCriteriaQueryDropDownDefaultKey[$ThisPageSearchCriteriaIndex]=
75 $ThisPageSearchCriteriaQueryDropDownMasterDefaultKey[$NumberOfQueryDropDownThisPageSearchCriteria];
77 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='include')
79 $NumberOfIncludeThisPageSearchCriteria++
;
80 $ThisPageSearchCriteriaInclude[$ThisPageSearchCriteriaIndex]=$NumberOfIncludeThisPageSearchCriteria;
83 //Putting htmlspecialchars.
84 for($ThisPageSearchCriteriaIndex=0;$ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaDataType);$ThisPageSearchCriteriaIndex++
)
86 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio' ||
$ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like')
88 foreach($ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex] as $HtmlspecialcharsKey => $HtmlspecialcharsValue)
90 $ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex][$HtmlspecialcharsKey]=htmlspecialchars( xl($HtmlspecialcharsValue), ENT_QUOTES
);
93 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='query_drop_down')
95 $ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex]=htmlspecialchars( xl(
96 $ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex]), ENT_QUOTES
);
99 //------------------------------------------------------------------------------
101 <table width
="560" border
="0" cellspacing
="0" cellpadding
="0" >
103 <td
><fieldset style
="border-color:#000000; border-width:1px;padding-left:5px;padding-right:0px;padding-top:0px;padding-bottom:0px;" >
104 <legend
class='text'><b
><?php
echo htmlspecialchars( xl('Choose Criteria'), ENT_QUOTES
) ?
></b
></legend
>
105 <table width
="290" border
="0" cellspacing
="0" cellpadding
="0">
107 <td
class='text'><?php
echo htmlspecialchars( xl('Criteria'), ENT_QUOTES
) ?
></td
>
112 <select name
="choose_this_page_criteria" id
="choose_this_page_criteria" title
="Choose Criteria"
113 class="text" style
="width:140px;" onChange
="CriteriaVisible()" size
='8' >
115 for ($ThisPageSearchCriteriaIndex=0;$ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaKey);$ThisPageSearchCriteriaIndex++
)
117 $optionValue = $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];
118 echo "<option value='$optionValue'";
119 $optionLabel = $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex];
120 echo ">$optionLabel</option>\n";
125 <td width
="150" valign
="top">
126 <!-- Below section comes
as per the defined criteria arrays
.Initially all are hidden
.As per the click the corresponding items gets visible
. -->
128 for ($ThisPageSearchCriteriaIndex=0;$ThisPageSearchCriteriaIndex<sizeof($ThisPageSearchCriteriaKey);$ThisPageSearchCriteriaIndex++
)
130 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='date' ||
131 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='datetime')
133 $DateNamePart=str_replace('.','_',$ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
135 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
136 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
138 <td
class='text criteria_class2' ><?php
echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]; ?
></td
>
141 <td width
="150" class='text criteria_class2' ><?php
echo generate_select_list("date_master_criteria_$DateNamePart",
142 "date_master_criteria", $_REQUEST["date_master_criteria_$DateNamePart"],
143 "Date Criteria","","text criteria_class1",
144 'calendar_function(this.value,"master_from_date_'.$DateNamePart.'","master_to_date_'.$DateNamePart.'");
145 appendOptionDateCriteria("'.$ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex].'","'.
146 $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex].'",this.options[this.selectedIndex].text,'.
147 'this.options[this.selectedIndex].value," = ","master_from_date_'.$DateNamePart.'","master_to_date_'.$DateNamePart.'",
148 "'.$ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex].'")');?
>
152 <td
class='text' align
="right" style
="padding-right:5px;padding-bottom:2px;padding-top:2px">
153 <?php
echo htmlspecialchars( xl('From'), ENT_QUOTES
).':' ?
><input type
='text' size
='7'
154 name
='master_from_date_<?php echo $DateNamePart;?>'
155 id
='master_from_date_<?php echo $DateNamePart;?>' class="text " readonly
=""
156 value
="<?php echo $_REQUEST["master_from_date_
$DateNamePart"] ?>"
157 onChange
="SetDateCriteriaCustom('date_master_criteria_<?php echo $DateNamePart;?>');
158 appendOptionDateCriteria('<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex];?>',
159 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];?>',
160 '<?php echo htmlspecialchars( xl('Custom'), ENT_QUOTES); ?>',
161 '<?php echo htmlspecialchars( xl('Custom'), ENT_QUOTES); ?>',
162 ' = ','master_from_date_<?php echo $DateNamePart;?>','master_to_date_<?php echo $DateNamePart;?>',
163 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" /> 
;
164 <img src
="<?php echo $web_root ?>/interface/main/calendar/modules/PostCalendar/pntemplates/default/images/new.jpg"
165 align
="texttop" id
='img_master_fromdate_<?php echo $DateNamePart;?>' border
='0' alt
='[?]' style
='cursor:pointer'
166 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' />
168 Calendar
.setup({inputField
:"master_from_date_<?php echo $DateNamePart;?>", ifFormat
:"%Y-%m-%d", button
:"img_master_fromdate_<?php echo $DateNamePart;?>"});
173 <td
class='text' align
="right" style
="padding-right:5px">
174 <?php
echo htmlspecialchars( xl('To'), ENT_QUOTES
).':' ?
><input type
='text' size
='7'
175 name
='master_to_date_<?php echo $DateNamePart;?>'
176 id
='master_to_date_<?php echo $DateNamePart;?>' class="text " readonly
=""
177 value
="<?php echo $_REQUEST["master_to_date_
$DateNamePart"] ?>"
178 onChange
="SetDateCriteriaCustom('date_master_criteria_<?php echo $DateNamePart;?>');
179 appendOptionDateCriteria('<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex];?>',
180 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex];?>',
181 '<?php echo htmlspecialchars( xl('Custom'), ENT_QUOTES); ?>',
182 '<?php echo htmlspecialchars( xl('Custom'), ENT_QUOTES); ?>',
183 ' = ','master_from_date_<?php echo $DateNamePart;?>','master_to_date_<?php echo $DateNamePart;?>',
184 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" /> 
;
185 <img src
="<?php echo $web_root ?>/interface/main/calendar/modules/PostCalendar/pntemplates/default/images/new.jpg"
186 align
="texttop" id
='img_master_todate_<?php echo $DateNamePart;?>' border
='0' alt
='[?]' style
='cursor:pointer'
187 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' />
189 Calendar
.setup({inputField
:"master_to_date_<?php echo $DateNamePart;?>", ifFormat
:"%Y-%m-%d", button
:"img_master_todate_<?php echo $DateNamePart;?>"});
196 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='query_drop_down')
198 $array_query_drop_down=BuildArrayForReport($ThisPageSearchCriteriaQueryDropDownMaster[$ThisPageSearchCriteriaQueryDropDown[$ThisPageSearchCriteriaIndex]]);
199 $QueryDropDownNamePart=str_replace('.','_',$ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
201 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
202 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
204 <td
class='text criteria_class2' ><?php
echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]; ?
></td
>
207 <td width
="150" class='text criteria_class2' >
209 <select style
="width:140px;" name
="query_drop_down_master_<?php echo $QueryDropDownNamePart;?>"
210 id
="query_drop_down_master_<?php echo $QueryDropDownNamePart;?>" onchange
="appendOptionRadioCriteria(
211 '<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex] ?>',
212 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.options[this.selectedIndex].text,
213 this.options[this.selectedIndex].value,' = ',
214 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')">
216 <option value
="<?php echo $ThisPageSearchCriteriaQueryDropDownDefaultKey[$ThisPageSearchCriteriaIndex] ?>"
217 ><?php
echo $ThisPageSearchCriteriaQueryDropDownDefault[$ThisPageSearchCriteriaIndex] ?
></option
>
220 foreach($array_query_drop_down as $array_query_drop_down_key => $array_query_drop_down_value)
222 if($_REQUEST["query_drop_down_master_".$QueryDropDownNamePart]==$array_query_drop_down_key)
223 $Selected=' selected ';
227 <option value
="<?php echo $array_query_drop_down_key ?>" <?php
echo $Selected ?
>
228 ><?php
echo $array_query_drop_down_value ?
></option
>
239 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='include')
241 $IncludeNamePart=str_replace('.','_',$ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
243 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
244 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
246 <td
class='text criteria_class2' ><?php
echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]; ?
></td
>
249 <td width
="150" class='text criteria_class2' ><?php
250 $FunctionName=$ThisPageSearchCriteriaIncludeMaster[$ThisPageSearchCriteriaInclude[$ThisPageSearchCriteriaIndex]];
257 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text' ||
258 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text_like')
260 $TextNamePart=str_replace('.','_',$ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
261 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text')
263 $TextSeperator=' = ';
265 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='text_like')
267 $TextSeperator=' like ';
270 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
271 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
273 <td
class='text criteria_class2' ><?php
echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]; ?
></td
>
276 <td width
="150" class='text criteria_class2' ><input type
="text" name
="text_master_<?php echo $TextNamePart;?>"
277 id
="text_master_<?php echo $TextNamePart;?>" value
="<?php echo $_REQUEST["text_master_
$TextNamePart"] ?>"
278 onkeyup
="appendOptionTextCriteria('<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex] ?>',
279 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.value,this.value,'<?php echo $TextSeperator ?>',
280 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')"
281 onchange
="appendOptionTextCriteria('<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex] ?>',
282 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',this.value,this.value,'<?php echo $TextSeperator ?>',
283 '<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')"
284 size
="15" autocomplete
="off" /></td
>
289 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio' ||
290 $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like')
293 <table width
="150" border
="0" cellspacing
="0" cellpadding
="0"
294 id
="table_<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>" style
="display:none">
296 <td
class='text criteria_class2' width
="150" ><?php
echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex]; ?
></td
>
299 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio')
301 $RadioSeperator=' = ';
303 if($ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex]=='radio_like')
305 $RadioSeperator=' like ';
307 for ($ThisPageSearchCriteriaRadioIndex=0;
308 $ThisPageSearchCriteriaRadioIndex<sizeof($ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex]);
309 $ThisPageSearchCriteriaRadioIndex++
)
311 $RadioNamePart=str_replace('.','_',$ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex]);
312 if($_REQUEST["radio_".$RadioNamePart]==
313 $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex])
314 $Checked=' checked ';
319 <td
class='text'><input type
="radio" name
="radio_<?php echo $RadioNamePart ?>"
320 id
="radio_<?php echo $RadioNamePart.$ThisPageSearchCriteriaRadioIndex ?>"
321 value
="<?php echo $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex] ?>"
322 <?php
echo $Checked;?
>
323 onClick
="appendOptionRadioCriteria('<?php echo $ThisPageSearchCriteriaDisplay[$ThisPageSearchCriteriaIndex] ?>',
324 '<?php echo $ThisPageSearchCriteriaKey[$ThisPageSearchCriteriaIndex] ?>',
325 '<?php echo $ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex] ?>',
326 '<?php echo $ThisPageSearchCriteriaRadioKey[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex] ?>',
327 '<?php echo $RadioSeperator ?>','<?php echo $ThisPageSearchCriteriaDataType[$ThisPageSearchCriteriaIndex] ?>')" />
328 <?php
echo $ThisPageSearchCriteriaDisplayRadio[$ThisPageSearchCriteriaIndex][$ThisPageSearchCriteriaRadioIndex] ?
>
346 <td valign
="top"><fieldset style
="border-color:#000000; border-width:1px;padding-left:5px;padding-right:0px;padding-top:0px;padding-bottom:0px;" >
347 <legend
class='text'><b
><?php
echo htmlspecialchars( xl('Current Criteria'), ENT_QUOTES
) ?
></b
></legend
>
348 <table width
="260" border
="0" cellspacing
="0" cellpadding
="0">
350 <td width
="117" class='text'><?php
echo htmlspecialchars( xl('Criteria'), ENT_QUOTES
) ?
></td
>
351 <td width
="118" class='text'><?php
echo htmlspecialchars( xl('Set To'), ENT_QUOTES
) ?
></td
>
352 <td width
="25" class='text'></td
>
355 <td colspan
="2"><select name
='final_this_page_criteria[]' id
='final_this_page_criteria'
356 size
='8' style
="width:235px;" class='text' title
='Criteria' multiple
="multiple" >
358 for($final_this_page_criteria_index=0;$final_this_page_criteria_index<sizeof($_REQUEST['final_this_page_criteria']);
359 $final_this_page_criteria_index++
)
362 <option value
="<?php echo $_REQUEST['final_this_page_criteria'][$final_this_page_criteria_index] ?>" >
363 <?php
echo $_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index] ?
></option
>
369 <select name
='final_this_page_criteria_text[]' id
='final_this_page_criteria_text' style
="display:none" multiple
="multiple" >
371 for($final_this_page_criteria_index=0;$final_this_page_criteria_index<sizeof($_REQUEST['final_this_page_criteria']);
372 $final_this_page_criteria_index++
)
375 <option value
="<?php echo $_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index] ?>" >1</option
>
382 <td valign
="top"><a href
="#" onClick
="removeOptionSelected()"><img src
="<?php echo $web_root ?>/interface/pic/Delete.gif" border
="0" /></a
></td
>
388 </table
><?php
//print_r($_REQUEST['final_this_page_criteria']); ?>
389 <!-- ============================================================================================================================================= -->
390 <!-- Criteria section Ends
-->
391 <!-- ============================================================================================================================================= -->