Hello Guys,
I'm trying to create an advanced search function for my users. The idea is simple, the can combine 2 listboxes an 2 textboxes (with dates) to filter a list of reports.
This is how it goes:
“I'd like to see all reports from <<lstUsers>> for the <<lstPatients>> that were entered between <<dttStartDate>> and <<enddate>>”
Creating the above is no problem. However how do I create the logic behind it.
this is my first try:
bc.
<?php
$QQfilterClause = array();
if($this->lstFilterPatients->SelectedValue !== null){
array_push($QQfilterClause,QQ::Equal(QQN::Vpc()->PatientID,$this->lstFilterPatients->SelectedValue));
}
if($this->lstFilterUsers->SelectedValue !== null){
array_push($QQfilterClause,QQ::Equal(QQN::Vpc()->CreatedBy,$this->lstFilterUsers->SelectedValue));
}
/*
* Start and endtime
*
*/
$arrDateParts = explode('.',$this->dttFilterStartTime->Text);
$dttFilterStartDate = new QDateTime(QDateTime::Now);
$dttFilterStartDate->setDate($arrDateParts[2], $arrDateParts[1], $arrDateParts[0]);
$arrDateParts = explode('.',$this->dttFilterEndTime->Text);
$dttFilterEndDate = new QDateTime(QDateTime::Now);
$dttFilterEndDate->setDate($arrDateParts[2], $arrDateParts[1], $arrDateParts[0]);
array_push($QQfilterClause,QQ::GreaterOrEqual(QQN::Vpc()->VpcDate, $dttFilterStartDate));
array_push($QQfilterClause,QQ::LessOrEqual(QQN::Vpc()->VpcDate, $dttFilterEndDate));
$arrVpcs = Vpc::QueryArray($QQfilterClause);
$this->dtgVpcs->DataSource =$arrVpcs;
$this->dtgVpcs->Refresh();
?>
.bc
The QueryArry doesn't accept the array with the conditions.
Any help is most appreciated