2
Class filetree extends CI_Model
7
function getCategories($activeCourse) {
8
$this -> db -> select('categoryName');
9
$this -> db -> from('Categories');
10
$this -> db -> where('courseID', $activeCourse);
12
$query = $this -> db -> get();
13
return $query->result();
19
function getSubCategories($categoryName, $activeCourse) {
20
$this -> db -> select('subCategoryName');
21
$this -> db -> from('SubCategories');
22
$this -> db -> where('categoryName', $categoryName);
23
$this -> db -> where('courseID', $activeCourse);
25
$query = $this -> db -> get();
26
return $query->result();
32
function getExamples($subCategoryName, $categoryName, $activeCourse) {
33
$this -> db -> select('exampleName');
34
$this -> db -> from('Examples');
35
$this -> db -> where('subCategoryName', $subCategoryName);
36
$this -> db -> where('categoryName', $categoryName);
37
$this -> db -> where('courseID', $activeCourse);
39
$query = $this -> db -> get();
40
return $query->result();
46
function getQuizzes($subCategoryName, $categoryName, $activeCourse) {
47
$this -> db -> select('quizNr');
48
$this -> db -> from('Quizzes');
49
$this -> db -> where('subCategoryName', $subCategoryName);
50
$this -> db -> where('categoryName', $categoryName);
51
$this -> db -> where('courseID', $activeCourse);
53
$query = $this -> db -> get();
54
return $query->result();
58
/* TODO: OLD STUFF BELOW! -------------------------------------------------------------------------------------------*/
60
/* Loads category names for menu
61
function getTitles($user)
63
$this -> db -> select('Categories.categoryName, Categories.courseID');
64
$this -> db -> from('Categories');
65
$this -> db -> join('StudentCourseRegistrations', 'Categories.courseID = StudentCourseRegistrations.courseID');
66
$this -> db -> where('StudentCourseRegistrations.username', $user);
67
$this -> db -> order_by("orderNr", "asc");
68
/* $this -> db -> where('StudentCourseRegistrations.courseID', 'd1popcrn');
69
* Line is disabled for now because of testing purposes.
70
* Will be modified to be used with parameter in function.
73
$query = $this -> db -> get();
74
return $query->result();
77
/* Loads categorys & subcategorys for body
78
function getBody($categoryName)
80
$this -> db -> select('subCategoryName');
81
$this -> db -> from('SubCategories');
82
$this -> db -> where('categoryName', $categoryName);
84
$query = $this -> db -> get();
85
return $query->result();
89
/* Loads examples for categorys
90
function getExamples($subCategoryName)
92
$this -> db -> select('exampleName');
93
$this -> db -> from('Examples');
94
$this -> db -> where('subCategoryName', $subCategoryName);
96
$query = $this -> db -> get();
97
return $query->result();