Академический Документы
Профессиональный Документы
Культура Документы
Topics
Introduction .................................................................................................................................. 2
Reports ......................................................................................................................................... 2
Report Examples .................................................................................................................................... 2
Creating Look Up methods............................................................................................................. 4
Query Feature ............................................................................................................................... 5
Learning Objectives
m
er as
co
At the end of the module the student is expected to:
eH w
o.
1. Understand and apply the reports in Codeigniter
rs e
ou urc
2. Illustrate examples of reports in code igniter
Introduction
Reports
A report is a formatted result of database queries and contain useful data for decision making
and analysis. A report module is typically a back-end web page that contains various figures of
interpreted database table records. A single report page runs a back-end database query and displays
the information in organized and informational manner. It mainly handle and execute records of system
m
Report Examples
er as
co
eH w
The figure below contains link for different types of reports about Student Enrolment.
o.
rs e
ou urc
o
aC s
vi y re
Enrolment Summary encompasses numerical figures and percentages about the enrollment. It is
only a product of different executed queries against the database compiled and organized properly on a
single page.
m
er as
co
eH w
o.
rs e
ou urc
o
The Enrolled Students List report page displays all enrolled students. This page only performs a
aC s
vi y re
single query that selects student records that is currently enrolled in the present term and school year.
The Enrolled Students List report page displays all enrolled students. This page only performs a
single query that selects student records that is NOT officially enrolled in the present term and school
year. This happens when a student is registered but not paid on tuition fees or dues.
Look Up methods is very useful on getting pieces of data, one at a time particularly on multiple
tables and databases. It is used when you only want to select or display a record or two.
Look Up method is a great way to get a single field value from a table.
Where:
m
er as
$table – look up table name
co
$field – look up field that is used in “where” clause of the query builder function
eH w
$key – look up field value that is used for the “where clause” in selecting specific record to be
o.
returned.
rs e
ou urc
$return – the field value of the selected record that you want to return.
Code:
o
aC s
vi y re
ed d
ar stu
sh is
Th
Controller Usage:
In the Report controller, display_firstname method accepts a student id parameter and display
the firstname returned by the r_value lookup method.
m
er as
Interprets:
co
select * from students where stud_id = ‘$stud_id’
eH w
o.
Table rs e Field Key
ou urc
Query Feature
o
aC s
vi y re
Queries (the module) are templates for reports. When you run a query, a report is the output.
From the word itself, query is a question you define and retrieves the generated data.
A query module contains a form that will pass parameters to the controller suggesting on how
ed d
We have already have an enrolled students summary report. And now, we want a criteria within
this report. Using query, we can apply criteria or questions like: Whose students are enrolled between
dates, students enrolled in the last 7 days, or displaying enrolled students by course.
sh is
This form requires start date and end date as a parameter in viewing the report.
m
Enrolled Students Query Report
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d