/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/application/models/examplesmodel.php

  • Committer: elof.bigestans at gmail
  • Date: 2013-05-28 11:22:15 UTC
  • mfrom: (112 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 113.
  • Revision ID: elof.bigestans@gmail.com-20130528112215-d6qidnvlxm7w29di
* Merged trunk AND
* Modified js/login.js and js/bannermenu.js, specifically functions related to the login popup! 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
        Class examplesmodel extends CI_Model
3
 
        {
4
 
                /* Loads category names for menu */
5
 
                function getTitles($user)
6
 
                {
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.
15
 
                */
16
 
                        
17
 
                        $query = $this -> db -> get();
18
 
                        return $query->result();
19
 
 
20
 
                }
21
 
                
22
 
                /* Loads categorys & subcategorys for body */
23
 
                function getBody($categoryName)
24
 
                {
25
 
                        $this -> db -> select('subCategoryName');
26
 
                        $this -> db -> from('SubCategories'); 
27
 
                        $this -> db -> where('categoryName', $categoryName); 
28
 
 
29
 
                        $query = $this -> db -> get();
30
 
                        return $query->result();
31
 
 
32
 
                }
33
 
                
34
 
                /* Loads examples for categorys */
35
 
                function getExamples($subCategoryName)
36
 
                {
37
 
                        $this -> db -> select('exampleName');
38
 
                        $this -> db -> from('Examples'); 
39
 
                        $this -> db -> where('subCategoryName', $subCategoryName); 
40
 
 
41
 
                        $query = $this -> db -> get();
42
 
                        return $query->result();
43
 
 
44
 
 
45
 
                }
46
 
        }
47
 
?>
48