Changeset 574
- Timestamp:
- Nov 19, 2014 2:08:05 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/config/routes.php
r499 r574 125 125 $route['admin/card_log/trang/:any'] = 'admin/cardlog/get_cardlogs/$1'; 126 126 127 $route['frontend/user/trade_history/:num/page'] = 'frontend/user/trade_history/$1/1'; 128 $route['frontend/user/trade_history/:num/page/:any'] = 'frontend/user/trade_history/$1/$2'; 127 129 128 130 /* End of file routes.php */ -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r568 r574 27 27 $data['packages'] = $this->servicepackage_model->getAllPackages(); 28 28 $data['is_viettel'] = $user_info['is_viettel']; 29 $paidlogs = $this->user_model->getPaidlog($us_id);29 //$paidlogs = $this->user_model->getPaidlog($us_id); 30 30 31 $data['paidlogs'] = $paidlogs;31 //$data['paidlogs'] = $paidlogs; 32 32 parse_str($user, $info); 33 33 $data = array_merge($data, $u); … … 287 287 } 288 288 } 289 290 public function trade_history() 291 { 292 $this->load->helper('pagging'); 293 $us_id = $this->uri->segment(4); 294 $user_info = $this->session->userdata('userInfo'); 295 if ($user_info) 296 { 297 298 $data['us_id'] = $us_id; 299 $data['perpage'] = 10; 300 $data['current_page'] = $this->uri->segment(6, 1); 301 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 302 $this->load->model('user_model'); 303 $result = $this->user_model->getPaidlog($data); 304 $data['total'] = $this->user_model->countPaiglogs($us_id); 305 $data['num_links'] = 2; 306 $data['paging_url'] = base_url() . "frontend/user/trade_history/".$us_id."/page/"; 307 $data['paging'] = pagging($data); 308 $paidlogs = array(); 309 foreach ($result as $paidlog): 310 $paidlog['amount'] = number_format($paidlog['amount'], 0); 311 $paidlog['paid_time'] = date('d-m-Y H:i:s', strtotime($paidlog['paid_time'])); 312 array_push($paidlogs, $paidlog); 313 endforeach; 314 $data['paidlogs'] = $paidlogs; 315 echo json_encode($data); 316 }else { 317 redirect('frontend/home'); 318 } 319 } 289 320 290 321 } -
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r561 r574 482 482 } 483 483 484 public function getPaidlog($ us_id)484 public function getPaidlog($data) 485 485 { 486 $this->db->query ( 'UNLOCK TABLES' ); 487 $sql = 'SELECT * FROM tblpaidlog where us_id = ?'; 486 $us_id = $data['us_id']; 487 $this->db->query ( 'UNLOCK TABLES' ); 488 $sql = "SELECT * FROM tblpaidlog where us_id = ? ORDER BY paid_time DESC LIMIT ".$data['start'].", ".$data['perpage']." "; 488 489 $query = $this->db->query ( $sql, array ( 489 490 $us_id … … 492 493 return $row; 493 494 } 495 496 public function countPaiglogs($us_id) 497 { 498 $this->db->query ( 'UNLOCK TABLES' ); 499 $sql="SELECT COUNT(paid_id) AS total FROM tblpaidlog WHERE us_id = ?"; 500 $query = $this->db->query ( $sql, array ( 501 $us_id 502 ) ); 503 $result = $query->row_array(); 504 return $result['total']; 505 } 494 506 } -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
r570 r574 229 229 <label id="charging" style="display: none;"><span class="icon-refresh icon-refresh-animate"></span> Xin chá»...</label> 230 230 <div class="space-4"></div> 231 <a href="#" data-toggle="modal" data-target="#trade-history"><i class="icon-archive"></i> Lá»ch sá» giao dá»ch</a>231 <a onclick="tradeHistory(<?php echo $us_id; ?>, 1);" data-toggle="modal"><i class="icon-archive"></i> Lá»ch sá» giao dá»ch</a> 232 232 </div> 233 233 <div class="clearfix"> … … 331 331 </th> 332 332 <th class="center">Sá» tiá»n (VNÄ)</th> 333 334 333 <th> 335 334 <i class="icon-time bigger-110 hidden-480"></i> … … 338 337 </tr> 339 338 </thead> 340 341 <tbody> 342 <?php if (isset($paidlogs)) {?> 343 <?php foreach($paidlogs as $paidlog): ?> 344 <tr> 345 <td class="center"> 346 <?php echo $paidlog['source']; ?> 347 </td> 348 <td class="center"><?php echo number_format($paidlog['amount'], 0); ?></td> 349 <td><?php echo date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));?></td> 350 </tr> 351 <?php endforeach; ?> 352 <?php }else{ ?> 353 <tr> 354 <td class="center" colspan=3>Quà vá» chưa có giao dá»ch nà o!</td> 355 </tr> 356 <?php } ?> 339 <tbody id="content-trade-histoty"> 357 340 </tbody> 358 341 </table> 342 <div> 343 <div class="dataTables_paginate paging_bootstrap"> 344 <ul class="pagination"> 345 </ul> 346 </div> 347 </div> 359 348 </div><!-- /.table-responsive --> 360 349 </div> … … 498 487 var url="<?php echo base_url();?>"; 499 488 var current_tab="<?php echo $current_tab;?>"; 489 500 490 </script> 501 491 <?php -
pro-violet-viettel/sourcecode/application/views/layout/frontend/header.php
r503 r574 22 22 .sidebar:before, .sidebar {background-color: transparent;} 23 23 .icon-refresh-animate { 24 -animation: spin .7s infinite linear;25 -webkit-animation: spin2 .7s infinite linear;24 -animation: spin .7s infinite linear; 25 -webkit-animation: spin2 .7s infinite linear; 26 26 } 27 27 … … 34 34 from { transform: scale(1) rotate(0deg);} 35 35 to { transform: scale(1) rotate(360deg);} 36 } 37 #frm3 a 38 { 39 cursor: pointer; 36 40 } 37 41 </style> -
pro-violet-viettel/sourcecode/assets/js/frontend/user.js
r562 r574 66 66 { 67 67 $("#package_register_modal").modal("hide"); 68 $("#success_package_register_content").html("QuÜ vá» Äã ÄÄng kà sá» dụng CÃŽng cụ Soạn Bà i giảng trá» ±c tuyến. Quà vá» ÄÆ°á»£c sá» dụng dá»ch vụ Äến hết 24h ngà y "+results.expire_date);68 $("#success_package_register_content").html("QuÜ vá» Äã ÄÄng kà sá» dụng CÃŽng cụ Soạn Bà i giảng trức tuyến. Quà vá» ÄÆ°á»£c sá» dụng dá»ch vụ Äến hết 24h ngà y "+results.expire_date); 69 69 $("#success_package_register_modal").modal("show"); 70 70 … … 161 161 } 162 162 163 163 function tradeHistory(id, page) 164 { 165 $.ajax({ 166 url: '/frontend/user/trade_history/'+id +'/page/'+page, 167 type: 'POST', 168 success: function(data) 169 { 170 results = jQuery.parseJSON(data); 171 paging = results.paging; 172 result = results.paidlogs; 173 content = ""; 174 if(result.length>0){ 175 for (var i in result) 176 { 177 content += '<tr><td class="center">'+result[i].source+'</td><td class="center">'+result[i].amount+'</td><td>'+result[i].paid_time+'</td></tr>'; 178 179 } 180 }else 181 { 182 content += '<tr><td class="center" colspan=3>Quà vá» chưa có giao dá»ch nà o!</td></tr>'; 183 } 184 $("#trade-history").find("#content-trade-histoty").html(content); 185 $("#trade-history").find(".pagination").html(paging); 186 $(".ajax_paging").click(function () 187 { 188 $.ajax({ 189 url: $(this).attr("href"), 190 type: "POST", 191 success: function (data, textStatus, jqXHR) 192 { 193 results = jQuery.parseJSON(data); 194 tradeHistory(id, results.current_page); 195 }, 196 error: function () 197 { 198 $(".ajaxloading").hide(); 199 } 200 }); 201 return false; 202 }); 203 $("#trade-history").modal('show'); 204 } 205 }); 206 }
Note: See TracChangeset
for help on using the changeset viewer.