Changeset 717


Ignore:
Timestamp:
Jan 29, 2015 5:32:13 PM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode
Files:
7 edited

Legend:

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

    r670 r717  
    1414    public function __construct() {
    1515        parent::__construct();
     16                $this->load->helper('language');
     17                $this->lang->load('messages', 'message');
    1618    }
    1719
     
    4244                $update_user_info=1;
    4345            }
     46                       
     47                        if ($u['province'] == '' && $u['p_id'] != ''){
     48                                $update_user_info=1;
     49                        }
    4450           
    4551            if (!$this->session->userdata('first_visit'))
     
    4955            }
    5056 
    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']))));
     57          $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'])), "fullname"=>$info['fullname'], "school"=>$info['school'], "province"=>$u['province'], "provinces"=>lang('_PROVINCES_')));
    5258        } else {
    5359            redirect('/frontend/home/');
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php

    r716 r717  
    242242            parse_str($user_info['user'], $info);
    243243            if ($input) {
    244                 if (strlen($input['fullname']) == 0) {
    245                     $result['errors'][] = array("content"=>lang('_SBG_FULLNAME_REQUIRED_MSG'),"field"=>"fullname");
    246                 }
     244                                if (array_key_exists('fullname', $input)) {
     245                                        if (strlen($input['fullname']) == 0) {
     246                                                $result['errors'][] = array("content"=>lang('_SBG_FULLNAME_REQUIRED_MSG'),"field"=>"fullname");
     247                                        }
     248                                }else{
     249                                        $input['fullname'] = $user['fullname'];
     250                                }
    247251                if (strlen($input['school']) == 0) {
    248252                    $result['errors'][] = array("content"=>lang('_SBG_REGISTER_VIP_SCHOOL_REQUIRED_MSG'),"field"=>"school");
     
    251255                $input['password'] = '';
    252256                $input['oldpass'] = '';
    253                 $input['province'] = '';
     257                //$input['province'] = '';
    254258                $this->load->model('user_model');
    255259                if (!isset($result['errors'])) {
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php

    r663 r717  
    5858                                Họ và tên</label>
    5959                            <div class="col-sm-8">
    60                                 <input name="fullname" type="text" value="" placeholder="Họ và tên" id="form-field-first" class="input-large">
     60                                <input name="fullname" type="text" value="<?php echo $fullname; ?>" placeholder="Họ và tên" id="form-field-first" class="input-large" <?php if($fullname) echo "disabled"; ?>>
    6161                                <label class="block clearfix has-error">
    6262                                <div id="fullname" class="help-block error"></div>
     
    7171                                Đơn vị</label>
    7272                            <div class="col-sm-8">
    73                                 <input name="school"  type="text" value="" placeholder="Đơn vị" id="form-field-first" class="input-large">
     73                                <input name="school"  type="text" value="<?php echo $school; ?>" placeholder="Đơn vị" id="form-field-first" class="input-large">
    7474                            <label class="block clearfix has-error">
    7575                                <div id="school" class="help-block error"></div>
     
    7777                            </div>
    7878                        </div>
     79                                                <div class="form-group">
     80                                                        <label for="form-field-province" class="col-sm-4 control-label no-padding-right">Tỉnh / Thành phố</label>
     81                                                        <div class="col-sm-8">
     82                                                                <select name="province" id="form-field-province" class="input-large">
     83                                                                <?php foreach ($provinces as $pro):?>
     84                                                                        <option></option>
     85                                                                        <option value="<?php echo $pro;?>" <?php if($province == $pro) echo "selected"; ?>><?php echo $pro; ?></option>
     86                                                                <?php endforeach;?>
     87                                                                </select>
     88                                                        </div>
     89                                                </div>
    7990
    8091                        Lưu Ü:
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/package_register_modal.php

    r714 r717  
    5050                                                                <select name="province" id="form-field-province" class="input-large">
    5151                                                                <?php foreach (lang('_PROVINCES_') as $pro):?>
     52                                                                        <option></option>
    5253                                                                        <option value="<?php echo $pro;?>" <?php if($user['province'] == $pro) echo "selected"; ?> ><?php echo $pro; ?></option>
    5354                                                                <?php endforeach;?>
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php

    r716 r717  
    104104                                                                                                                <select name="province" id="form-field-province" class="col-xs-12 col-sm-10">
    105105                                                                                                                <?php foreach ($provinces as $pro):?>
     106                                                                                                                        <option></option>
    106107                                                                                                                        <option value="<?php echo $pro;?>" <?php if($province==$pro) echo "selected"; ?>><?php echo $pro; ?></option>
    107108                                                                                                                <?php endforeach;?>
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r716 r717  
    481481                }
    482482        }
     483       
     484        public function deleteCollaborator($id){
     485                $sql = "DELETE FROM tblcollaborator WHERE id = ". $id;
     486                $this->db->query($sql);
     487                if ($this->db->affected_rows()){
     488                        $logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete success! !\n";
     489                        write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
     490                }else{
     491                        $logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete fail! !. Sql = ".$sql."\n";
     492                        write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
     493                }
     494        }
     495       
     496        public function getAllCollaboratorID(){
     497                $sql = "Select id from tblcollaborator";
     498                $query = $this->db->query($sql);
     499                if ($this->db->affected_rows()){
     500                        return $query->result();
     501                }else
     502                {
     503                        return array();
     504                }
     505        }
    483506}
  • pro-violet-viettel/sourcecode/assets/js/frontend/lecture.js

    r716 r717  
    66    }
    77}
    8 if (first_visit == '1') {
     8//if (first_visit == '1') {
    99
    10     if (p_period == -1)
    11     {
    12         $('#alert-trial-services').modal('show');
    13         $('#alert-trial-services').on('hidden.bs.modal', function () {
    14             if (update_user_info == "1")
    15             {
    16                 $('#update_user_info').modal({backdrop: 'static',keyboard: false,});
    17             }
    18         });
    19     }
    20     else
    21     {
    22         if (update_user_info == "1")
    23         {
    24             $('#update_user_info').modal({backdrop: 'static'});
    25         }
    26     }
     10if (p_period == -1)
     11{
     12        $('#alert-trial-services').modal('show');
     13        $('#alert-trial-services').on('hidden.bs.modal', function () {
     14                if (update_user_info == "1")
     15                {
     16                        $('#update_user_info').modal({backdrop: 'static',keyboard: false,});
     17                }
     18        });
     19}
     20else
     21{
     22        if (update_user_info == "1")
     23        {
     24                $('#update_user_info').modal({backdrop: 'static'});
     25        }
     26}
    2727
    28 }
     28//}
    2929
    3030
Note: See TracChangeset for help on using the changeset viewer.