<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Lecture Class
 * 
 * @author dzungnv02
 *
 */

class Lecture extends MX_Controller 
{
	
	public function __construct() 
	{
		parent::__construct();
	}

	public function index() 
	{	
		$this->load->model('User_model');
		$user_info = $this->session->userdata('userInfo');
		$aryParams = array();
		parse_str($user_info['user'], $aryParams);		
		$licenseAvailable = $this->User_model->checkLicense($aryParams['id']);	
                $licenseAvailable = $licenseAvailable == TRUE ? 'OK': '!OK';  
		if ($user_info){
			$username = $user_info['username'];
			$this->load->view ( 'lecture_editor', array('username'=>$username, 'licenseAvailable' => $licenseAvailable));

		}else{
			redirect('/frontend/home/');
		}
		
	}
}

/* End of file home.php */
/* Location: ./application/modules/frontend/controllers/Lecture.php */