Changeset 769


Ignore:
Timestamp:
Mar 1, 2015 8:44:12 PM (10 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/admin
Files:
5 edited

Legend:

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

    r767 r769  
    3939                $data ['statusoptions'] = array (
    4040                                0 => "Tất cả",
    41                                 1 => "Đã đăng kÜ",
    42                                 2 => "Dùng thá»­",
     41                                1 => "Đã đăng kÜ VIP",
     42                                2 => "Dùng thá»­ 7 ngày",
    4343                                3=> "Dùng thá»­ hạn chế",
    4444                                4=> "Hết hạn"
     
    4747                if ($this->input->post ( 'status' )) {
    4848                        $data ['status'] = ( int ) $this->input->post ( 'status' );
     49                }
     50                $data['provinces'] = $provinces;
     51                $data['province_code'] = '';
     52                if ($this->input->post ( 'province-code' )) {
     53                        $data ['province_code'] = $this->input->post ( 'province-code' );
    4954                }
    5055                $data ['keyword'] = "";
  • pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php

    r767 r769  
    4040                        if (strlen($data['keyword'])>0){
    4141                                if ($data['status']==0){
    42                                         if(strlen($data['daterange_start'])>0){
    43                                                 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
    44                                         }else
    45                                         {
    46                                                 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     42                                        if (strlen($data['province_code'])>0){
     43                                                if(strlen($data['daterange_start'])>0){
     44                                                        $sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     45                                                }
     46                                        }else{
     47                                                if(strlen($data['daterange_start'])>0){
     48                                                        $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     49                                                }else
     50                                                {
     51                                                        $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     52                                                }
    4753                                        }
    4854                                }else
    4955                                {
    50                                         if(strlen($data['daterange_start'])>0){
    51                                                 $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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']."')";
    52                                         }else{
    53                                                 $sql.=" AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     56                                        if (strlen($data['province_code'])>0){
     57                                                if(strlen($data['daterange_start'])>0){
     58                                                        $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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']."')";
     59                                                }else{
     60                                                        $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     61                                                }
    5462                                        }
    5563                                }
     
    5866                                if(strlen($data['daterange_start'])>0){
    5967                                        if ($data['status']==0){
    60                                                 $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     68                                                if (strlen($data['province_code'])>0){
     69                                                        $sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     70                                                }else{
     71                                                        $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     72                                                }
    6173                                        }else{
    62                                                 $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
    63                                         }
     74                                                if (strlen($data['province_code'])>0){
     75                                                        $sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     76                                                }else{
     77                                                        $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     78                                                }
     79                                        }               
     80                                }
     81                                else{
     82                                        if ($data['status']==0){
     83                                                if (strlen($data['province_code'])>0){
     84                                                        $sql.=" WHERE province = '".$data['province_code']."'";
     85                                                }
     86                                        }else{
     87                                                if (strlen($data['province_code'])>0){
     88                                                        $sql.=" AND province = '".$data['province_code']."'";
     89                                                }
     90                                        }               
    6491                                }
    6592                        }
     
    98125                        if (strlen($data['keyword'])>0){
    99126                                if ($data['status']==0){
    100                                         if(strlen($data['daterange_start'])>0){
    101                                                 $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']."')";
    102                                         }else
    103                                         {
    104                                                 $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']."%')";
     127                                        if (strlen($data['province_code'])>0){
     128                                                if(strlen($data['daterange_start'])>0){
     129                                                        $sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     130                                                }
     131                                        }else{
     132                                                if(strlen($data['daterange_start'])>0){
     133                                                        $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     134                                                }else
     135                                                {
     136                                                        $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     137                                                }
    105138                                        }
    106139                                }else
    107140                                {
    108                                         if(strlen($data['daterange_start'])>0){
    109                                                 $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']."')";
    110                                         }else{
    111                                                 $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']."%') ";
     141                                        if (strlen($data['province_code'])>0){
     142                                                if(strlen($data['daterange_start'])>0){
     143                                                        $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced 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']."')";
     144                                                }else{
     145                                                        $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') ";
     146                                                }
    112147                                        }
    113148                                }
     
    116151                                if(strlen($data['daterange_start'])>0){
    117152                                        if ($data['status']==0){
    118                                                 $sql.=" WHERE created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     153                                                if (strlen($data['province_code'])>0){
     154                                                        $sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'";
     155                                                }else{
     156                                                        $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     157                                                }
    119158                                        }else{
    120                                                 $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
    121                                         }
     159                                                if (strlen($data['province_code'])>0){
     160                                                        $sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     161                                                }else{
     162                                                        $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";
     163                                                }
     164                                        }               
     165                                }
     166                                else{
     167                                        if ($data['status']==0){
     168                                                if (strlen($data['province_code'])>0){
     169                                                        $sql.=" WHERE province = '".$data['province_code']."'";
     170                                                }
     171                                        }else{
     172                                                if (strlen($data['province_code'])>0){
     173                                                        $sql.=" AND province = '".$data['province_code']."'";
     174                                                }
     175                                        }               
    122176                                }
    123177                        }
    124                        
    125178                }
    126179               
  • pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/index.php

    r461 r769  
    2424            return false;
    2525        });
     26                /*
    2627                $('#keyword').bind('input', function(){
    2728                        filter();
    28                 });
     29                });*/
     30                $('#keyword').keyup(function (event) {
     31            if (event.keyCode == '13') {
     32                filter();
     33            }
     34            return false;
     35        });
    2936               
    3037                $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
  • pro-violet-viettel/sourcecode/application/modules/admin/views/smslog/listview.php

    r573 r769  
    6363                                                                </th>
    6464                                                        <th class="<?php if ($sorting_field == 'sender') {echo $sorting_order;} else {echo "sorting";} ?>" id="sender" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Người gá»­i: activate to sort column ascending">Người gá»­i</th>
    65                                                         <th class="<?php if ($sorting_field == 'service_id') {echo $sorting_order;} else {echo "sorting";} ?>" id="service_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Dịch vụ: activate to sort column ascending">Dịch vụ</th>
     65                                                        <!--<th class="<?php if ($sorting_field == 'service_id') {echo $sorting_order;} else {echo "sorting";} ?>" id="service_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Dịch vụ: activate to sort column ascending">Dịch vụ</th>
    6666                                                        <th class="<?php if ($sorting_field == 'commandcode') {echo $sorting_order;} else {echo "sorting";} ?>" id="commandcode" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Mã lệnh: activate to sort column ascending">Mã lệnh</th>
    67                                                         <th class="<?php if ($sorting_field == 'info') {echo $sorting_order;} else {echo "sorting";} ?>" id="info" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="ThÃŽng tin: activate to sort column ascending">ThÃŽng tin</th>
     67                                                        -->
     68                                                        <th class="<?php if ($sorting_field == 'info') {echo $sorting_order;} else {echo "sorting";} ?>" id="info" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="ThÃŽng tin: activate to sort column ascending">Cú pháp</th>
    6869                                                        <th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";} ?>" id="created_time" class="hidden-480" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Thời gian: activate to sort column ascending">
    6970                                                                <i class="icon-time bigger-110 hidden-480"></i>
    7071                                                                Thời gian gá»­i
     72                                                        </th>
     73                                                        <th class="<?php if ($sorting_field == 'reply') {echo $sorting_order;} else {echo "sorting";} ?>" id="reply" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Trả lời: activate to sort column ascending">Trả lời</th>
     74                                                        <th class="<?php if ($sorting_field == 'response_time') {echo $sorting_order;} else {echo "sorting";} ?>" id="response_time" class="hidden-480" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Thời gian: activate to sort column ascending">
     75                                                                <i class="icon-time bigger-110 hidden-480"></i>
     76                                                                Thời gian trả lời
    7177                                                        </th>
    7278                                                </tr>
     
    8692                                                                <?php echo $smslog['sender']; ?>
    8793                                                        </td>
    88                                                         <td><?php echo $smslog['servicename']; ?></td>
     94                                                        <!--<td><?php echo $smslog['servicename']; ?></td>
    8995                                                        <td><?php echo $smslog['commandcode']; ?></td>
     96                                                        -->
    9097                                                        <td><?php echo $smslog['info']; ?></td>
    9198                                                        <td><?php echo $smslog['created_time']; ?></td>
     99                                                        <td><?php echo trim(preg_replace('/\s+/', ' ', $smslog['mtbody'])); ?></td>
     100                                                        <td><?php echo $smslog['response_time']; ?></td>
    92101                                                </tr>
    93102                                                <?php endforeach; ?>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php

    r767 r769  
    6868                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword; ?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
    6969                                </div>
    70                                 <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: 176px; height: 28px;">                                     
    72                                             <?php foreach ($statusoptions as $key => $option): ?>
    73                                                 <option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
    74                                             <?php endforeach; ?>
    75                                         </select>
    76                                 </div>
     70                                <div class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lọc theo tình trạng:
     71                                                                        <select onchange="filter();" name="status" size="1" style="width: 176px; height: 28px;">                                     
     72                                                                                <?php foreach ($statusoptions as $key => $option): ?>
     73                                                                                        <option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
     74                                                                                <?php endforeach; ?>
     75                                                                        </select>
     76                                </div>
     77                                                                <div style="clear: both;"></div>
     78                                                                <div class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lọc theo Tỉnh/TP:
     79                                                                        <select onchange="filter();" name="province-code" size="1" style="width: 176px; height: 28px;">
     80                                                                                <option value=''></option>
     81                                                                                <?php foreach ($provinces as $key => $pro): ?>
     82                                                                                        <option <?php if ($key == $province_code) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $pro; ?></option>
     83                                                                                <?php endforeach; ?>
     84                                                                        </select>
     85                                </div>
     86                                                               
    7787                                <div style="clear: both;"></div>
    7888                                <div id="daterangepicker" class="selectbox pull-right">
     
    114124                                }
    115125                                ?>" 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">Họ tên</th>
    116                                                                 <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>
     126                                                               
    117127                                <th class="<?php
    118128                                if ($sorting_field == 'acc_balanced') {
     
    143153                                </th>
    144154                                <th style="width: 140px;">Tỉnh/TP</th>
    145                                
     155                                <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>
    146156                            </tr>
    147157                        </thead>
     
    166176                                        <?php echo $user['fullname']; ?>
    167177                                    </td>
     178                                    <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
     179                                                                        <td class=" "><?php echo $user['created_time']; ?></td>
     180                                    <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td>
     181                                    <td><?php echo $user['province']; ?></td>
    168182                                                                        <td class=" ">
    169183                                                                        <?php if (strtotime($user['expire_date']) > time() && $user['p_id'] != 5 ): ?>
    170                                                                                 <span class="label label-sm label-success">Đã đăng kÜ</span>
     184                                                                                <span class="label label-sm label-success">Đã đăng kÜ VIP</span>
    171185                                                                        <?php elseif(strtotime($user['expire_date']) > time() && $user['p_id'] == 5): ?>
    172                                                                                 <span class="label label-sm label-info">Dùng thá»­</span>
     186                                                                                <span class="label label-sm label-info">Dùng thá»­ 7 ngày</span>
    173187                                                                        <?php elseif(strtotime($user['expire_date']) < time() && $user['p_id'] == 5): ?>
    174188                                                                                <span class="label label-sm label-warning">Dùng thá»­ hạn chế</span>
     
    177191                                                                        <?php endif; ?>
    178192                                    </td>
    179                                     <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
    180                                                                         <td class=" "><?php echo $user['created_time']; ?></td>
    181                                     <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td>
    182                                     <td><?php echo $user['province']; ?></td>
    183 
    184193                                </tr>
    185194                                                        <?php endforeach; ?>
Note: See TracChangeset for help on using the changeset viewer.