0% found this document useful (0 votes)
46 views2 pages

Guide For Activity No. 2

This document provides instructions for generating reports from a database in graphical form using data dashboards. It involves 8 steps: downloading and extracting data dashboard files, configuring the database connection, and modifying PHP files to reference the correct field names from specific database tables for sales, customer, supplier, and product stock reports. The PHP files will need to be edited to replace field names with the actual names from tables in the learner's database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

Guide For Activity No. 2

This document provides instructions for generating reports from a database in graphical form using data dashboards. It involves 8 steps: downloading and extracting data dashboard files, configuring the database connection, and modifying PHP files to reference the correct field names from specific database tables for sales, customer, supplier, and product stock reports. The PHP files will need to be edited to replace field names with the actual names from tables in the learner's database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ELECTIVE 3 – Activity No.

2
Data Dashboard: Generation of Reports in Graphical Representation

REQUIREMENTS:
1. Installed XAMPP
2. Sublime Text 3 (Text Editor)/ any available text editor
3. Browser (Google or Mozilla Firefox)
4. Internet Connectivity
NOTE: Make it sure that you have done working with Activity #1 with sample records inserted in
your Database Tables.

DO THE FOLLOWING STEPS:

STEP 1: Download the file folder Data Dashboard. Copy and paste it in the C:/xampp/htdocs
folder.

STEP 2: Extract the file.

STEP 3: Open dbconn.php using Sublime Text Editor or any text editor, it contains connections
from your database. Make it sure you created a database name scm_project.

STEP 4: Open index.php in the browser. Take Note: every time you have changes in your php files,
always reload your browser to see the result/output.

STEP 5: Open salesreport.php using text editor. See the line of codes below in the
salesreport.php, change/replace the following fieldnames (in bold text) based on your actual
fieldnames in your database table name “tbl_orders”.

Note: The Data Type of your fieldname dateordered should be DATE.

$query = "SELECT total_amount, dateplaced, SUM(total_amount) as number FROM tbl_orders


GROUP BY dateplaced ORDER BY orderid ASC";

echo "['".date("F d, Y", strtotime($row["dateplaced"]))."', ".$row["number"]."],";

STEP 6: Open numberofcustomers.php using text editor. See the line of codes below in the
numberofcustomers.php, change/replace the following fieldnames (in bold text) based on your
actual fieldnames in your database table name “tbl_customers”.

$query = "SELECT lname, gender, count(*) as number FROM tbl_customers GROUP BY gender ORDER
BY customerid ASC";
STEP 7: Open numberofsuppliers.php using text editor. See the line of codes below in the
numberofsuppliers.php, change/replace the following fieldnames (in bold text) based on your
actual fieldnames in your database table name “tbl_suppliers”.

$query = "SELECT lname, count(*) as number FROM tbl_suppliers ORDER BY supplierid ASC";

STEP 8: Open productstockreports.php using text editor. See the line of codes below in the
productstockreports.php, change/replace the following fieldnames (in bold text) based on your
actual fieldnames in your database table name “tbl_products and tbl_product_category”.

$query = "SELECT productname, category_name, item_avail, SUM(item_avail) as number FROM


tblproducts LEFT JOIN tblproduct_category ON tblproduct_category.prodcatid=tblproducts.prodcatid
GROUP BY item_avail ORDER BY productid ASC";

echo "['".$row["category_name"]."', ".$row["number"]."],";

You might also like