Changeset 354


Ignore:
Timestamp:
Oct 30, 2014 6:21:10 PM (11 years ago)
Author:
quyenla
Message:

collaborator

Location:
pro-violet-viettel/sourcecode/application/modules/admin
Files:
3 edited

Legend:

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

    r345 r354  
    1717        if ($admin_info) {
    1818            $data['content'] = $this->getCollaborators();
    19             $this->parser->parse('collaborator/index',$data);
     19            $this->load->view('collaborator/index',$data);
    2020        } else {
    2121            $this->load->view('login');
     
    2424    public function getCollaborators($filters=array())
    2525    {
    26         $this->load->driver("pp");
     26 
    2727        $data['current_page'] = $this->uri->segment(4,1);
    2828        $data['itemsoptions']=array(10,25,50,100);
    29         $data['perpage'] = 10;   
     29        $data['perpage'] = 10;   
     30       
    3031        if ($this->input->post('items'))
    3132        {
    3233        $data['perpage'] = $this->input->post('items');   
    3334        }
    34        
     35        $sql="SELECT * FROM tblcollaborator";
    3536        $data['keyword']='';
    36         $sql=" FROM Entities\Tblcollaborator c";
     37       
    3738        if ($this->input->post('keyword'))
    3839        {
    39         $sql.=" WHERE c.full_name LIKE '%".$this->input->post('keyword')."%'";
    40         $data['keyword']=$this->input->post('keyword');
     40        $sql.=" WHERE (full_name LIKE '%".$this->input->post('keyword')."%' OR login_name LIKE '%".$this->input->post('keyword')."%')";
    4141        }
    42        
    43         $query = $this->doctrine->em->createQuery('SELECT COUNT(c.id) '.$sql);
    44         $data['total'] = $query->getSingleScalarResult();
    45        
    46         $query = $this->doctrine->em->createQuery('SELECT c '.$sql);
    47         $query->setFirstResult(($data['current_page']-1)*$data['perpage']);
    48         $query->setMaxResults($data['perpage']);
    49         $data['collaborators'] = $query->getArrayResult();
    50        
    51        
     42
     43        $data['total']=500;
     44        $data['start']=($data['current_page']-1)*$data['perpage'];
     45        $query = $this->db->query($sql." LIMIT ".$data['start'].", ".$data['perpage']."");
     46        $data['collaborators']=$query->result_array();
    5247        $this->load->library('pagination');
    5348        $url = "http://$_SERVER[HTTP_HOST]/admin/cong_tac_vien/trang/";
     
    7974
    8075        if ($this->input->is_ajax_request()) {
    81         return $this->pp->parse('modules/admin/views/collaborator/listview', $data);   
     76        return $this->load->view('collaborator/listview', $data);   
    8277        }
    83         return $this->pp->parse('modules/admin/views/collaborator/listview', $data,true);   
     78        return $this->load->view('collaborator/listview', $data,true);   
    8479    }
    8580    public function test() {
     81        $data=$this->db->get_where('tblcollaborator');
     82        print_r ($data->result_array());
     83        die();
    8684        for ($i = 1; $i <= 500; $i++) {
    8785            $collaborator = new Entities\Tblcollaborator();
  • pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php

    r345 r354  
    6262</script>
    6363<div class="main-content" id="content">
    64     {content}
     64    <?php echo $content; ?>
    6565</div><!-- /.main-content -->
    6666</div><!-- /.main-container-inner -->
  • pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php

    r345 r354  
    11<div id="breadcrumbs" class="breadcrumbs">
    2     <script type="text/javascript">
    3         try{literal}{{/literal}ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    4     </script>
    52
    63    <ul class="breadcrumb">
     
    5552                <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper">
    5653                    <form onsubmit="return false;" id="collaborator" >
    57                     <div class="row">
    58                         <div class="col-sm-6">
    59                             <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị
    60                                     <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">                                     
    61                                         {foreach from=$itemsoptions item=option}
    62                                         <option {if ({$option}=={$perpage})} selected{/if} value="{$option}">{$option}</option>
    63                                         {/foreach}
    64                                     </select> bản ghi</label>
    65                            
     54                        <div class="row">
     55                            <div class="col-sm-6">
     56                                <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị
     57                                        <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">                                     
     58                                            <?php foreach ($itemsoptions as $option) { ?>
     59                                            <option <?php if($option == $perpage) echo "selected"; ?> value="<?=$option?>"><?=$option?></option>
     60                                            <?php } ?>
     61                                        </select> bản ghi</label>
     62
     63                                </div>
     64                            </div>
     65
     66                            <div class="col-sm-6">
     67                                <div class="dataTables_filter" id="sample-table-2_filter">
     68                                    <label>Tìm kiếm:
     69                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
     70                                </div>
    6671                            </div>
    6772                        </div>
    68                        
    69                         <div class="col-sm-6">
    70                             <div class="dataTables_filter" id="sample-table-2_filter">
    71                                 <label>Tìm kiếm:
    72                                     <input type="text" name="keyword" id="keyword" value='{$keyword}' aria-controls="sample-table-2"></label>
    73                             </div>
    74                         </div>
    75                     </div>
    7673                    </form>
    7774                    <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
    7875                        <thead>
    79                             <tr role="row"><th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">
     76                            <tr role="row">
     77                                <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">
    8078                                    <label>
    8179                                        <input type="checkbox" class="ace">
    8280                                        <span class="lbl"></span>
    8381                                    </label>
    84                                 </th><th class="sorting" 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><th class="sorting" 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><th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiền: activate to sort column ascending">Tiền</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="
    85 
    86                                                                                                                                                                                                         Ngày đăng kÜ
    87                                                                                                                                                                                                         : activate to sort column ascending">
     82                                </th>
     83                                <th class="sorting" 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>
     84                                <th class="sorting" 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>
     85                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiền: activate to sort column ascending">Tiền</th>
     86                                <th class="sorting" 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">
    8887                                    <i class="icon-time bigger-110 hidden-480"></i>
    8988                                    Ngày đăng kÜ
    90                                 </th><th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Trạng thái: activate to sort column ascending">Trạng thái</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
     89                                </th>
     90                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Trạng thái: activate to sort column ascending">Trạng thái</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
    9191                        </thead>
    9292
    9393
    9494                        <tbody role="alert" aria-live="polite" aria-relevant="all">
    95                             {foreach from=$collaborators item=collaborator}
     95                           
     96                            <?php
     97                            foreach ($collaborators as $collaborator) {
     98                                ?>
    9699                            <tr class="odd">
    97100                                <td class="center  sorting_1">
     
    103106
    104107                                <td class=" ">
    105                                     <a href="#">{$collaborator.cellphone}</a>
    106                                 </td>
    107                                 <td class=" ">{$collaborator.full_name}</td>
     108                                    <a href="#"><?php echo $collaborator['cellphone']?></a>
     109                                </td>
     110                                <td class=" "><?php echo $collaborator['full_name']?></td>
    108111                                <td class="hidden-480 ">3,330 VND</td>
    109                                 <td class=" ">{$collaborator.created_time}</td>
     112                                <td class=" "><?php echo $collaborator['created_time']?></td>
    110113
    111114                                <td class="hidden-480 ">
    112                                     {if ({$collaborator.activated})==1}
    113                                     <span class="label label-sm label-success">Kích hoạt</span>
    114                                     {/if}
    115                                     {if ({$collaborator.activated})==0}
     115                                    <?php if ( $collaborator['activated']==1)
     116                                    {?>
     117                                    <span class="label label-sm label-success">Đã kích hoạt</span>
     118                                    <?php
     119                                    } else
     120                                    {
     121                                    ?>
    116122                                    <span class="label label-sm label-default">Chưa kích hoạt</span>
    117                                     {/if}
     123                                    <?php
     124                                    }
     125                                    ?>
    118126                                </td>
    119127
     
    168176                                </td>
    169177                            </tr>
    170                             {/foreach}
    171 
    172 
    173                            
    174                        
    175                        
    176                        
    177                        
    178                         </tbody></table><div class="row"><div class="col-sm-6"><div class="dataTables_info" id="sample-table-2_info">Hiển thị 1 đến 2 cá»§a 2 bản ghi</div></div>
    179                             <div class="col-sm-6">
    180                                 <div class="dataTables_paginate paging_bootstrap">
    181                                     <ul class="pagination">
    182                                         {$paging}
    183                                     </ul>
    184                                 </div>
     178                            <?php } ?>
     179
     180
     181
     182
     183
     184
     185
     186                        </tbody></table><div class="row"><div class="col-sm-6">
     187                                <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>
     188                                   
     189                            </div>
     190                        <div class="col-sm-6">
     191                            <div class="dataTables_paginate paging_bootstrap">
     192                                <ul class="pagination">
     193                                    <?php echo $paging; ?>
     194                                </ul>
    185195                            </div>
    186196                        </div>
    187                    
     197                    </div>
     198
    188199                </div>
    189200            </div>
     
    257268</div>
    258269<script type="text/javascript">
    259             window.onload = function ()
    260 {
    261 init_page();
    262 }
     270    window.onload = function ()
     271    {
     272        init_page();
     273    }
    263274
    264275
Note: See TracChangeset for help on using the changeset viewer.