/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/user.php

  • Committer: a11emmjo
  • Date: 2013-05-26 14:29:27 UTC
  • mfrom: (103 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 104.
  • Revision ID: a11emmjo@student.his.se-20130526142927-6jq83th03oizbnbw
Updated branch.

Updated getActiveCourse in user-model, and fixed so bannermenu- and cms-view uses it.
Removed links from bannermenu-view.
Fixed so cms is loaded in home-controller when user is logged in.
Added function for expand collapse courses in bannermenu-view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
387
387
                }
388
388
                
389
389
                /*
390
 
                * This function fetches the active course from the user table
 
390
                * This function fetches the active course info
391
391
                */
392
392
                public function getActiveCourse(){
 
393
                        
393
394
                        if($this->isLoggedIn()) {
394
395
                                $temp = $this->session->userdata('authenticated');
395
 
                                return $temp['activeCourse'];   
 
396
                                $courseID = $temp['activeCourse'];
 
397
                                $courseName;
 
398
                        
 
399
                                //Query-structure
 
400
                                $this->db->select('name');
 
401
                                $this->db->from('Courses');
 
402
                                $this->db->where('courseID', $courseID);
 
403
                                $this->db->limit(1);
 
404
                                //Execute query
 
405
                                $query = $this->db->get();
 
406
                                $result = $query->result();
 
407
 
 
408
                                foreach($result as $row) {
 
409
                                        $courseName = $row->name;
 
410
                                }
 
411
                                
 
412
                                $data = array(
 
413
                                        'courseID' => $courseID,
 
414
                                        'courseName' => $courseName
 
415
                                );
 
416
                                
 
417
                                return $data;
396
418
                        }
397
 
                        
398
419
                        return FALSE;
399
420
                }
400
421
        }
401
 
        
402
422
?>
 
 
b'\\ No newline at end of file'