Respected Sir/Madam, As I have previously mentioned that I am unable to run or load the bootstrap and chart in my office system so could please help me to sort the issue.
Thanks in advance and please help me to solve the issue.
errors
Not allowed to load local resource: file:///C:/xampp/htdocs/Cloud%20Clinic/salesreport/koolreport_assets/3409401219/KoolReport.js
Uncaught ReferenceError: KoolReport is not defined
Uncaught ReferenceError: KoolReport is not defined
<?php
require_once "../vendor/koolreport/core/autoload.php";
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
class SalesByCustomer extends \koolreport\KoolReport
{
use \koolreport\clients\bootstrap;
public function settings()
{
return array(
"dataSources"=>array(
"sales"=>array(
"connectionString"=>"mysql:host=localhost;dbname=db_sales",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
)
)
);
}
public function setup()
{
$this->src('sales')
->query("SELECT customerName,dollar_sales FROM customer_product_dollarsales2")
->pipe(new Group(array(
"by"=>"customerName",
"sum"=>"dollar_sales"
)))
->pipe(new Sort(array(
"dollar_sales"=>"desc"
)))
->pipe(new Limit(array(10)))
->pipe($this->dataStore('sales_by_customer'));
}
}
?>
<?php
use \koolreport\widgets\google\BarChart;
use \koolreport\widgets\koolphp\Table;
?>
<div class="report-content">
<div class="text-center">
<h1>Sales By Customer</h1>
<p class="lead">This report shows top 10 sales by customer</p>
</div>
<?php
BarChart::create(array(
"dataStore"=>$this->dataStore('sales_by_customer'),
"width"=>"100%",
"height"=>"500px",
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
"emphasis"=>true
)
),
"options"=>array(
"title"=>"Sales By Customer",
)
));
?>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('sales_by_customer'),
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
)
),
"cssClass"=>array(
"table"=>"table table-bordered table-striped"
)
));
?>
</div>