Changeset 690 for pro-violet-viettel


Ignore:
Timestamp:
Jan 9, 2015 10:35:30 AM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel
Files:
2 added
20 edited

Legend:

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

    r576 r690  
    5353           
    5454        }
    55        
     55                $data['daterange_start'] = "";
     56                $data['daterange_end'] = "";
     57        if ($this->input->post('daterange')){
     58                        $daterange = explode(" - ", $this->input->post('daterange'));
     59                        $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
     60                        $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
     61                }
    5662        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    5763        $data['total'] = $this->collabolator_model->countCollaborator($data); 
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php

    r594 r690  
    5959            }
    6060        }
    61 
     61                $data['daterange_start'] = "";
     62                $data['daterange_end'] = "";
     63                if ($this->input->post('daterange')){
     64                        $daterange = explode(" - ", $this->input->post('daterange'));
     65                        $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
     66                        $data['daterange_end'] = date('Y-m-d 23:59:59', strtotime($daterange[1]));
     67                }
    6268        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    6369        $data['total'] = $this->paidlog_model->countPaidlog($data);
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php

    r584 r690  
    5555            $data['keyword'] = $this->input->post('keyword');
    5656        }
     57                $data['daterange_start'] = "";
     58                $data['daterange_end'] = "";
     59                if ($this->input->post('daterange')){
     60                        $daterange = explode(" - ", $this->input->post('daterange'));
     61                        $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
     62                        $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
     63                }
    5764                $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    5865                $data['total'] = $this->user_model->get_total_users($data);
     
    6269                foreach($us as $u) {
    6370                        $id = $u['us_id'];
    64                         $username = $this->get_username($id);
    65                         $u['username'] = $username;
    66                         array_push($users, $u);
     71                        //$username = $this->get_username($id);
     72                        $userinfo = $this->get_userinfo($id);
     73                        if($userinfo){
     74                                $u['username'] = $userinfo['username'];
     75                                $u['province'] = $userinfo['province'];
     76                                array_push($users, $u);
     77                        }
    6778                }
    6879               
     
    151162        }
    152163       
    153         private function get_username($us_id)
     164        private function get_userinfo($us_id)
    154165        {
    155166                $src = 'violet';
     
    158169                $data = $this->user_model->get_user_info($src, $us_id, $token);
    159170                //var_dump($data);
     171                $result = array();
     172                parse_str($data, $result);
     173                return $result;
     174                /*
    160175                if (strpos($data, '&')){
    161176                        $arr_users = explode("&", $data);
     
    166181                {
    167182                        return "";
    168                 }
     183                }*/
    169184
    170185        }
  • pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php

    r594 r690  
    1616        if ($data['keyword']) {
    1717            if ($data['search_field'] == "cellphone") {
    18                 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     18                                if(strlen($data['daterange_start'])>0){
     19                                        $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     20                                }else{
     21                                        $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     22                                }
    1923            } else {
    20                 $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
    21             }
    22         }
     24                                if(strlen($data['daterange_start'])>0){
     25                                        $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     26                                }else{
     27                                        $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     28                                }
     29            }
     30        }else{
     31                        if(strlen($data['daterange_start'])>0){
     32                                $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     33                        }
     34                }
    2335
    2436        $order = "";
     
    6577        if ($data['keyword']) {
    6678            if ($data['search_field'] == "cellphone") {
    67                 $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')";
     79                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
    6880            } else {
    69                 $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
     81                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
    7082            }
    7183        }
     
    92104        if ($data['keyword']) {
    93105            if ($data['search_field'] == "cellphone") {
    94                 $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')";
     106                $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     107                               
    95108            } else {
    96                 $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
    97             }
    98         }
     109                $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     110            }
     111        }
     112               
    99113       // $from = date("Y-m-d 00:00:00",$from);
    100114        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time, COUNT(tbluser.collaborator) as total_user  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." GROUP BY tblcollaborator.id ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
     
    123137        if ($data['keyword']) {
    124138            if ($data['search_field'] == "cellphone") {
    125                 $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%')";
     139                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
    126140            }
    127141        }
     
    151165        if ($data['keyword']) {
    152166            if ($data['search_field'] == "cellphone") {
    153                 $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%')";
     167                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
    154168            }
    155169        }
     
    184198        if ($data['keyword']) {
    185199            if ($data['search_field'] == "cellphone") {
    186                 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     200                                if(strlen($data['daterange_start'])>0){
     201                                        $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     202                                }else{
     203                                        $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     204                                }
    187205            } else {
    188                 $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') ";
    189             }
    190         }
     206                                if(strlen($data['daterange_start'])>0){
     207                                        $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     208                                }else{
     209                                        $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     210                                }
     211            }
     212        }else{
     213                        if(strlen($data['daterange_start'])>0){
     214                                $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     215                        }
     216                }
    191217        $result = $this->db->query($sql)->row_array();
    192218        return $result['total'];
  • pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php

    r586 r690  
    1818                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
    1919            }
    20         }
     20        }else{
     21                        if(strlen($data['daterange_start'])>0){
     22                               
     23                                $sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     24                                write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE);
     25                        }
     26                }
    2127
    2228        $order = "";
     
    4248                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
    4349            }
    44         }
     50        }else{
     51                        if(strlen($data['daterange_start'])>0){
     52                               
     53                                $sql.=" WHERE paid_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     54                                //write_file('./log/sql.log', date("m/d/Y H:i:s")." ".$sql."\n", FOPEN_WRITE_CREATE);
     55                        }
     56                }
     57               
    4558       
    4659        $result = $this->db->query($sql)->row_array();
  • pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php

    r610 r690  
    3434                        if (strlen($data['keyword'])>0){
    3535                                if ($data['status']==0){
    36                                         $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
     36                                        if(strlen($data['daterange_start'])>0){
     37                                                $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     38                                        }else
     39                                        {
     40                                                $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     41                                        }
    3742                                }else
    3843                                {
    39                                         $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
     44                                        if(strlen($data['daterange_start'])>0){
     45                                                $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     46                                        }else{
     47                                                $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     48                                        }
     49                                }
     50                        }else
     51                        {
     52                                if(strlen($data['daterange_start'])>0){
     53                                        if ($data['status']==0){
     54                                                $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     55                                        }else{
     56                                                $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     57                                        }
    4058                                }
    4159                        }
     
    6886                        if (strlen($data['keyword'])>0){
    6987                                if ($data['status']==0){
    70                                         $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
     88                                        if(strlen($data['daterange_start'])>0){
     89                                                $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     90                                        }else
     91                                        {
     92                                                $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     93                                        }
    7194                                }else
    7295                                {
    73                                         $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') ";
     96                                        if(strlen($data['daterange_start'])>0){
     97                                                $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     98                                        }else{
     99                                                $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     100                                        }
     101                                }
     102                        }else
     103                        {
     104                                if(strlen($data['daterange_start'])>0){
     105                                        if ($data['status']==0){
     106                                                $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     107                                        }else{
     108                                                $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     109                                        }
    74110                                }
    75111                        }
     112                       
    76113                }
    77114               
  • pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php

    r576 r690  
    1818                    $("#content").html(data);
    1919                    init_page();
    20 
     20                                        $('.daterangepicker').daterangepicker();
    2121                },
    2222                error: function (jqXHR, textStatus, errorThrown)
     
    3434        });
    3535       
     36                $(document).on('click', '.applyBtn', function(){
     37                        //$('#loading').css('display', 'block');
     38                        //$('#table_content').hide();
     39                        filter();
     40                });
    3641       
    3742        $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
     
    9297                $("#keyword").focus();
    9398                $("#keyword").setCursorToTextEnd();
     99                                $('.daterangepicker').daterangepicker();
    94100
    95101            },
  • pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php

    r590 r690  
    7272                                <div class="dataTables_filter" id="sample-table-2_filter">
    7373                                    <label>Tìm kiếm:
    74                                         <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
     74                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
    7575                                </div>
     76                                                                <div id="daterangepicker" class="selectbox pull-right">
     77                                                                        <i class="icon-calendar"></i>
     78                                                                        <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
     79                                                                               
     80                                                                        </span>
     81                                                                </div>
    7682                            </div>
    7783                        </div>
     
    8692                                <th class="<?php if ($sorting_field == 'full_name') {echo $sorting_order;} else {echo "sorting";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 183px;" aria-label="Họ tên: activate to sort column ascending">Họ tên</th>
    8793                                <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>
    88                                
     94                                <th>Quận/Huyện</th>
     95                                                                <th>Tỉnh/TP</th>
    8996                                <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">
    9097                                    <i class="icon-time bigger-110 hidden-480"></i>
     
    107114                                <td class=" "><a href="<?php echo base_url();?>admin/thong_ke_cong_tac_vien/<?php echo $collaborator['id'];?>"><?php echo $collaborator['full_name']?></a></td>
    108115                                <td class=" "><?php echo $collaborator['cellphone'];?></td>
    109                
     116                                                                <td class=" "><?php echo $collaborator['district'];?></td>
     117                                                                <td class=" "><?php echo $collaborator['province'];?></td>
    110118                                <td class=" "><?php echo $collaborator['created_time'];?></td>
    111119
  • pro-violet-viettel/sourcecode/application/modules/admin/views/home/editSms.php

    r585 r690  
    1  
     1
    22    <div class="modal-dialog">
    33        <div class="modal-content">
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php

    r461 r690  
    1818                    $("#content").html(data);
    1919                    init_page();
    20 
     20                                        $('.daterangepicker').daterangepicker();
    2121                },
    2222                error: function (jqXHR, textStatus, errorThrown)
     
    3333            return false;
    3434        });
    35        
     35        $(document).on('click', '.applyBtn', function(){
     36                        //$('#loading').css('display', 'block');
     37                        //$('#table_content').hide();
     38                        filter();
     39                });
    3640       
    3741        $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
     
    105109    function filter()
    106110    {
     111                daterange = $('input[name="daterange"]').val();
    107112        $.ajax({
    108113            url: '<?php echo base_url();?>admin/doanh_thu_tong_hop/trang/1',
     
    116121                $("#keyword").focus();
    117122                $("#keyword").setCursorToTextEnd();
    118 
     123                                $('.daterangepicker').daterangepicker();
     124                                $('input[name="daterange"]').val(daterange);
    119125            },
    120126            error: function (jqXHR, textStatus, errorThrown)
     
    204210</div><!-- /.modal-dialog -->
    205211<?php
    206 $this->load->view('layout/admin/footer', array('base_url' => $base_url));
     212$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js')));
    207213?>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php

    r573 r690  
    1 
     1
    22
    33   
     
    1313                        <div class="row">
    1414                            <div class="col-sm-6">
    15                                 <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị
     15                                <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị
    1616                                        <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">                                     
    1717                                            <?php foreach ($itemsoptions as $option) { ?>
    1818                                            <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option>
    1919                                            <?php } ?>
    20                                         </select> bản ghi</label>
     20                                        </select> bn ghi</label>
    2121
    2222                                </div>
     
    2525                            <div class="col-sm-6">
    2626                                <div class="dataTables_filter" id="sample-table-2_filter">
    27                                     <label>Tìm kiếm:
    28                                         <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
     27                                    <label>Tìm kiếm:
     28                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
    2929                                </div>
     30                                                                <div id="daterangepicker" class="selectbox pull-right">
     31                                                                        <i class="icon-calendar"></i>
     32                                                                        <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
     33                                                                               
     34                                                                        </span>
     35                                                                </div>
     36                                                                </div>
    3037                            </div>
    3138                        </div>
     
    3744                            <tr role="row">
    3845                               
    39                                 <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "";}?>" id="full_name" 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">Họ tên</th>
    40                                 <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: 283px;" aria-label="Họ tên: activate to sort column ascending">Số điện thoại</th>
    41                                 <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" 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ố tiền</th>
    42                                 <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th>
    43                                 <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_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">Ngày</th>
     46                                <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "";}?>" id="full_name" 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">Họ tên</th>
     47                                <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: 283px;" aria-label="Họ tên: activate to sort column ascending">Số điện thoại</th>
     48                                <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" 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ố tiền</th>
     49                                <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" 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">SMS/Card</th>
     50                                <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_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">Ngày</th>
    4451                                 
    4552                        </thead>
     
    7683
    7784                        </tbody></table><div class="row"><div class="col-sm-6">
    78                                 <div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> cá»§a <?php echo $total?> bản ghi</div>
     85                                <div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>
    7986                                   
    8087                            </div>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php

    r461 r690  
    1616                    $("#content").html(data);
    1717                    init_page();
     18                                        $('.daterangepicker').daterangepicker();
    1819                },
    1920                error: function (jqXHR, textStatus, errorThrown)
     
    2425            return false;
    2526        });
    26                 $('#keyword').bind('input', function(){
     27                $('#keyword').keyup(function (event) {
     28            if (event.keyCode == '13') {
     29                filter();
     30            }
     31            return false;
     32        });
     33                /*$('#keyword').bind('input', function(){
     34                        filter();
     35                });*/
     36                $('#daterange').keyup(function (event) {
     37            if (event.keyCode == '13') {
     38                filter();
     39            }
     40            return false;
     41        });
     42               
     43                $(document).on('click', '.applyBtn', function(){
     44                        $('#loading').css('display', 'block');
     45                        $('#table_content').hide();
    2746                        filter();
    2847                });
     
    5978        function filter()
    6079        {
     80                daterange = $('input[name="daterange"]').val();
    6181                $.ajax({
    6282                        url: '<?php echo base_url();?>admin/nguoi_dung/trang/1',
     
    6585                        success: function (data, textStatus, jqXHR)
    6686                        {
     87                                $('#loading').css('display', 'none');
     88                                $('#table_content').show();
    6789                                $("#content").html(data);
    6890                                init_page();
    6991                                $("#keyword").focus();
    7092                                $("#keyword").setCursorToTextEnd();
    71 
     93                                $('.daterangepicker').daterangepicker();
     94                                $('input[name="daterange"]').val(daterange);
    7295                        },
    7396                        error: function (jqXHR, textStatus, errorThrown)
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php

    r644 r690  
    6666                                <div class="dataTables_filter" id="sample-table-2_filter">
    6767                                    <label>Tìm kiếm:
    68                                         <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
     68                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
    6969                                </div>
    7070                                                                <div class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lọc:
    71                                                                         <select onchange="filter();" name="status" size="1" style="width: 139px; height: 28px;" aria-controls="sample-table-2" class="">                                     
     71                                                                        <select onchange="filter();" name="status" size="1" style="width: 176px; height: 28px;">                                     
    7272                                                                                <?php foreach ($statusoptions as $key=>$option):?>
    7373                                                                                <option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
    7474                                                                                <?php endforeach; ?>
    7575                                                                        </select>
     76                                                                </div>
     77                                                                <div style="clear: both;"></div>
     78                                                                <div id="daterangepicker" class="selectbox pull-right">
     79                                                                        <i class="icon-calendar"></i>
     80                                                                        <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
     81                                                                               
     82                                                                        </span>
     83                                                                </div>
    7684                                                                </div>
    7785                            </div>
     
    8290                                                <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
    8391                    </form>
     92                                        <!-- Table Content -->
     93                                        <center><div id="loading" style="display:none;"><img src="<?php echo base_url();?>/assets/img/loading.gif"/></div></center>
     94                                        <div id="table_content">
    8495                    <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
    8596                        <thead>
     
    91102                                    </label>
    92103                                </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>
    94                                 <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: 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">
     104                                                                <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: 156px;" aria-label="Tài khoản: activate to sort column ascending">Username</th>
     105                                <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: 156px;" aria-label="Số điện thoại: activate to sort column ascending">Số điện thoại</th>
     106                                <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: 156px;" aria-label="Tiền: activate to sort column ascending">Tài khoản (VNĐ)</th>
     107                                                                <th style="width: 140px;">Quận/Huyện</th>
     108                                                                <th style="width: 140px;">Tỉnh/TP</th>
     109                                <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: 156px;" aria-label="Ngày đăng kÜ: activate to sort column ascending">
    97110                                    <i class="icon-time bigger-110 hidden-480"></i>
    98111                                    Ngày đăng kÜ
    99112                                </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: 150px;" aria-label="Ngày hết hạn: activate to sort column ascending">
     113                                                                <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: 140px;" aria-label="Ngày hết hạn: activate to sort column ascending">
    101114                                    <i class="icon-time bigger-110 hidden-480"></i>
    102115                                    Ngày hết hạn
    103116                                </th>
    104                                                                 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;">Tình trạng</th>
     117                                                                <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Tình trạng</th>
    105118                            </tr>
    106119                        </thead>
     
    119132                                </td>
    120133                                                                <td class=" ">
    121                                     <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo @$user['username']; ?></a>
     134                                    <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo $user['username']; ?></a>
    122135                                                                         <!--<a href="#user-history" data-toggle="modal"><?php echo @$user['username']; ?></a>-->
    123136                                </td>
     
    126139                                </td>
    127140                                <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
     141                                                                <td><?php echo $user['district']; ?></td>
     142                                                                <td><?php echo $user['province']; ?></td>
    128143                                <td class=" "><?php echo $user['created_time']; ?></td>
    129144                                                                <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date'])>0 ? date('d/m/Y', strtotime($user['expire_date'])) : '';?></td>
     145
    130146                                                                <td class=" ">
    131147                                                                <?php  if(strtotime($user['expire_date'])>time()){ ?>
     
    151167                                                                </div>
    152168                                                        </div>
     169                                                </div>
    153170                                                </div>
    154171
     
    249266    }
    250267
    251 
    252268</script>
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php

    r647 r690  
    2929            $data['packages'] = $this->servicepackage_model->getAllPackages();
    3030            $data['is_viettel'] = $user_info['is_viettel'];
    31            
    32             $data = array_merge($data, $u);
     31                        $data = array_merge($data, $u);
    3332            $data = array_merge($data, $user_info);
    3433                       
     
    358357                        foreach ($result as $paidlog):
    359358                                $paidlog['amount'] = number_format($paidlog['amount'], 0);
    360                                 $paidlog['paid_time'] = date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));
     359                                $paidlog['paid_time'] = date('d/m/Y H:i:s', strtotime($paidlog['paid_time']));
    361360                                array_push($paidlogs, $paidlog);
    362361                        endforeach;
  • pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r673 r690  
    8686                $this->load->model('frontend/Servicepackage_model');
    8787                                $trialpackage=$this->Servicepackage_model->getTrialPackage();
    88                                 $us_id = $id;
     88                                $us_id = $id;
    8989                                $user ['created_time'] = date ( 'Y-m-d H:i:s' );
    9090                                $user ['us_id'] = $us_id;
    91                                 $user ['p_id'] = $trialpackage['p_id'];
    92                                 $user ['expire_date'] = date('Y-m-d', strtotime("+" . $this->config->item("trial_period") . " days", time()));
     91                                $user ['p_id'] = $trialpackage['p_id'];
     92                                $user ['expire_date'] = date('Y-m-d', strtotime("+" . $this->config->item("trial_period") . " days", time()));
    9393                                $user ['cellphone'] = $username;
     94                                $user['province'] = $province;
    9495                                if (! is_null ( $collaborator ) || $collaborator != '') {
    9596                                        $user ['collaborator'] = $collaborator;
     
    163164                                'oldpass' => $user ['oldpass']
    164165                ), 'user' );
     166                $u = array('province'=>$user['province'],
     167                                'district'=>$user['district'],
     168                                'updated_time'=>date('Y-m-d H:i:s')
     169                                );
     170                $this->db->where('us_id', $us_id);
     171                $this->db->update('tbluser', $u);
    165172                return $data;
    166173        }
  • pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php

    r672 r690  
    101101
    102102                                                    <div class="col-sm-8">
    103                                                         <input type="text" name="province" value="<?php echo @$province; ?>" placeholder="Tỉnh / Thành phố" id="form-field-username" class="col-xs-12 col-sm-10">
     103                                                        <input type="text" name="province" value="<?php echo @$province; ?>" placeholder="Tỉnh / Thành phố" id="form-field-province" class="col-xs-12 col-sm-10">
     104                                                    </div>
     105                                                </div>
     106                                                                                                <div class="form-group">
     107                                                    <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Quận / Huyện</label>
     108
     109                                                    <div class="col-sm-8">
     110                                                        <input type="text" name="district" value="<?php echo @$district; ?>" placeholder="Quận / Huyện" id="form-field-district" class="col-xs-12 col-sm-10">
    104111                                                    </div>
    105112                                                </div>
  • pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php

    r623 r690  
    4242<script src="<?php echo $base_url; ?>assets/js/ace.min.js"></script>
    4343
     44<script src="<?php echo $base_url; ?>assets/js/date-time/moment.min.js"></script>
     45<script src="<?php echo $base_url; ?>assets/js/date-time/daterangepicker.min.js"></script>
     46
    4447<!-- inline scripts related to this page -->
    4548
    4649<script type="text/javascript">
     50        $('.daterangepicker').daterangepicker();
    4751    jQuery(function ($) {
    4852
  • pro-violet-viettel/sourcecode/application/views/layout/admin/header.php

    r644 r690  
    2222                <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace-rtl.min.css" />
    2323                <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace-skins.min.css" />
    24                 <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/custom.css" />
     24        <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/custom.css" />
     25                <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/daterangepicker.css" />
     26               
     27               
    2528                <script src="<?php echo $base_url;?>assets/js/ace-extra.min.js"></script>
    2629
  • pro-violet-viettel/sourcecode/assets/js/admin/user.js

    r645 r690  
    6666                                for (var i in result)
    6767                                {
    68                                         content += '<tr><td class="center">'+result[i].source+'</td><td class="center">'+result[i].amount+'</td><td>'+result[i].paid_time+'</td></tr>';
    69                                        
     68                                        source = result[i].source;
     69                                        if (result[i].source == null || result[i].source == '') source = 'Thẻ cào';
     70                                        content += '<tr><td class="center">'+source+'</td><td class="center">'+result[i].amount+'</td><td>'+result[i].paid_time+'</td></tr>';                           
    7071                                }
    7172                        }else
  • pro-violet-viettel/sourcecode/assets/js/frontend/user.js

    r656 r690  
    226226                                for (var i in result)
    227227                                {
    228                                         content += '<tr><td class="center">'+result[i].source+'</td><td class="center">'+result[i].p_name+'</td><td>'+result[i].created_time+'</td></tr>';
     228                                        source = result[i].source;
     229                                        if (result[i].source == null || result[i].source == '') source = 'Thẻ cào';
     230                                        content += '<tr><td class="center">'+source+'</td><td class="center">'+result[i].p_name+'</td><td>'+result[i].created_time+'</td></tr>';
    229231                                       
    230232                                }
Note: See TracChangeset for help on using the changeset viewer.