Ignore:
Timestamp:
Nov 20, 2014 7:07:44 PM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/admin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/admin_acc.php

    r425 r590  
    1414                if ($admin_info)
    1515                {
    16                         $data['content'] = $this->get_admins();
    17                         $this->load->view('admin_acc/index', $data);
     16                        $role_id = $admin_info['role_id'];
     17                        if($role_id == 1){
     18                                $data['content'] = $this->get_admins();
     19                                $this->load->model('admin_model');
     20                                $data['roles'] = $this->admin_model->get_roles();
     21                                $this->load->view('admin_acc/index', $data);
     22                        }else
     23                        {
     24                                show_404();
     25                        }
    1826                }else
    1927                {
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php

    r587 r590  
    1010       
    1111        public function index ()
    12         {
    13            
     12        {         
    1413                $admin_info = $this->session->userdata('adminInfo');
    1514                if ($admin_info)
     
    225224                else
    226225                {
    227                         $admindata = array('login_name' => $login_name, 'admin_id'=>$data->admin_id, "logined_in" => TRUE);
     226                        $admindata = array('login_name' => $login_name, 'admin_id'=>$data->admin_id, 'role_id'=>$data->role_id, 'logined_in' => TRUE);
    228227                        $this->session->set_userdata('adminInfo', $admindata);
    229228                        redirect("/admin/home");
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/smstemplate.php

    r576 r590  
    1414        $data = array();
    1515        $admin_info = $this->session->userdata('adminInfo');
     16                $role_id = $admin_info['role_id'];
    1617        if ($admin_info) {
    17             $data['content'] = $this->getSmstemplates();
    18             $this->load->view('smstemplate/index', $data);
     18                        if($role_id == 1){
     19                                $data['content'] = $this->getSmstemplates();
     20                                $this->load->view('smstemplate/index', $data);
     21                        }else
     22                        {
     23                                show_404();
     24                        }
    1925        } else {
    2026            $this->load->view('login');
  • pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php

    r534 r590  
    7777               
    7878        }
     79       
     80        function get_roles()
     81        {
     82                $sql = "SELECT * FROM tbladminrole";
     83                $query = $this->db->query($sql);
     84                $result = $query->result_array();
     85                return $result;
     86        }
    7987}
  • pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc/index.php

    r461 r590  
    127127                                                                        <i class="icon-user blue"></i>
    128128                                                                </span>
    129                                                                 <div class="help-block" id="full_name_err" > </div>
     129                                                                <small><div class="help-block" id="full_name_err" > </div><small>
    130130                                                        </label>
    131131                                                </div>
     
    143143                                                                        <i class="icon-user blue"></i>
    144144                                                                </span>
    145                                                                 <div class="help-block" id="login_name_err" > </div>
     145                                                                <small><div class="help-block" id="login_name_err" > </div></small>
    146146                                                        </label>
    147147                                                       
     
    158158                                                                </span>
    159159                                                               
    160                                                                 <div class="help-block" id="pwd1_err"> </div>
     160                                                                <small><div class="help-block" id="pwd1_err"> </div></small>
    161161                                                        </label>
    162162                                                </div>                 
     
    173173                                                                </span>
    174174                                                               
    175                                                                 <div class="help-block" id="pwd2_err"> </div>
     175                                                                <small><div class="help-block" id="pwd2_err"> </div></small>
    176176                                                        </label>
    177177                                                </div>                 
     
    187187                                                                        <i class="icon-envelope blue"></i>
    188188                                                                </span>
    189                                                                 <div class="help-block" id="email_err"> </div>
     189                                                                <small><div class="help-block" id="email_err"> </div></small>
    190190                                                        </label>
    191191                                                </div>
     
    204204                                                                        <i class="icon-phone blue"></i>
    205205                                                                </span>
    206                                                                 <div class="help-block" id="phone_err"> </div>
     206                                                                <small><div class="help-block" id="phone_err"> </div></small>
     207                                                        </label>
     208                                                </div>
     209                                                <div class="help-block"> </div>
     210                                        </div>
     211                                        <div class="space-4"></div>
     212                                       
     213                                        <div class="form-group">
     214                                                <label for="form-field-7" class="col-sm-3 control-label no-padding-right"> Phân quyền </label>
     215
     216                                                <div class="col-sm-9">
     217                                                        <label class="block clearfix has-error">
     218                                                                <span class="input-icon">
     219                                                                        <select name="role_id"  id="form-field-7">
     220                                                                        <?php foreach ($roles as $role):?>
     221                                                                        <option value=<?php echo $role['role_id']; ?>><?php echo $role['role_name']; ?></option>
     222                                                                        <?php endforeach; ?>
     223                                                                        </select>
     224                                                                </span>
     225                                                                <small><div class="help-block" id="role_err"> </div></small>
    207226                                                        </label>
    208227                                                </div>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php

    r572 r590  
     1<?php
     2$admin_info = $this->session->userdata('adminInfo');
     3$role_id = $admin_info['role_id'];
     4?>
    15<div id="breadcrumbs" class="breadcrumbs">
    26
     
    4145            <div style="padding-bottom:4px" class="table-header">
    4246                Thống kê tài khoản
    43 
     47                                <?php if($role_id == 1): ?>
    4448                <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right">
    4549                    <i class="icon-plus"></i>
    4650                    Thêm cộng tác viên
    4751                </button>
     52                                <?php endif; ?>
    4853
    4954            </div>
     
    8792                                </th>
    8893                                <th class="<?php if ($sorting_field=='activated') {echo $sorting_order;} else {echo "sorting";}?>" id="activated" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Trạng thái: activate to sort column ascending">Trạng thái</th>
    89                                 <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label="">Chức năng</th></tr>
     94                                <?php if($role_id == 1): ?><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label="">Chức năng</th><?php endif; ?></tr>
    9095                        </thead>
    9196
     
    118123                                    ?>
    119124                                </td>
    120 
     125                                                                <?php if($role_id == 1): ?>
    121126                                <td class=" ">
    122127                                    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
     
    168173                                    </div>
    169174                                </td>
     175                                                                <?php endif; ?>
    170176                            </tr>
    171177                            <?php } ?>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php

    r584 r590  
    4141            <div style="padding-bottom:4px" class="table-header">
    4242                Danh sách
    43                 <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right">
     43                <!--button href="#addUser" data-toggle="modal" class="btn btn-success pull-right">
    4444                    <i class="icon-plus"></i>
    4545                    Thêm người dùng
    46                 </button>
     46                </button-->
    4747
    4848            </div>
     
    9191                                    </label>
    9292                                </th>
    93                                                                 <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tài khoản: activate to sort column ascending">Tài khoản</th>
     93                                                                <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tài khoản: activate to sort column ascending">Username</th>
    9494                                <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Số điện thoại</th>
    95                                 <th class="<?php if ($sorting_field == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiền: activate to sort column ascending">Tiền</th>
    96                                 <th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngày đăng kÜ: activate to sort column ascending">
     95                                <th class="<?php if ($sorting_field == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tiền: activate to sort column ascending">Tài khoản (VNĐ)</th>
     96                                <th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 150px;" aria-label="Ngày đăng kÜ: activate to sort column ascending">
    9797                                    <i class="icon-time bigger-110 hidden-480"></i>
    9898                                    Ngày đăng kÜ
    9999                                </th>
    100                                                                 <th class="<?php if ($sorting_field == 'expire_date') {echo $sorting_order;} else {echo "sorting";}?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngày hết hạn: activate to sort column ascending">
     100                                                                <th class="<?php if ($sorting_field == 'expire_date') {echo $sorting_order;} else {echo "sorting";}?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 150px;" aria-label="Ngày hết hạn: activate to sort column ascending">
    101101                                    <i class="icon-time bigger-110 hidden-480"></i>
    102102                                    Ngày hết hạn
     
    124124                                    <?php echo $user['cellphone']; ?>
    125125                                </td>
    126                                 <td class="hidden-480 "><?php echo $user['acc_balanced']. " VNĐ"; ?></td>
     126                                <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
    127127                                <td class=" "><?php echo $user['created_time']; ?></td>
    128128                                                                <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date'])>0 ? date('d/m/Y', strtotime($user['expire_date'])) : '';?></td>
Note: See TracChangeset for help on using the changeset viewer.