/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: Gustav Hatvigsson
  • Date: 2013-05-28 15:21:12 UTC
  • mfrom: (83.2.23 pvp)
  • Revision ID: gustav.hartvigsson@gmail.com-20130528152112-pn1d6h8o6udcia0b
merged  Bigestans:s changes.


* Moved login JS to bannermenu.js and removed login.js
* Removed deprecated login CSS and JS
* Fixed login functionality -- now shows validation errors directly in the login popup, works through ajax
* Added a nifty little icon to represent the disabled login hint button
* Removed temporary functions from cms controller: tempLogin(), tempLogout(), test()
* Cleaned up ajax.php and cms.php

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
        }