/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/controllers/firstTimeRegistration.php

  • Committer: elof.bigestans at gmail
  • Date: 2013-04-03 08:06:30 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: elof.bigestans@gmail.com-20130403080630-r721wlstq15mdjby
Added new folders to match new folder structure

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
 
 
3
 
        class Cms extends CI_Controller {
4
 
        
5
 
                /*
6
 
                 *      Constructor
7
 
                 */
8
 
                function __construct() {
9
 
                        parent::__construct();
10
 
                        //Load required library
11
 
                        $this->load->model('user', '', TRUE);
12
 
                        $this->load->model('admin/admin_model', '', TRUE);
13
 
                }
14
 
                
15
 
                /*
16
 
                 *      This function runs when the user navigates directly to this controller
17
 
                 */
18
 
                public function index() {
19
 
                        if($this->user->isLoggedIn()) {
20
 
                                //User already logged in
21
 
                                $this->drawCmsPage('');
22
 
                        } else {
23
 
                                //Display the start page
24
 
                                redirect(base_url().'home', 'refresh');
25
 
                        }
26
 
                }               
27
 
                
28
 
                /*
29
 
                 *      This function draws the cms page.
30
 
                 */
31
 
                private function drawCmsPage() {
32
 
                        $userName = $this->user->getUserName();
33
 
                        $userType = $this->user->getUserType();
34
 
                        //Creates an array with all courses.
35
 
                        //Creates an array with the variables that the bannermenu-view is expecting.
36
 
                        $data = array(
37
 
                                'userType' => $userType,
38
 
                                'userName' => $userName,
39
 
                        );
40
 
                        
41
 
                        //Creates an array with the necessary css- and jsfiles needed for the views that are about to be shown.
42
 
                        $headTagData = array(
43
 
                                'cssFiles' => array('bannermenu', 'registration', 'startview'),
44
 
                                'jsFiles' => array('bannermenu')
45
 
                        );
46
 
                        
47
 
                        //Puts the array above in <head></head>
48
 
                        $this->load->view('headTag', array('headTagData' => $headTagData));     
49
 
                        
50
 
                        $this->load->view('bannermenu', $data);
51
 
                        if ($userType=='1'){
52
 
                                $this->load->view('registrationTeacher');
53
 
                        }
54
 
                        else if($userType=='2'){
55
 
                                $this->load->view('registrationStudent');
56
 
                        }
57
 
                        else{
58
 
                                $this->load->view('startview');
59
 
                        }
60
 
                }
61
 
        }
62
 
?>