PHP Classes

PHP MySQLi Bootstrap Reports: Display results of database queries with Bootstrap

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 452 All time: 6,164 This week: 455Up
Version License PHP version Categories
bsreports 1.0.0GNU General Publi...5HTML, PHP 5, Databases
Description 

Author

This class can display results of database queries with Bootstrap.

It can take a result set handle returned from a database query perform using the MySQLi extension and displays it on a HTML table.

The class returns HTML of a table with the results with a title at the top and footer message at the bottom. The table headers are retrieved from the result set field names.

The table is rendered with Bootstrap CSS styles but several attributes may be configured like the header cell and text color, regular cell and text color, table width, etc..

Picture of Rajesh Kakkad
  Performance   Level  
Name: Rajesh Kakkad <contact>
Classes: 2 packages by
Country: India India
Age: 68
All time rank: 2950184 in India India
Week rank: 288 Up26 in India India Up

Example

<!DOCTYPE html>
<html>
<head>
<title>My Report</title>
    <meta charset="utf-8">
<? include "addbslocal.php" ?>
</head>
<body>
<?
   
include_once("phpBSReports.php");
   
$rpt = new phpReport();
 
$rpt->width = "95%";
   
$rpt->header_color = "#4477ff";
   
$rpt->header_textcolor="#ffffff";
 
$rpt->header_alignment="center";
   
$rpt->body_alignment = "left";
   
$rpt->body_color = "#ffeeee";
   
$rpt->body_textcolor = "#991199";
 
$rpt->covered_color="#449999";
   
$rpt->covered = '1';
 
$rpt->striped='1';
 
$rpt->bordered='1';
 
$rpt->hover='1';
 
$rpt->responsive='0';
 
$rpt->inverse='1';
 
$rpt->condensed='1';
   
$rpt->title = "SMS Groups";
 
$rpt->footer="Generated on :".date("d-M-Y");

$con = mysqli_connect("localhost","my_user","my_password","my_db");
//use above code with your database details or include connection file db2.php
//change its values to match your database

//include "db2.php"; //code which makes mysqli connection

include "addjqlocal.php";
echo
'<div class="firstdiv" align="center">';
   
$res = mysqli_query($con,"select * from msgq");
   
$rpt->mysqli_res = $res;
   
$rpt->showReport();
   
?>
</div>
</body>
</html>


Screenshots  
  • bsreport1.jpg
  • bsreport3.jpg
  Files folder image Files  
File Role Description
Accessible without login Plain text file addbslocal.php Data for including BS files
Accessible without login Plain text file addjqlocal.php Data for adding jQuery files
Accessible without login Plain text file bootstrap.min.css Data Bootstrap CSS file
Accessible without login Plain text file bootstrap.min.js Data Bootstrap JS file
Accessible without login Plain text file jquery-ui.css Data jQuery UI css
Accessible without login Plain text file jquery-ui.min.js Data jQuery UI JS file
Accessible without login Plain text file jquery.min.js Data jQuery JS file
Plain text file phpBSReports.php Class php Bootstrap Report Class
Accessible without login Plain text file samplereport.php Example Sample report example file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:452
This week:0
All time:6,164
This week:455Up