Changeset 354 for pro-violet-viettel/sourcecode/application
- Timestamp:
- Oct 30, 2014 6:21:10 PM (11 years ago)
- 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 17 17 if ($admin_info) { 18 18 $data['content'] = $this->getCollaborators(); 19 $this-> parser->parse('collaborator/index',$data);19 $this->load->view('collaborator/index',$data); 20 20 } else { 21 21 $this->load->view('login'); … … 24 24 public function getCollaborators($filters=array()) 25 25 { 26 $this->load->driver("pp");26 27 27 $data['current_page'] = $this->uri->segment(4,1); 28 28 $data['itemsoptions']=array(10,25,50,100); 29 $data['perpage'] = 10; 29 $data['perpage'] = 10; 30 30 31 if ($this->input->post('items')) 31 32 { 32 33 $data['perpage'] = $this->input->post('items'); 33 34 } 34 35 $sql="SELECT * FROM tblcollaborator"; 35 36 $data['keyword']=''; 36 $sql=" FROM Entities\Tblcollaborator c";37 37 38 if ($this->input->post('keyword')) 38 39 { 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')."%')"; 41 41 } 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(); 52 47 $this->load->library('pagination'); 53 48 $url = "http://$_SERVER[HTTP_HOST]/admin/cong_tac_vien/trang/"; … … 79 74 80 75 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); 82 77 } 83 return $this-> pp->parse('modules/admin/views/collaborator/listview', $data,true);78 return $this->load->view('collaborator/listview', $data,true); 84 79 } 85 80 public function test() { 81 $data=$this->db->get_where('tblcollaborator'); 82 print_r ($data->result_array()); 83 die(); 86 84 for ($i = 1; $i <= 500; $i++) { 87 85 $collaborator = new Entities\Tblcollaborator(); -
pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php
r345 r354 62 62 </script> 63 63 <div class="main-content" id="content"> 64 {content}64 <?php echo $content; ?> 65 65 </div><!-- /.main-content --> 66 66 </div><!-- /.main-container-inner --> -
pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
r345 r354 1 1 <div id="breadcrumbs" class="breadcrumbs"> 2 <script type="text/javascript">3 try{literal}{{/literal}ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}4 </script>5 2 6 3 <ul class="breadcrumb"> … … 55 52 <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper"> 56 53 <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> 66 71 </div> 67 72 </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>76 73 </form> 77 74 <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info"> 78 75 <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=""> 80 78 <label> 81 79 <input type="checkbox" class="ace"> 82 80 <span class="lbl"></span> 83 81 </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"> 88 87 <i class="icon-time bigger-110 hidden-480"></i> 89 88 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> 91 91 </thead> 92 92 93 93 94 94 <tbody role="alert" aria-live="polite" aria-relevant="all"> 95 {foreach from=$collaborators item=collaborator} 95 96 <?php 97 foreach ($collaborators as $collaborator) { 98 ?> 96 99 <tr class="odd"> 97 100 <td class="center sorting_1"> … … 103 106 104 107 <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> 108 111 <td class="hidden-480 ">3,330 VND</td> 109 <td class=" "> {$collaborator.created_time}</td>112 <td class=" "><?php echo $collaborator['created_time']?></td> 110 113 111 114 <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 ?> 116 122 <span class="label label-sm label-default">Chưa kÃch hoạt</span> 117 {/if} 123 <?php 124 } 125 ?> 118 126 </td> 119 127 … … 168 176 </td> 169 177 </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> 185 195 </div> 186 196 </div> 187 197 </div> 198 188 199 </div> 189 200 </div> … … 257 268 </div> 258 269 <script type="text/javascript"> 259 260 {261 init_page();262 }270 window.onload = function () 271 { 272 init_page(); 273 } 263 274 264 275
Note: See TracChangeset
for help on using the changeset viewer.