/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
	Class filetree extends CI_Model
	{
		/*
		 *	Loads categories
		 */
		 function getCategories($activeCourse) {
			$this -> db -> select('categoryName');
			$this -> db -> from('Categories'); 
			$this -> db -> where('courseID', $activeCourse);
			$this -> db -> order_by('orderNr');

			$query = $this -> db -> get();
			return $query->result();
		}
		 
		 /*
		 *	Loads subcategories
		 */
		 function getSubCategories($categoryName, $activeCourse) {
			$this -> db -> select('subCategoryName');
			$this -> db -> from('SubCategories'); 
			$this -> db -> where('categoryName', $categoryName); 
			$this -> db -> where('courseID', $activeCourse); 

			$query = $this -> db -> get();
			return $query->result();
		}
		
		/*
		 *	Loads examples
		 */
		 function getExamples($subCategoryName, $categoryName, $activeCourse) {
			$this -> db -> select('exampleName');
			$this -> db -> from('Examples'); 
			$this -> db -> where('subCategoryName', $subCategoryName); 
			$this -> db -> where('categoryName', $categoryName);
			$this -> db -> where('courseID', $activeCourse);

			$query = $this -> db -> get();
			return $query->result();
		}
		
		/*
		 *	Loads quizzes
		 */
		 function getQuizzes($subCategoryName, $categoryName, $activeCourse) {
			$this -> db -> select('quizNr');
			$this -> db -> from('Quizzes'); 
			$this -> db -> where('subCategoryName', $subCategoryName);
			$this -> db -> where('categoryName', $categoryName);
			$this -> db -> where('courseID', $activeCourse);
			
			$query = $this -> db -> get();
			return $query->result();
		}
		
		
		/* TODO: OLD STUFF BELOW! -------------------------------------------------------------------------------------------*/
		
		/* Loads category names for menu 
		function getTitles($user)
		{
			$this -> db -> select('Categories.categoryName, Categories.courseID');
			$this -> db -> from('Categories');
			$this -> db -> join('StudentCourseRegistrations', 'Categories.courseID = StudentCourseRegistrations.courseID'); 
			$this -> db -> where('StudentCourseRegistrations.username', $user); 
			$this -> db -> order_by("orderNr", "asc"); 
		/* 	$this -> db -> where('StudentCourseRegistrations.courseID', 'd1popcrn');  
		* 	Line is disabled for now because of testing purposes.
		*	Will be modified to be used with parameter in function.
		*//*
			
			$query = $this -> db -> get();
			return $query->result();
		}*/
		
		/* Loads categorys & subcategorys for body 
		function getBody($categoryName)
		{
			$this -> db -> select('subCategoryName');
			$this -> db -> from('SubCategories'); 
			$this -> db -> where('categoryName', $categoryName); 

			$query = $this -> db -> get();
			return $query->result();

		}*/
		
		/* Loads examples for categorys 
		function getExamples($subCategoryName)
		{
			$this -> db -> select('exampleName');
			$this -> db -> from('Examples'); 
			$this -> db -> where('subCategoryName', $subCategoryName); 

			$query = $this -> db -> get();
			return $query->result();


		}*/
	}
?>