Changeset 464 for pro-violet-viettel/sourcecode/application/modules
- Timestamp:
- Nov 11, 2014 5:22:15 PM (11 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php
r462 r464 27 27 { 28 28 $data = array(); 29 $id=$this->uri->segment(3); 29 30 $admin_info = $this->session->userdata('adminInfo'); 30 31 if ($admin_info) { 31 $data['statistics'] = $this->getStatistics( );32 $data['content'] = $this->get Paidlogs();32 $data['statistics'] = $this->getStatistics($id); 33 $data['content'] = $this->getCollaboratorsUsers(array(),$id); 33 34 $this->load->view('reportAsistant/index', $data); 34 35 } else { … … 37 38 } 38 39 39 public function getStatistics( ) {40 public function getStatistics($id=false) { 40 41 $data = array(); 41 42 … … 43 44 44 45 $this->load->model('collabolator_model'); 45 $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'] );46 $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'],$id); 46 47 for ($i=1;$i<=12;$i++) 47 48 { … … 134 135 135 136 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 136 $data['total'] = 100; //$this->collabolator_model->countPaidlog($data);137 $data['total'] = $this->collabolator_model->countCountCollaboratorUser($data); 137 138 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUser($data); 138 139 … … 145 146 } 146 147 return $this->load->view('reportAsistant/listview', $data, true); 148 } 149 150 public function getCollaboratorsUsers($filters = array(),$id=false) { 151 152 $this->load->helper('pagging'); 153 $this->load->model('collabolator_model'); 154 $data['current_page'] = $this->uri->segment(4, 1); 155 $data['itemsoptions'] = array(10, 25, 50, 100); 156 $data['perpage'] = 10; 157 $data['id']=$id; 158 $data['keyword'] = ""; 159 $data['sorting_order'] = "sorting_desc"; 160 $data['sorting_field'] = "id"; 161 162 if ($this->input->post('sorting_order')) { 163 if ($this->input->post('sorting_order') != "sorting") { 164 $data['sorting_order'] = $this->input->post('sorting_order'); 165 $data['sorting_field'] = $this->input->post('sorting_field'); 166 } 167 } 168 if ($this->input->post('items')) { 169 $data['perpage'] = $this->input->post('items'); 170 } 171 if ($this->input->post('keyword')) { 172 $data['search_field'] = ""; 173 $data['keyword'] = $this->input->post('keyword'); 174 175 if (preg_match("/[0-9]/", $data['keyword'])) { 176 $data['search_field'] = "cellphone"; 177 } 178 } 179 180 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 181 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data); 182 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 183 184 $data['paging_url'] = base_url() . "/admin/thong_ke_cong_tac_vien/trang/"; 185 $data['num_links'] = 2; 186 $data['paging'] = pagging($data); 187 188 if ($this->input->is_ajax_request()) { 189 return $this->load->view('reportAsistant/listview_user', $data); 190 } 191 return $this->load->view('reportAsistant/listview_user', $data, true); 147 192 } 148 193 -
pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
r461 r464 34 34 return $this->db->query($sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " ")->result_array(); 35 35 } 36 function getAllCollaboratorUser($from )36 function getAllCollaboratorUser($from,$id=false) 37 37 { 38 38 $from = date("Y-m-d 00:00:00",$from); 39 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id WHERE tbluser.created_time > '".$from."'"; 40 41 $result = $this->db->query($sql)->result_array(); 42 foreach ($result as $index=>$paidlog) 43 { 44 $result[$index]['time']= strtotime($paidlog['user_created_time']); 45 } 46 return $result; 39 $where=""; 40 if ($id) 41 { 42 $where = " AND tbluser.collaborator = $id "; 43 } 44 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id WHERE tbluser.created_time > '".$from."'".$where.""; 45 46 $result = $this->db->query($sql)->result_array(); 47 foreach ($result as $index=>$paidlog) 48 { 49 $result[$index]['time']= strtotime($paidlog['user_created_time']); 50 } 51 return $result; 52 } 53 function countCountCollaboratorUser($data) 54 { 55 $order = ""; 56 if ($data['sorting_order'] != "sorting") { 57 58 $sort = "DESC"; 59 if ($data['sorting_order'] == "sorting_asc") 60 $sort = "ASC"; 61 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 62 63 } 64 $where=""; 65 if ($data['keyword']) { 66 if ($data['search_field'] == "cellphone") { 67 $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')"; 68 } else { 69 $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') "; 70 } 71 } 72 // $from = date("Y-m-d 00:00:00",$from); 73 $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." "; 74 75 $result = $this->db->query($sql)->result_array(); 76 77 78 return count($result); 47 79 } 48 80 function getCountCollaboratorUser($data) … … 67 99 // $from = date("Y-m-d 00:00:00",$from); 68 100 $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'] . " "; 69 echo $sql; 70 $result = $this->db->query($sql)->result_array(); 71 foreach ($result as $index=>$paidlog) 72 { 73 $result[$index]['time']= strtotime($paidlog['user_created_time']); 74 } 75 76 return $result; 77 } 101 102 $result = $this->db->query($sql)->result_array(); 103 foreach ($result as $index=>$paidlog) 104 { 105 $result[$index]['time']= strtotime($paidlog['user_created_time']); 106 } 107 108 return $result; 109 } 110 111 function countCountCollaboratorUsers($data) 112 { 113 $order = ""; 114 if ($data['sorting_order'] != "sorting") { 115 116 $sort = "DESC"; 117 if ($data['sorting_order'] == "sorting_asc") 118 $sort = "ASC"; 119 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 120 121 } 122 $where=""; 123 if ($data['keyword']) { 124 if ($data['search_field'] == "cellphone") { 125 $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')"; 126 } else { 127 $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') "; 128 } 129 } 130 // $from = date("Y-m-d 00:00:00",$from); 131 $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.""; 132 133 $result = $this->db->query($sql)->result_array(); 134 foreach ($result as $index=>$paidlog) 135 { 136 $result[$index]['time']= strtotime($paidlog['user_created_time']); 137 } 138 139 return count($result); 140 } 141 function getCountCollaboratorUsers($data) 142 { 143 $order = ""; 144 if ($data['sorting_order'] != "sorting") { 145 146 $sort = "DESC"; 147 if ($data['sorting_order'] == "sorting_asc") 148 $sort = "ASC"; 149 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 150 151 } 152 $where=""; 153 if ($data['keyword']) { 154 if ($data['search_field'] == "cellphone") { 155 $where.=" WHERE (tblcollaborator.cellphone LIKE '%" . $data['keyword'] . "%')"; 156 } else { 157 $where.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') "; 158 } 159 } 160 // $from = date("Y-m-d 00:00:00",$from); 161 $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'] . " "; 162 163 $result = $this->db->query($sql)->result_array(); 164 foreach ($result as $index=>$paidlog) 165 { 166 $result[$index]['time']= strtotime($paidlog['user_created_time']); 167 } 168 169 return $result; 170 } 171 78 172 function isExist($data) { 79 173 $sql = "SELECT COUNT(id) as total FROM " . $this->table_name . " WHERE " . $data['field'] . " = '" . $data['value'] . "'"; -
pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
r461 r464 77 77 <thead> 78 78 <tr role="row"> 79 <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label=""> 80 <label> 81 <input type="checkbox" class="ace"> 82 <span class="lbl"></span> 83 </label> 84 </th> 79 85 80 86 81 <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> … … 102 97 ?> 103 98 <tr class="odd"> 104 <td class="center sorting_1"> 105 <label> 106 <input type="checkbox" class="ace"> 107 <span class="lbl"></span> 108 </label> 109 </td> 99 110 100 111 101 -
pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php
r446 r464 36 36 <thead> 37 37 <tr role="row"> 38 <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label=""> 39 <label> 40 <input type="checkbox" class="ace"> 41 <span class="lbl"></span> 42 </label> 43 </th> 38 44 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> 45 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> … … 57 52 ?> 58 53 <tr class="odd"> 59 <td class="center sorting_1"> 60 <label> 61 <input type="checkbox" class="ace"> 62 <span class="lbl"></span> 63 </label> 64 </td> 54 65 55 66 56 <td class=" "> -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview.php
r462 r464 36 36 <thead> 37 37 <tr role="row"> 38 <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label=""> 39 <label> 40 <input type="checkbox" class="ace"> 41 <span class="lbl"></span> 42 </label> 43 </th> 38 44 39 <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: 176px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Tên cá»ng tác viên</th> 45 40 <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</th> … … 56 51 ?> 57 52 <tr class="odd"> 58 <td class="center sorting_1"> 59 <label> 60 <input type="checkbox" class="ace"> 61 <span class="lbl"></span> 62 </label> 63 </td> 53 64 54 65 55 <td class=" "> -
pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/listview.php
r461 r464 74 74 <thead> 75 75 <tr role="row"> 76 <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label=""> 77 <label> 78 <input type="checkbox" class="ace"> 79 <span class="lbl"></span> 80 </label> 81 </th> 76 82 77 83 78 <th class="<?php if ($sorting_field == 'sms_content') {echo $sorting_order;} else {echo "sorting";}?>" id="sms_content" 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">Mẫu tin nhắn</th> … … 98 93 ?> 99 94 <tr class="odd"> 100 <td class="center sorting_1"> 101 <label> 102 <input type="checkbox" class="ace"> 103 <span class="lbl"></span> 104 </label> 105 </td> 106 95 107 96 108 97 <td class=" "><?php echo $smstemplate['sms_content']?></td>
Note: See TracChangeset
for help on using the changeset viewer.