Changeset 479 for pro-violet-viettel/sourcecode/application/modules/admin
- Timestamp:
- Nov 12, 2014 9:33:44 AM (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/report.php
r461 r479 6 6 class Report extends MX_Controller { 7 7 8 const TOKENPW = 'violet';8 const TOKENPW = 'violet'; 9 9 10 10 public function __construct() { … … 193 193 } 194 194 195 p ublicfunction get_username($us_id) {195 private function get_username($us_id) { 196 196 $src = 'violet'; 197 197 $token = md5($us_id . self::TOKENPW); 198 198 $this->load->model('user_model'); 199 199 $data = $this->user_model->get_user_info($src, $us_id, $token); 200 if (str len($data) > 0) {200 if (strpos($data, '&')) { 201 201 $arr_users = explode("&", $data); 202 202 $str_username = $arr_users[1]; … … 210 210 public function test() { 211 211 212 /*213 for ($i = 1; $i <= 5000; $i++) {214 215 216 217 218 219 220 221 }222 223 die();224 */212 /* 213 for ($i = 1; $i <= 5000; $i++) { 214 $input['us_id'] = rand(1, 100); 215 $input['paid_type'] = rand(1, 2); 216 $input['amount'] = rand(3, 10) * 1000; 217 $time = (rand((time() - (12 * 30 * 24 * 60 * 60)), time())); 218 $input['paid_time'] = date("Y-m-d H:i:s", $time); 219 $this->load->model('paidlog_model'); 220 $this->paidlog_model->insert($input); 221 } 222 223 die(); 224 */ 225 225 for ($i = 1; $i <= 200; $i++) { 226 226 $input['us_id'] = $i; -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php
r478 r479 6 6 class ReportAsistant extends MX_Controller { 7 7 8 const TOKENPW = 'violet';8 const TOKENPW = 'violet'; 9 9 10 10 public function __construct() { … … 24 24 } 25 25 } 26 public function viewAsistant() 27 {26 27 public function viewAsistant() { 28 28 $data = array(); 29 29 30 30 $admin_info = $this->session->userdata('adminInfo'); 31 31 if ($admin_info) { 32 $id =$this->uri->segment(3);33 $data['id']=$id;32 $id = $this->uri->segment(3); 33 $data['id'] = $id; 34 34 $data['statistics'] = $this->getStatistics($id); 35 $data['content'] = $this->getCollaboratorsUsers(array(), $id);35 $data['content'] = $this->getCollaboratorsUsers(array(), $id); 36 36 $this->load->view('reportAsistant/indexCollaborator', $data); 37 37 } else { … … 40 40 } 41 41 42 public function getStatistics($id =false) {42 public function getStatistics($id = false) { 43 43 $data = array(); 44 44 … … 46 46 47 47 $this->load->model('collabolator_model'); 48 $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'],$id); 49 for ($i=1;$i<=12;$i++) 50 { 51 $statistics[$i]=0; 52 } 53 $y=date("Y"); 48 $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'], $id); 49 for ($i = 1; $i <= 12; $i++) { 50 $statistics[$i] = 0; 51 } 52 $y = date("Y"); 54 53 foreach ($collaborators as $collaborator) { 55 for ($i=1;$i<=12;$i++) 56 { 57 if ($i<12) 58 { 59 if (($collaborator['time'] > strtotime($y."-".$i."-1 00:00:00")) && (($collaborator['time'] < strtotime($y."-".($i+1)."-1 00:00:00")))) 60 { 61 $statistics[$i]++; 54 for ($i = 1; $i <= 12; $i++) { 55 if ($i < 12) { 56 if (($collaborator['time'] > strtotime($y . "-" . $i . "-1 00:00:00")) && (($collaborator['time'] < strtotime($y . "-" . ($i + 1) . "-1 00:00:00")))) { 57 $statistics[$i] ++; 58 } 59 } else { 60 if (($collaborator['time'] > strtotime($y . "-" . $i . "-1 00:00:00")) && (($collaborator['time'] < strtotime(($y + 1) . "-1-1 00:00:00")))) { 61 $statistics[$i] ++; 62 } 62 63 } 63 } 64 else 65 { 66 if (($collaborator['time'] > strtotime($y."-".$i."-1 00:00:00")) && (($collaborator['time'] < strtotime(($y+1)."-1-1 00:00:00")))) 67 { 68 $statistics[$i]++; 69 } 70 } 71 } 72 } 73 64 } 65 } 66 74 67 $max = 0; 75 68 foreach ($statistics as $index => $total) { … … 149 142 return $this->load->view('reportAsistant/listview', $data, true); 150 143 } 151 152 public function getCollaboratorsUsers($filters = array(), $id=false) {153 144 145 public function getCollaboratorsUsers($filters = array(), $id = false) { 146 154 147 $this->load->helper('pagging'); 155 148 $this->load->model('collabolator_model'); 156 149 $data['current_page'] = $this->uri->segment(5, 1); 157 150 158 151 $data['itemsoptions'] = array(10, 25, 50, 100); 159 152 $data['perpage'] = 10; 160 if (!$id) 161 { 162 $data['id']= $this->uri->segment(4, 1); 163 } 164 else { 165 $data['id']=$id; 166 } 167 153 if (!$id) { 154 $data['id'] = $this->uri->segment(4, 1); 155 } else { 156 $data['id'] = $id; 157 } 158 168 159 $data['keyword'] = ""; 169 160 $data['sorting_order'] = "sorting_desc"; … … 191 182 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data); 192 183 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 193 194 $data['paging_url'] = base_url() . "/admin/thong_ke_cong_tac_vien/trang_ctv/".$data['id']; 184 foreach ($data['paidlogs'] as $index=>$paidlog) 185 { 186 $data['paidlogs'][$index]['username']=$this->get_username($paidlog['us_id']); 187 } 188 $data['paging_url'] = base_url() . "/admin/thong_ke_cong_tac_vien/trang_ctv/" . $data['id']; 195 189 $data['num_links'] = 2; 196 190 $data['paging'] = pagging($data); … … 202 196 } 203 197 204 p ublicfunction get_username($us_id) {198 private function get_username($us_id) { 205 199 $src = 'violet'; 206 200 $token = md5($us_id . self::TOKENPW); 207 201 $this->load->model('user_model'); 208 202 $data = $this->user_model->get_user_info($src, $us_id, $token); 209 210 if (strlen($data) > 0) { 203 if (strpos($data, '&')) { 211 204 $arr_users = explode("&", $data); 212 205 $str_username = $arr_users[1]; -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php
r465 r479 54 54 55 55 <td class=" "> 56 56 <?php echo $paidlog['username']; ?> 57 57 58 58 </td>
Note: See TracChangeset
for help on using the changeset viewer.