This error message appears when I load the file. for the first time. However, when I click on the submit button the error disappears. Please any solution.
This is my view file:
<?php
use \koolreport\widgets\google\ColumnChart;
use \koolreport\widgets\koolphp\Table;
use \koolreport\inputs\Select2;
?> <div class="report-content"> <?php $years = $_POST["years"]; if (is_array($years)) $years = implode(", ", $years); $Mineral_Type = $_POST["Mineral_Type"]; $pdfTitle = $Mineral_Type. " in ".$years . " "; ?>
<div class="text-center">
<h3>Mineral Production in Quantities and Value US$ for <?php echo $pdfTitle ?></h3>
</div>
<form method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<b>Select Years</b>
<?php
Select2::create(array(
"multiple"=>true,
"name"=>"years",
"dataSource"=>$this->src("data")->query("
select YEAR(Date_Produced) as 'Year'
from minerals_production
group by Year
"),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</div>
<div class="form-group">
<b>Select Minerals Type</b>
<?php
Select2::create(array(
"multiple"=>false,
"name"=>"Mineral_Type",
"dataSource"=>$this->src("data")->query("
select Mineral_Type
from minerals_production
Group by Mineral_Type")
/* oin orderdetails on orders.orderNumber = orderdetails.orderNumber
join products on products.productCode = orderdetails.productCode
".( $this->params["years"]!=array() ?"where YEAR(orderDate) in (:years)":"")."
group by productLine */
->params(
$this->params["years"]!=array()?
array(":years"=>$this->params["years"]):
array()
),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</div>
<div class="form-group">
<button class="btn btn-primary">Submit</button>
<button formaction="exportMyReportQuan.php" class="btn btn-primary">Download PDF</button>
</div>
</div>
</div>
</div>
</form>
<?php
/* Table::create(array(
"dataSource"=>$this->dataStore("orders"),
"columns"=>array(
"Year"=>array(
"type"=>"date",
"label"=>"Year"
),
"Mineral_Type"=>array(
"label"=>"Minerals"
),
"Qty_Produced"=>array(
"type"=>"number",
"label"=>"Quantity",
// "prefix"=>"$",
"emphasis"=>true
),
"Qty_Produced"=>array(
"type"=>"number",
"label"=>"Quantity",
// "prefix"=>"$",
"emphasis"=>true
),
"Min_Value"=>array(
"type"=>"number",
"label"=>"Value US$",
//"prefix"=>"$",
"emphasis"=>true
)
),
"grouping"=>array(
// "Year",
// "Mineral_Type"
),
"paging"=>array(
"pageSize"=>25
),
"cssClass"=>array(
"table"=>"table-bordered"
)
)); */
?>
<i class="fa fa-arrow-down" style="font-size:24px;"></i>
<i class="fa fa-arrow-down" style="font-size:24px;"></i>
<div style="margin-top:20px;">
<?php
Table::create(array(
"dataSource"=>$this->dataStore("result"),
"columns"=>array(
"Year"=>array(
"type"=>"date",
"label"=>"Year"
),
"Mineral_Type"=>array(
"label"=>"Minerals"
),
"Qty_Produced"=>array(
"type"=>"number",
"label"=>"Quantity",
// "prefix"=>"$",
"emphasis"=>true
),
"Qty_Produced"=>array(
"type"=>"number",
"label"=>"Quantity",
// "prefix"=>"$",
"emphasis"=>true
),
"Min_Value"=>array(
"type"=>"number",
"label"=>"Value US$",
//"prefix"=>"$",
"emphasis"=>true
)
),
"cssClass"=>array(
"table"=>"table-bordered table-striped table-hover"
)
));
?>
</div>
<?php
ColumnChart::create(array(
"title"=>"Minerals Produced By Quantity and Value in US$",
"dataStore"=>$this->dataStore('result'),
"width"=>"100%",
"height"=>"500px",
"columns"=>array(
/* "Mineral_Type"=>array(
"label"=>"Minerals"
), */
"Year"=>array(
"type"=>"date",
"label"=>"Year"
),
"Qty_Produced"=>array(
"type"=>"number",
"label"=>"Quantity",
// "prefix"=>"$",
"emphasis"=>true
),
"Min_Value"=>array(
"type"=>"number",
"label"=>"Value US$",
//"prefix"=>"$",
"emphasis"=>true
),
)
// "options"=>array(
// "title"=>"Minerals Produced By Quantity",
// )
));
?>
</div>