2
Class examplesmodel extends CI_Model
4
/* Loads category names for menu */
5
function getTitles($user)
7
$this -> db -> select('Categories.categoryName, Categories.CourseID');
8
$this -> db -> from('Categories');
9
$this -> db -> join('StudentCourseRegistrations', 'Categories.courseID = StudentCourseRegistrations.courseID');
10
$this -> db -> where('StudentCourseRegistrations.username', $user);
11
/* $this -> db -> where('StudentCourseRegistrations.courseID', 'd1popcrn');
12
* Line is disabled for now because of testing purposes.
13
* Will be modified to be used with parameter in function.
16
$query = $this -> db -> get();
17
return $query->result();
21
/* Loads categorys & subcategorys for body */
22
function getBody($categoryName)
24
$this -> db -> select('subCategoryName');
25
$this -> db -> from('SubCategories');
26
$this -> db -> where('categoryName', $categoryName);
28
$query = $this -> db -> get();
29
return $query->result();
33
/* Loads examples for categorys */
34
function getExamples($subCategoryName)
36
$this -> db -> select('exampleName');
37
$this -> db -> from('Examples');
38
$this -> db -> where('subCategoryName', $subCategoryName);
40
$query = $this -> db -> get();
41
return $query->result();