Вы находитесь на странице: 1из 6

Web Development

Module 9 – Reports and creating lookup method

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

3. Create lookup methods and query in codeigniter


o
aC s
vi y re
ed d
ar stu
sh is
Th

Module 9 – Reports and creating lookup method 1


https://www.coursehero.com/file/48299176/Interpret-Datapdf/
Web Development

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

transactions and data collections.

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

The Enrolment Summary Page:


ed d
ar stu
sh is
Th

Module 9 – Reports and creating lookup method 2


https://www.coursehero.com/file/48299176/Interpret-Datapdf/
Web Development

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.

The Enrolled Students List

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 Not Enrolled Students List


ed d
ar stu
sh is
Th

Module 9 – Reports and creating lookup method 3


https://www.coursehero.com/file/48299176/Interpret-Datapdf/
Web Development

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.

Creating Look Up methods

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.

$this->lookup_model->lookup_value($table, $field, $key, $return);

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

Example of the lookup model and method.

Module 9 – Reports and creating lookup method 4


https://www.coursehero.com/file/48299176/Interpret-Datapdf/
Web Development

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.

Code (excerpt from the Controller usage)

$firstname = $this->report_lookup_model->r_value('students', 'stud_id', $stud_id, 'stud_fname');

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

you want the data to be showed.


ar stu

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

Queries listings page


Th

Module 9 – Reports and creating lookup method 5


https://www.coursehero.com/file/48299176/Interpret-Datapdf/
Web Development

Enrolled Students Query form

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

Students enrolled between May 29 and June 4, 2016


ar stu
sh is
Th

Module 9 – Reports and creating lookup method 6


https://www.coursehero.com/file/48299176/Interpret-Datapdf/

Powered by TCPDF (www.tcpdf.org)

Вам также может понравиться