/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: a11emmjo
  • Date: 2013-05-28 08:51:26 UTC
  • mto: This revision was merged to the branch mainline in revision 110.
  • Revision ID: a11emmjo@student.his.se-20130528085126-16sx38szwbsx1coh
Changed so that cms-controller loads filetree (before known as examplesController, examplesBody, examplesMenu).

Also changed to describing filenames and names for attributes and functions in css, php-view and in model that is used for this.

Started working on cmsindex-view and -css.

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