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

Last change on this file since 672 was 670, checked in by dungnv, 10 years ago
File size: 2.0 KB
RevLine 
[553]1<?php
2
3if (!defined('BASEPATH'))
4    exit('No direct script access allowed');
5
[313]6/**
7 * Lecture Class
8 *
9 * @author dzungnv02
10 *
11 */
[553]12class Lecture extends MX_Controller {
[313]13
[553]14    public function __construct() {
15        parent::__construct();
16    }
[313]17
[553]18    public function index() {
19        $this->load->model('User_model');
20        $user_info = $this->session->userdata('userInfo');
[565]21       
[553]22        $aryParams = array();
23        parse_str($user_info['user'], $aryParams);
[565]24       
[670]25        $licenseAvailable = isset($aryParams['id']) ? $this->User_model->checkLicense($aryParams['id']) : FALSE;
[553]26        $licenseAvailable = $licenseAvailable == TRUE ? 'OK' : '!OK';
[657]27 
[553]28        if ($user_info) {
29            $username = $user_info['username'];   
30            $first_visit=0;
[580]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'];
[670]36            $u = $this->user_model->get_user_by_id($us_id);
37           
38            $info['fullname'] = isset($info['fullname']) ? $info['fullname'] : '';
39           
40            if ($info['fullname'] == '' && $u['p_id'] != '')
[580]41            {
42                $update_user_info=1;
43            }
[670]44           
[553]45            if (!$this->session->userdata('first_visit'))
46            {
47               $this->session->set_userdata('first_visit','1');
48               $first_visit=1;
49            }
[665]50 
[662]51          $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,"p_period"=>$u['p_period'],"expire_date"=>date("d-m-Y", strtotime($u['expire_date']))));
[553]52        } else {
53            redirect('/frontend/home/');
54        }
55    }
[326]56
[313]57}
58
59/* End of file home.php */
60/* Location: ./application/modules/frontend/controllers/Lecture.php */
Note: See TracBrowser for help on using the repository browser.