Ignore:
Timestamp:
Nov 11, 2014 11:21:47 PM (11 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/frontend
Files:
1 added
3 edited

Legend:

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

    r456 r472  
    1717        public function index()
    1818        {       
     19                $this->load->model('User_model');
    1920                $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               
    2026                if ($user_info){
    2127                        $username = $user_info['username'];
    22                         $this->load->view ( 'lecture_editor', array('username'=>$username));
     28                        $flashscript = $this->load->view('flashscript',null, true);
     29                        $this->load->view ( 'lecture_editor', array('username'=>$username, 'licenseAvailable' => $licenseAvailable, 'flashScript' => $flashscript));
    2330
    2431                }else{
  • pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r469 r472  
    1414        function checkLogin ($src, $token, $username, $password)
    1515        {
    16                 $data = $this->vservices->actionExecute('login', array('src' => $src, 'token' => $token, 'username' => $username, 'password' => $password), 'user');           
     16                $data = $this->vservices->actionExecute('login', array('src' => $src, 'token' => $token, 'username' => $username, 'password' => $password), 'user');
     17                               
    1718                $arr_users = explode("&", $data);
    18                 $str_status = "";
    19                 $str_fullname = "";
    20                 $str_usid = "";
    21                 $usid = "";
    22                 $fullname = "";
    23                 for ($i=0; $i<count($arr_users); $i++)
     19                $str_status = '';
     20                $str_fullname = '';
     21                $str_usid = '';
     22                $usid = '';
     23                $fullname = '';
     24                for ($i=0; $i < count($arr_users); $i++)
    2425                {
    2526                        if (strpos($arr_users[$i], 'status=') !== false)
     
    3940                }
    4041                $arr_status = explode("=", $str_status);
    41                 if ($str_fullname != "")
     42                if ($str_fullname != '')
    4243                {
    4344                        $arr_fullname = explode("=", $str_fullname);
    4445                        $fullname = $arr_fullname[1];
    4546                }
    46                 if ($str_usid !== "")
     47                if ($str_usid !== '')
    4748                {
    4849                        $arr_usid = explode("=", $str_usid);
     
    5051                }
    5152                $status = (int)$arr_status[1];
    52                 if ($status == 0 || $status = 4){
     53               
     54                if ($status == 0 || $status == 4){
    5355                        $us_id = (int)$usid;
    5456                        $query = "SELECT * FROM tbluser WHERE us_id = ?";
     
    8385                $errMsg = '';
    8486                parse_str($data);
    85                 $sms = "";
     87                $sms = '';
    8688               
    8789                switch((int)$status)
     
    166168                $us_id = 0;
    167169                $errMsg = '';
    168                 $sms = "";
     170                $sms = '';
    169171                $this->db->select('*')->from('tbluser')->where('cellphone', $receiverID);
    170172                $query = $this->db->get();
     
    218220                $us_id = 0;
    219221                $errMsg = '';
    220                 $sms = "";
     222                $sms = '';
    221223                $flag = false;
    222224                $pass = $password;
    223                 if (is_null($password) || $password = "")
     225                if (is_null($password) || $password == '')
    224226                {
    225227                        $pass = $this->create_random_password();
     
    271273        }
    272274       
     275       
     276        function checkLicense ($userId)
     277        {
     278                $isNotExpired = false;
     279                $userInfo = $this->get_user_by_id($userId);             
     280                $expireDate = $userInfo['expire_date'];
     281               
     282                if ((trim($expireDate) == '')) return $isNotExpired;
     283               
     284                $today = mktime();
     285                $expireTime = strtotime($expireDate.' 23:59:59');
     286                $isNotExpired = ($today < $expireTime);
     287                return $isNotExpired;
     288        }
     289       
    273290        function insert_smslog($sentNumber, $userID, $serviceID, $commandcode, $info, $receiveTime)
    274291        {
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php

    r450 r472  
    11<?php
    2 $this->load->view('layout/frontend/header');
     2$this->load->view('layout/frontend/header', array('flashScript' => $flashScript));
    33$base_url = base_url();
    44$this->load->view('layout/frontend/sidebar');
    55?>
    6 
    7 
    86                        <div class="main-container-inner">
    97
     
    1210                                        <div class="page-content no-padding">
    1311                                                                <!-- PAGE CONTENT BEGINS -->
     12                                                                <?php $langParam = '&language=Vietnamese' ?>
     13                                                                <?php $flashVars = 'online=true&applicationId=Violet Online' ?>
     14                                                                <?php $flashVars.= '&commonLibList=sxIOE3.xml,sxIOE4.xml,sxIOE5.xml,tnIOE3.xml,tnIOE4.xml,tnIOE5.xml' ?>
     15                                                                <?php $flashVars.= '&youtubeUrl=Service/fake_youtube.php'.$langParam.'&command=Init OK' ?>
     16                                                                <?php $flashVars.= '&licenseStatus='.$licenseAvailable ?>
     17
    1418                                                                <div class="embed-responsive embed-responsive-16by9">
    1519                                                                  <embed                                                                         
     
    1822                                                                          wmode="transparent"
    1923                                                                          type="application/x-shockwave-flash"
    20                                                                           flashvars="host=<?php echo $base_url; ?>ajax/user/login/xml"
     24                                                                          flashvars="host=<?php echo $base_url; ?>&<?php echo $flashVars;?>"
    2125                                                                  />
    2226                                                                </div>                                                 
Note: See TracChangeset for help on using the changeset viewer.