Changeset 553


Ignore:
Timestamp:
Nov 18, 2014 12:18:20 PM (11 years ago)
Author:
quyenla
Message:

first show modal

Location:
pro-violet-viettel/sourcecode
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php

    r490 r553  
    1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
     1<?php
     2
     3if (!defined('BASEPATH'))
     4    exit('No direct script access allowed');
     5
    26/**
    37 * Lecture Class
     
    610 *
    711 */
     12class Lecture extends MX_Controller {
    813
    9 class Lecture extends MX_Controller
    10 {
    11        
    12         public function __construct()
    13         {
    14                 parent::__construct();
    15         }
     14    public function __construct() {
     15        parent::__construct();
     16    }
    1617
    17         public function index()
    18         {       
    19                 $this->load->model('User_model');
    20                 $user_info = $this->session->userdata('userInfo');
    21                 $aryParams = array();
    22                 parse_str($user_info['user'], $aryParams);             
    23                 $licenseAvailable = $this->User_model->checkLicense($aryParams['id']); 
    24                 $licenseAvailable = $licenseAvailable == TRUE ? 'OK': '!OK'; 
    25                 if ($user_info){
    26                         $username = $user_info['username'];
    27                         $this->load->view ( 'lecture_editor', array('username'=>$username, 'licenseAvailable' => $licenseAvailable));
     18    public function index() {
     19        $this->load->model('User_model');
     20        $user_info = $this->session->userdata('userInfo');
     21        $aryParams = array();
     22        parse_str($user_info['user'], $aryParams);
     23        $licenseAvailable = $this->User_model->checkLicense($aryParams['id']);
     24        $licenseAvailable = $licenseAvailable == TRUE ? 'OK' : '!OK';
     25        if ($user_info) {
     26            $username = $user_info['username'];   
     27            $first_visit=0;
     28            if (!$this->session->userdata('first_visit'))
     29            {
     30               $this->session->set_userdata('first_visit','1');
     31               $first_visit=1;
     32            }
     33          $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit));
     34        } else {
     35            redirect('/frontend/home/');
     36        }
     37    }
    2838
    29                 }else{
    30                         redirect('/frontend/home/');
    31                 }
    32                
    33         }
    3439}
    3540
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php

    r490 r553  
    4040                    var licenseAvailable = "<?php echo $licenseAvailable;?>";
    4141                    var url= "<?php echo base_url();?>";
     42                    var first_visit= "<?php echo $first_visit;?>";
    4243</script>               
    4344<?php
  • pro-violet-viettel/sourcecode/assets/js/frontend/lecture.js

    r531 r553  
    1 
    21if (licenseAvailable == "!OK")
    32{
    4  
    5     var ck = document.cookie;
    6 
    7     if (document.cookie.indexOf("open") >= 0) {
     3    if (first_visit == '1') {
     4         showModal();
    85    }
    9     else
    10     {
    11         showModal();
    12         document.cookie = "open=1";
    13     }
    14 
    156}
    167
Note: See TracChangeset for help on using the changeset viewer.