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 -> order_by("orderNr", "asc");
12
/* $this -> db -> where('StudentCourseRegistrations.courseID', 'd1popcrn');
13
* Line is disabled for now because of testing purposes.
14
* Will be modified to be used with parameter in function.
17
$query = $this -> db -> get();
18
return $query->result();
22
/* Loads categorys & subcategorys for body */
23
function getBody($categoryName)
25
$this -> db -> select('subCategoryName');
26
$this -> db -> from('SubCategories');
27
$this -> db -> where('categoryName', $categoryName);
29
$query = $this -> db -> get();
30
return $query->result();
34
/* Loads examples for categorys */
35
function getExamples($subCategoryName)
37
$this -> db -> select('exampleName');
38
$this -> db -> from('Examples');
39
$this -> db -> where('subCategoryName', $subCategoryName);
41
$query = $this -> db -> get();
42
return $query->result();