backup
This commit is contained in:
25
ajax_workshop_2/index.php
Normal file
25
ajax_workshop_2/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// load required classes
|
||||
require_once('Models/StudentsDataSet.php');
|
||||
|
||||
// make a view class
|
||||
$view = new stdClass();
|
||||
$view->pageTitle = 'Student Information System';
|
||||
|
||||
// create a new student dataset object that we can generate data from
|
||||
$studentsDataSet = new StudentsDataSet();
|
||||
$view->studentsDataSet = $studentsDataSet->fetchAllStudents();
|
||||
|
||||
// send a results count to the view to show how many results were retrieved
|
||||
if (count($view->studentsDataSet) == 0)
|
||||
{
|
||||
$view->dbMessage = "No results";
|
||||
}
|
||||
else
|
||||
{
|
||||
$view->dbMessage = count($view->studentsDataSet) . " result(s)";
|
||||
}
|
||||
|
||||
// include the view
|
||||
require_once('Views/index.phtml');
|
Reference in New Issue
Block a user