Hello Kool Team, I tried your multi filter example with my code but getting the following error on top of the parameters.
These are the various code blocks
$query_params = array();
if($this->params["form_id"]!=array())
{
$query_params[":form_id"] = $this->params["form_id"];
}
if($this->params["user_id"]!=array())
{
$query_params[":user_id"] = $this->params["user_id"];
}
$query_params[":start"] = $this->params["startDatePicker"];
$query_params[":end"] = $this->params["endDatePicker"];
$this->src('pace')
->query("
SELECT
a,
b,
c,
d
WHERE 1=1
".(($this->params["form_id"]!=array())?" and a in (:form_id)":"")."
".(($this->params["user_id"]!=array())?" and b in (:user_id)":"")."
AND c>=:start
AND c<=:end
ORDER BY casc
")
->params( $query_params)
->pipe($this->dataStore("result"));
Parameter 1
<div class="col-md-6">
<b>Module</b>
<?php
Select2::create(array(
"multiple"=>true,
"name"=>"form_id",
"dataSource"=>$this->src("pace")->query("
SELECT
b.sys_form_id,
form_label
FROM controller.sys_form b
INNER JOIN task.tasklist a on a.sys_form_id=b.sys_form_id
"),
"dataBind"=>array(
"text"=>"form_label",
"value"=>"sys_form_id"
),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</div>
Parameter 2
<div class="col-md-6">
<b>Users</b>
<?php
Select2::create(array(
"multiple"=>true,
"name"=>"user_id",
"dataSource"=>$this->
src("pace")->query("
SELECT distinct
sys_users_id, concat(b.firstname,' ',b.lastname) as user
FROM task.tasklist a
INNER JOIN controller.sys_users b on b.sys_users_id=a.assigned_user_id"
.(($this->params["form_id"]!=array())? "" : "
WHERE a.sys_form_id in (:form_id)")."
")
->params($this->params["form_id"]!=array() ?
array(":form_id"=>$this->params["form_id"]): array()
),
"dataBind"=>array(
"text"=>"user",
"value"=>"sys_users_id"
),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</div>
Paramter 4 and 5
<div class="col-md-6">
<b>From Date:</b>
<?php
DateTimePicker::create(array(
"name"=>"startDatePicker",
"maxDate"=>"@endDatePicker",
"format"=>"MM/DD/YYYY HH:mm",
"themeBase"=>"bs3",
));
?>
</div>
<div class="col-md-6">
<b>To Date:</b>
<?php
DateTimePicker::create(array(
"name"=>"endDatePicker",
"minDate"=>"@startDatePicker",
"format"=>"MM/DD/YYYY HH:mm",
"themeBase"=>"bs3",
));
?>
</div>