Changeset 742


Ignore:
Timestamp:
Feb 4, 2015 2:58:53 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/reportAsistant.php

    r741 r742  
    179179        }
    180180
     181                $data['daterange_start'] = "";
     182                $data['daterange_end'] = "";
     183                if ($this->input->post('daterange')){
     184                        $daterange = explode(" - ", $this->input->post('daterange'));
     185                        $daterange[0] = str_replace('/', '-', $daterange[0]);
     186                        $daterange[1] = str_replace('/', '-', $daterange[1]);
     187                        $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
     188                        $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
     189                }
     190               
    181191        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
    182192        $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data);
  • pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php

    r690 r742  
    5959                if ($this->input->post('daterange')){
    6060                        $daterange = explode(" - ", $this->input->post('daterange'));
     61                        $daterange[0] = str_replace('/', '-', $daterange[0]);
     62                        $daterange[1] = str_replace('/', '-', $daterange[1]);
    6163                        $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0]));
    6264                        $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day'));
  • pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php

    r741 r742  
    149149       // $from = date("Y-m-d 00:00:00",$from);
    150150        //$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." AND tbluser.collaborator = ".$data['id']." ".$order."";
    151    
    152         $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order."";
    153 
     151                if(strlen($data['daterange_start'])>0){
     152                        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order."";
     153                }else{
     154                        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order."";
     155                }       
    154156                $result = $this->db->query($sql)->result_array();
    155157        foreach ($result as $index=>$paidlog)
     
    174176        if ($data['keyword']) {
    175177            if ($data['search_field'] == "cellphone") {
    176                 $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";
     178                $where.=" WHERE (tbluser.cellphone LIKE '%" . $data['keyword'] . "%' OR tblcollaborator.district LIKE '%".$data['keyword']."%' OR tblcollaborator.province LIKE '%".$data['keyword']."%')";
    177179            }
    178180        }
    179181       // $from = date("Y-m-d 00:00:00",$from);
    180182       // $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." AND tbluser.collaborator = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
    181                
    182         $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
    183 
     183                if(strlen($data['daterange_start'])>0){
     184                        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
     185                }else{
     186                        $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time  FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
     187                }
    184188                $result = $this->db->query($sql)->result_array();
    185189        foreach ($result as $index=>$paidlog)
  • pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/index.php

    r462 r742  
    3434        });
    3535       
     36                $('#daterange').keyup(function (event) {
     37            if (event.keyCode == '13') {
     38                filter();
     39                                console.log("OK");
     40            }
     41            return false;
     42        });
    3643       
    3744        $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
  • pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/indexCollaborator.php

    r490 r742  
    77    function init_page()
    88    {
     9                /*
     10                if($('input[name="daterange"]').val() !== ""){
     11                        $('#remove').click(function(){
     12                                $('input[name="daterange"]').val("");
     13                                filter();
     14                        });
     15                }*/
    916
    1017        $(".ajax_paging").click(function () {
     
    1825                    $("#content").html(data);
    1926                    init_page();
    20 
     27                                        $('.daterangepicker').daterangepicker({
     28                                                format: 'DD/MM/YYYY'
     29                                        });
     30                                       
    2131                },
    2232                error: function (jqXHR, textStatus, errorThrown)
     
    3444        });
    3545       
     46                $(document).on('click', '.applyBtn', function(){
     47                        $('#loading').css('display', 'block');
     48                        $('#table_content').hide();
     49                        filter();
     50                });
     51               
     52                $('#daterange').keyup(function (event) {
     53            if (event.keyCode == '13') {
     54                filter();
     55            }
     56            return false;
     57        });
    3658       
    3759        $( '.sorting, .sorting_desc, .sorting_asc' ).click(function( index ) {
     
    105127    function filter()
    106128    {
     129                daterange = $('input[name="daterange"]').val();
    107130        $.ajax({
    108131            url: '<?php echo base_url();?>admin/thong_ke_cong_tac_vien/trang_ctv/<?php echo $id;?>/1',
     
    113136                // $result = jQuery.parseJSON(data);
    114137                $("#content").html(data);
    115                 init_page();
     138               
    116139                $("#keyword").focus();
    117140                $("#keyword").setCursorToTextEnd();
    118 
     141                                $('.daterangepicker').daterangepicker({
     142                                        format: 'DD/MM/YYYY'
     143                                });
     144                                $('input[name="daterange"]').val(daterange);
     145                                init_page();
    119146            },
    120147            error: function (jqXHR, textStatus, errorThrown)
  • pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php

    r737 r742  
    2626                                <div class="dataTables_filter" id="sample-table-2_filter">
    2727                                    <label>Tìm kiếm:
    28                                         <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
     28                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
     29                                </div>
     30                                                                <div style="clear: both;"></div>
     31                                <div id="daterangepicker" class="selectbox pull-right">
     32                                    <i class="icon-calendar"></i>
     33                                                                        <!--<i id="remove" class="btn-sm btn-danger icon-remove"></i>-->
     34                                    <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
    2935                                </div>
    3036                            </div>
     
    3642                        <thead>
    3743                            <tr role="row">                               
    38                                 <!--<th class="<?php if ($sorting_field == 'full_name') {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">Tên người dùng</th>-->
    39                                 <th class="<?php if ($sorting_field == 'collaborator_cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_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 người dùng</th>
     44                                <th class="<?php if ($sorting_field == 'full_name') {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">Tên người dùng</th>
     45                                <th class="<?php if ($sorting_field == 'collaborator_cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_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 thuê bao</th>
    4046                                <th class="<?php if ($sorting_field == 'total_user') {echo $sorting_order;} else {echo "sorting";}?>" id="total_user" 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">Ngày giới thiệu</th> 
    4147                                <!--<th class="<?php if ($sorting_field == 'collaborator_created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_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">Ngày đăng kÜ</th>-->
     
    5157                            <tr class="odd">
    5258                               
    53 
    54                                 <!--<td class=" ">
     59                                                               
     60                                <td class=" ">
    5561                                                                        <?php echo $paidlog['username']; ?>                                   
    56                                 </td>-->
     62                                </td>
    5763                                <td class=" "><?php echo $paidlog['user_cellphone']?></td>                               
    5864                                <td class="hidden-480 "><?php echo $paidlog['user_created_time'];?></td>
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php

    r690 r742  
    1616                    $("#content").html(data);
    1717                    init_page();
    18                                         $('.daterangepicker').daterangepicker();
     18                                        $('.daterangepicker').daterangepicker({
     19                                                format: 'DD/MM/YYYY'
     20                                        });
    1921                },
    2022                error: function (jqXHR, textStatus, errorThrown)
     
    8890                                $('#table_content').show();
    8991                                $("#content").html(data);
    90                                 init_page();
    9192                                $("#keyword").focus();
    9293                                $("#keyword").setCursorToTextEnd();
    93                                 $('.daterangepicker').daterangepicker();
     94                                $('.daterangepicker').daterangepicker({
     95                                        format: 'DD/MM/YYYY'
     96                                });
    9497                                $('input[name="daterange"]').val(daterange);
     98                                init_page();
    9599                        },
    96100                        error: function (jqXHR, textStatus, errorThrown)
  • pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php

    r737 r742  
    7979                                    <i class="icon-calendar"></i>
    8080                                    <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
    81 
    82                                     </span>
    8381                                </div>
    8482                            </div>
  • pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php

    r735 r742  
    4848
    4949<script type="text/javascript">
    50         $('.daterangepicker').daterangepicker();
    51 
     50        $('.daterangepicker').daterangepicker({
     51                format: 'DD/MM/YYYY'
     52        });
     53       
    5254    function show_box(id) {
    5355        jQuery('.widget-box.visible').removeClass('visible');
Note: See TracChangeset for help on using the changeset viewer.