Hi,
Please assist, getting CSRF token mismatch error by clicking on the chart to drilldown. Here is the code :
class TestDrilldown extends DrillDown
{
protected function levels()
{
return [
Level::create()
->title("All Users")
->widget(
KWidget::create()
->use(\koolreport\widgets\google\ColumnChart::class)
->dataSource(function($params, $scope){
return AutoMaker::rawSQL
("
SELECT
Agent
, SUM(Total) Total
FROM (
....
) A
GROUP BY Agent
")->run();
})
->columns([
"Agent"=>["type"=>"string"],
"Total"=>[
"type"=>"number"
]
])
->settings([
"colorScheme"=>ColorList::random()
])
),
Level::create()
->title(function($params){
return "User ".$params["Agent"];
})
->widget(
KWidget::create()
->use(\koolreport\widgets\google\ColumnChart::class)
->dataSource(function($params, $scope){
return AutoMaker::rawSQL
("
SELECT
DateUpdated
, SUM(Total) Total
FROM (
....
) A
WHERE Total > 0 AND Agent = '".$params["Agent"]."'
GROUP BY DateUpdated
")->run();
})
->columns([
"DateUpdated"=>[
"type"=>"string",
],
"Total"=>[
"type"=>"number",
]
])
->settings([
"colorScheme"=>ColorList::random()
])
)
];
}
}