[553] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | if (!defined('BASEPATH'))
|
---|
| 4 | exit('No direct script access allowed');
|
---|
| 5 |
|
---|
[313] | 6 | /**
|
---|
| 7 | * Lecture Class
|
---|
[884] | 8 | * @todo Show lecture editor software
|
---|
[313] | 9 | * @author dzungnv02
|
---|
| 10 | *
|
---|
| 11 | */
|
---|
[553] | 12 | class Lecture extends MX_Controller {
|
---|
[313] | 13 |
|
---|
[884] | 14 | /**
|
---|
| 15 | * function __construct
|
---|
| 16 | * @todo constructor of class
|
---|
| 17 | */
|
---|
[553] | 18 | public function __construct() {
|
---|
| 19 | parent::__construct();
|
---|
[717] | 20 | $this->load->helper('language');
|
---|
| 21 | $this->lang->load('messages', 'message');
|
---|
[553] | 22 | }
|
---|
[313] | 23 |
|
---|
[884] | 24 | /**
|
---|
| 25 | * function index
|
---|
| 26 | * @todo Show lecture editor
|
---|
| 27 | */
|
---|
[553] | 28 | public function index() {
|
---|
| 29 | $this->load->model('User_model');
|
---|
| 30 | $user_info = $this->session->userdata('userInfo');
|
---|
[565] | 31 |
|
---|
[553] | 32 | $aryParams = array();
|
---|
| 33 | parse_str($user_info['user'], $aryParams);
|
---|
[565] | 34 |
|
---|
[670] | 35 | $licenseAvailable = isset($aryParams['id']) ? $this->User_model->checkLicense($aryParams['id']) : FALSE;
|
---|
[553] | 36 | $licenseAvailable = $licenseAvailable == TRUE ? 'OK' : '!OK';
|
---|
[657] | 37 |
|
---|
[553] | 38 | if ($user_info) {
|
---|
| 39 | $username = $user_info['username'];
|
---|
| 40 | $first_visit=0;
|
---|
[580] | 41 | $update_user_info=0;
|
---|
| 42 | parse_str($user_info['user'], $info);
|
---|
| 43 | $this->load->model('user_model');
|
---|
| 44 | $user = $user_info['user'];
|
---|
| 45 | $us_id = $user_info['us_id'];
|
---|
[670] | 46 | $u = $this->user_model->get_user_by_id($us_id);
|
---|
| 47 |
|
---|
| 48 | $info['fullname'] = isset($info['fullname']) ? $info['fullname'] : '';
|
---|
| 49 |
|
---|
| 50 | if ($info['fullname'] == '' && $u['p_id'] != '')
|
---|
[580] | 51 | {
|
---|
| 52 | $update_user_info=1;
|
---|
| 53 | }
|
---|
[717] | 54 |
|
---|
[906] | 55 | if ((!$u['province'] || !$u['district']) && $u['p_id'] != ''){
|
---|
[717] | 56 | $update_user_info=1;
|
---|
| 57 | }
|
---|
[670] | 58 |
|
---|
[553] | 59 | if (!$this->session->userdata('first_visit'))
|
---|
| 60 | {
|
---|
| 61 | $this->session->set_userdata('first_visit','1');
|
---|
| 62 | $first_visit=1;
|
---|
| 63 | }
|
---|
[765] | 64 |
|
---|
| 65 | $isOverDate = strtotime($u['expire_date']) < strtotime(date('Y-m-d')) ? 0:1;
|
---|
[665] | 66 |
|
---|
[765] | 67 | $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'])), 'isOverDate' => $isOverDate , "fullname"=>$info['fullname'], "school"=>$info['school'], "province"=>$u['province'], "provinces"=>lang('_PROVINCES_')));
|
---|
[553] | 68 | } else {
|
---|
| 69 | redirect('/frontend/home/');
|
---|
| 70 | }
|
---|
| 71 | }
|
---|
[326] | 72 |
|
---|
[821] | 73 | public function help(){
|
---|
| 74 | $this->load->view('help');
|
---|
| 75 | }
|
---|
[313] | 76 | }
|
---|
| 77 |
|
---|
| 78 | /* End of file home.php */
|
---|
| 79 | /* Location: ./application/modules/frontend/controllers/Lecture.php */ |
---|