Changeset 590


Ignore:
Timestamp:
Nov 20, 2014 7:07:44 PM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application
Files:
9 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>
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php

    r556 r590  
    106106        public function register() {
    107107                $this->load->model ( 'user_model' );
    108                 $sentNumber = '0979947802';
    109                 $serviceID = 1;
    110                 $receiveID = '0985685735';
     108                //$collaborator = '0979947802';
     109                $serviceID = 1;
     110                $username = '0979947802';
    111111                $commandcode = 'commandcode1';
    112112                $info = 'ABCD';
    113113                // $receiveTime = time();
    114114                $receiveTime = date ( "Y-m-d H:i:s" );
    115                 $data = $this->user_model->register ( $sentNumber, $receiveID, $serviceID, $commandcode, $info, $receiveTime );
     115                $data = $this->user_model->register ( $username, null );
    116116                echo $data;
    117117        }
     
    123123                $password = '123456';
    124124                $commandcode = "SBG";
    125                 $receiveID = '01662860000';
     125                $receiveID = '0977274183';
    126126                $info = "SBG TD";
    127127                $receiveTime = date ( "Y-m-d H:i:s" );
     
    148148        public function register_vip() {
    149149                $this->load->model ( 'user_model' );
    150                 $sentNumber = '01662860000';
     150                $sentNumber = '0979947802';
     151                $p_code = 1;
    151152                $serviceID = 1;
    152153                $commandcode = "SBG";
     
    156157                $receiveTime = date ( "Y-m-d H:i:s" );
    157158                $status = 0;
    158                 $data = $this->user_model->registerVip ( $sentNumber, $vipNum, $serviceID, $commandcode, $info, $status );
     159                $data = $this->user_model->registerVip ( $sentNumber, $p_code );
    159160                echo $data;
    160161        }
     
    171172                $info = "SBG NAP 01662860000 10000";
    172173                $status = 0;
    173                 $data = $this->user_model->rechargeAccount ( $sentNumber, $receiveID, $mainAccBalanced, $amount, $serviceID, $commandcode, $info, $status );
     174                $receiveTime = date ( "Y-m-d H:i:s" );
     175                //$data = $this->user_model->rechargeAccount ( $sentNumber, $amount );
     176                $data = $this->user_model->insertPaidlog($sentNumber, $sentNumber, 2, $amount, $receiveTime);
    174177                echo $data;
    175178        }
  • pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php

    r584 r590  
    22$class = $this->router->class;
    33$method = $this->router->method;
     4$admin_info = $this->session->userdata('adminInfo');
     5$role_id = $admin_info['role_id'];
    46?>
    57                        <div class="main-container-inner">
     
    1416
    1517                                        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
    16                                                 <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large" style="line-height:normal">
     18                                                <!--div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large" style="line-height:normal">
    1719                                                        <div data-percent="66%" class="progress progress-striped active" style="margin-bottom:0">
    1820                                                                <div style="width:66%;" class="progress-bar"></div>
    1921                                                        </div>
    2022                                                        <span>66 GB / 100 GB</span>
    21                                                 </div>
     23                                                </div-->
    2224
    2325                                                <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
     
    4951
    5052                                                        <ul class="submenu">
     53                                                                <?php if($role_id == 1): ?>
    5154                                                                <li class="<?php if(in_array($class,array("admin_acc"))) {echo "active";}?>">
    5255                                                                        <a href="<?php echo $base_url; ?>admin/quan_tri_vien">
     
    5558                                                                        </a>
    5659                                                                </li>
     60                                                                <?php endif; ?>
    5761
    5862                                                                <li class="<?php if(in_array($class,array("user"))) {echo "active";}?>">
     
    117121                                                        </ul>
    118122                                                </li>
    119 
    120                                                 <li>
     123                                                <?php if($role_id == 1): ?>
     124                                                <!--li>
    121125                                                        <a href="config.html" class="dropdown-toggle">
    122126                                                                <i class="icon-cog"></i>
    123127                                                                <span class="menu-text"> Thiết lập </span>
    124128                                                        </a>
    125                                                 </li>
    126                                                 <li class="<?php if(in_array($class,array("smstemplate"))) {echo "active";}?>">
     129                                                </li-->
     130                        <li class="<?php if(in_array($class,array("smstemplate"))) {echo "active";}?>">
    127131                                                        <a href="<?php echo $base_url;?>admin/mau_tin_nhan" class="dropdown-toggle">
    128132                                                                <i class="icon-cog"></i>
     
    130134                                                        </a>
    131135                                                </li>
     136                                                <?php endif; ?>
    132137
    133138                                        </ul><!-- /.nav-list -->
Note: See TracChangeset for help on using the changeset viewer.