Ignore:
Timestamp:
Nov 19, 2014 2:08:05 PM (11 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php

    r568 r574  
    2727            $data['packages'] = $this->servicepackage_model->getAllPackages();
    2828            $data['is_viettel'] = $user_info['is_viettel'];
    29                         $paidlogs = $this->user_model->getPaidlog($us_id);
     29                        //$paidlogs = $this->user_model->getPaidlog($us_id);
    3030                       
    31                         $data['paidlogs'] = $paidlogs;
     31                        //$data['paidlogs'] = $paidlogs;
    3232            parse_str($user, $info);
    3333            $data = array_merge($data, $u);
     
    287287        }
    288288    }
     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        }
    289320
    290321}
Note: See TracChangeset for help on using the changeset viewer.