/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/admin/admin_model.php

  • Committer: a11andoh
  • Date: 2013-05-30 08:46:52 UTC
  • mfrom: (125 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 126.
  • Revision ID: a11andoh@student.his.se-20130530084652-txr5mvf2a0z49w3z
updated branch

modified the sidemenu to not display full name if overflowing

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        /* Get all the public courses */
23
23
        function getPublicCourses() {
24
24
                $this->db->from("Courses");
 
25
                $this->db->order_by("name", "asc");
25
26
                $this->db->where("isHidden","0");
26
27
                $this->db->where("isPublic","1");
27
28
                $query = $this->db->get();
29
30
        }
30
31
        
31
32
        /* Get all the private courses for a student - If they are published and private*/
32
 
        function getPrivateCourses($studentID) {
 
33
        function getPrivateCourses($username) {
33
34
                $this->db->from("Courses");
34
35
                $this->db->join("StudentCourseRegistrations", "Courses.courseID = StudentCourseRegistrations.courseID");
35
 
                $this->db->where("userName", $studentID);
 
36
                $this->db->order_by("name", "asc");
 
37
                $this->db->where("userName", $username);
36
38
                $this->db->where("isPublic", "0");
37
39
                $this->db->where("isHidden","0");
38
40
                $query = $this->db->get();
40
42
        }
41
43
        
42
44
        /* Get all the courses for a student, both private from getPrivateCourses(), and public from getPublicCourses() */
43
 
        function getStudentCourses($studentID) {
44
 
                $private = $this->getPrivateCourses($studentID);
 
45
        function getStudentCourses($username) {
 
46
                $private = $this->getPrivateCourses($username);
45
47
                $public = $this->getPublicCourses();
46
48
                return array_merge($private, $public);
47
49
        }