You can try KoolReport .
Disclaimer: I am working on this project.
This is a frame framework, exactly what you are looking for. You can download the framework via the website, the clone project from github, or use the composer to install: composer require koolphp/koolreport .
After installation, here is a basic example of creating a sales report
index.php : This is a bootstrap file
<?php require_once "SalesByCustomer.php"; $salesByCustomer = new SalesByCustomer; $salesByCustomer->run()->render();
SaleByCustomer.php : this file defines the connection and data transfer process
<?php require_once "koolreport/autoload.php"; use \koolreport\processes\Group; use \koolreport\processes\Limit; use \koolreport\processes\Sort; class SalesByCustomer extends \koolreport\KoolReport { 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_dollarsales") ->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')); } }
SalesByCustomer.view.php : this view file in which you can visualize data
<?php use \koolreport\widgets\koolphp\Table; use \koolreport\widgets\google\BarChart; ?> <div class="text-center"> <h1>Sales Report</h1> <h4>This report shows top 10 sales by customer</h4> </div> <hr/> <?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"=>"$", ) ), "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-hover table-bordered" ) )); ?>
And here is the result .
In principle, you can simultaneously receive data from many data sources, translate them through processes, and then save the result in a data warehouse. Then the data in the data warehouse will be available in the view for visualization. Google charts are integrated inside the frame, so you can immediately use beautiful charts and graphs.
Ok, here are some good links:
Hope this helps.