source: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php @ 625

Last change on this file since 625 was 580, checked in by quyenla, 10 years ago

bug

File size: 1.7 KB
Line 
1<?php
2
3if (!defined('BASEPATH'))
4    exit('No direct script access allowed');
5
6/**
7 * Lecture Class
8 *
9 * @author dzungnv02
10 *
11 */
12class Lecture extends MX_Controller {
13
14    public function __construct() {
15        parent::__construct();
16    }
17
18    public function index() {
19        $this->load->model('User_model');
20        $user_info = $this->session->userdata('userInfo');
21       
22        $aryParams = array();
23        parse_str($user_info['user'], $aryParams);
24       
25        $licenseAvailable = $this->User_model->checkLicense($aryParams['id']);
26        $licenseAvailable = $licenseAvailable == TRUE ? 'OK' : '!OK';
27       
28        if ($user_info) {
29            $username = $user_info['username'];   
30            $first_visit=0;
31            $update_user_info=0;
32            parse_str($user_info['user'], $info);
33            $this->load->model('user_model');
34            $user = $user_info['user'];
35            $us_id = $user_info['us_id'];
36            $u = $this->user_model->get_user_by_id($us_id);
37            if (($info['fullname']=="")&&($u['p_id']!=""))
38            {
39                $update_user_info=1;
40            }
41            if (!$this->session->userdata('first_visit'))
42            {
43               $this->session->set_userdata('first_visit','1');
44               $first_visit=1;
45            }
46          $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams,'update_user_info'=>$update_user_info,'us_id'=>$us_id));
47        } else {
48            redirect('/frontend/home/');
49        }
50    }
51
52}
53
54/* End of file home.php */
55/* Location: ./application/modules/frontend/controllers/Lecture.php */
Note: See TracBrowser for help on using the repository browser.