Dear Team, In my report I am able to display the data with with single option when selected but the thing is that I am unable to load the data when multiple options are selected. Please help me.
businessreport.view.php
`
<?php
use \koolreport\inputs\DateRangePicker;
use \koolreport\widgets\koolphp\Table;
use \koolreport\inputs\MultiSelect;
use \koolreport\inputs\BSelect;
?> <style>
.calendar.left .daterangepicker_input,
.calendar.right .daterangepicker_input {
display: none;
}
</style> <div class="report-content">
<div class="text-center">
<h2>Business Data</h2>
<p class="lead">
</p>
</div>
<form method="post">
<div class="row" style="text-align:center;">
<div class="col-md-3 form-group" style="margin:auto 39%">
<strong>Select Date</strong><br><br>
<?php
DateRangePicker::create(array(
"name"=>"dateRange",
));
?>
<div class="form-group" style="margin-top:30px;text-align:center;">
<button class="btn btn-lg btn-primary">Submit</button>
</div>
<!-- <pre><code><?php echo json_encode($this->params,JSON_PRETTY_PRINT) ?></code></pre> -->
</form>
</div>
</div>
<?php
if($this->dataStore("result")->countData()>0)
{
Table::create(array(
"dataStore"=>$this->dataStore("result"),
//"removeDuplicate"=>array("customerName","orderNumber"),
"cssClass"=>array(
"table"=>"table table-bordered"
),
"columns"=>array(
"brnchName"=>array(
"label"=>"brnchName",
),
"custName"=>array(
"label"=>"Patitent Name",
),
"custVisitedDate"=>array(
"label"=>"VisitedDate",
"formatValue"=>function($VisitedDate){
if($VisitedDate=='0')
{
return "null";
}
return $VisitedDate;
}
),
"custVistId"=>array(
"label"=>"VisitID",
"formatValue"=>function($VisitID){
if($VisitID=='0')
{
return "null";
}
return $VisitID;
}
),
"custRegisteredDate"=>array(
"label"=>"RegistratedDate",
"formatValue"=>function($RegistratedDate){
if($RegistratedDate=='0')
{
return "null";
}
return $RegistratedDate;
}
),
"custRegistrationId"=>array(
"label"=>"RegistrationID",
"formatValue"=>function($RegistrationID){
if($RegistrationID=='0')
{
return "null";
}
return $RegistrationID;
}
),
"custConsultedDate"=>array(
"label"=>"ConsultedDate",
"formatValue"=>function($ConsultedDate){
if($ConsultedDate=='0')
{
return "null";
}
return $ConsultedDate;
}
),
),
"paging"=>array(
"pageSize"=>10
),
));
}
else
{
?>
<!-- <div class="alert alert-warning">
<i class="glyphicon glyphicon-info-sign"></i> Sorry, we found no data
</div> -->
<?php
}
?>
</div>
`
businessreport.php
<?php
require_once "../vendor/koolreport_pro-5.0.4/examples/load.koolreport.php";
class businessreport extends \koolreport\KoolReport
{
use \koolreport\clients\bootstrap;
use \koolreport\inputs\Bindable;
use \koolreport\inputs\POSTBinding;
protected function defaultParamValues()
{
return array(
"dateRange"=>array(
date("Y-m-d"),
date("Y-m-d")
),
"tblcustomerenquiries"=>array(),
"brnchName"=>null,
);
}
protected function bindParamsToInputs()
{
return array(
"dateRange"=>"dateRange",
"tblcustomerenquiries"=>"tblcustomerenquiries",
"brnchName"=>"brnchName",
);
}
protected function setup()
{
$this->src("cloudkli_demo")->query("
SELECT
tb.brnchName,
ce.custName,
ce.custAppointmentDate,
ce.custVisitedDate,
ce.custVistId,
ce.custRegisteredDate,
ce.custRegistrationId,
ce.custConsultedDate
FROM
tblcustomerenquiries ce
LEFT JOIN tblbranch tb ON ce.custBranchId = tb.brnchId
WHERE
tb.brnchName=:brnchName
AND
tb.brnchName=:brnchName
AND
custCreatedDate >= :start
AND
custCreatedDate <= :end
")
->params(array(
":start"=>$this->params["dateRange"][0],
":end"=>$this->params["dateRange"][1],
":tblcustomerenquiries"=>$this->params["tblcustomerenquiries"],
":brnchName"=>$this->params["brnchName"]
))
//->pipe($this->dataStore("tblcustomerenquiries"));
->pipe($this->dataStore("result"));
$this->src("cloudkli_demo")->query("
SELECT
brnchId,
brnchName
FROM
tblbranch
GROUP BY brnchId
")
->pipe($this->dataStore("tblbranch"));
}
}