Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 573)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 574)
@@ -27,7 +27,7 @@
             $data['packages'] = $this->servicepackage_model->getAllPackages();
             $data['is_viettel'] = $user_info['is_viettel'];
-			$paidlogs = $this->user_model->getPaidlog($us_id);
+			//$paidlogs = $this->user_model->getPaidlog($us_id);
 			
-			$data['paidlogs'] = $paidlogs;
+			//$data['paidlogs'] = $paidlogs;
             parse_str($user, $info);
             $data = array_merge($data, $u);
@@ -287,4 +287,35 @@
         }
     }
+	
+	public function trade_history()
+	{
+		$this->load->helper('pagging');
+		$us_id = $this->uri->segment(4);
+        $user_info = $this->session->userdata('userInfo');
+        if ($user_info) 
+		{
+			
+			$data['us_id'] = $us_id;
+			$data['perpage'] = 10;
+			$data['current_page'] = $this->uri->segment(6, 1);
+			$data['start'] = ($data['current_page'] - 1) * $data['perpage'];
+			$this->load->model('user_model');
+			$result = $this->user_model->getPaidlog($data);
+			$data['total'] = $this->user_model->countPaiglogs($us_id);
+			$data['num_links'] = 2;
+			$data['paging_url'] = base_url() . "frontend/user/trade_history/".$us_id."/page/";
+			$data['paging'] = pagging($data);
+			$paidlogs = array();
+			foreach ($result as $paidlog):
+				$paidlog['amount'] = number_format($paidlog['amount'], 0);
+				$paidlog['paid_time'] = date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));
+				array_push($paidlogs, $paidlog);
+			endforeach;
+			$data['paidlogs'] = $paidlogs;
+			echo json_encode($data);
+		}else {
+            redirect('frontend/home');
+        }
+	}
 
 }
Index: pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 573)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 574)
@@ -482,8 +482,9 @@
 	}
 	
-	public function getPaidlog($us_id)
+	public function getPaidlog($data)
 	{
-		$this->db->query ( 'UNLOCK TABLES' );
-		$sql = 'SELECT * FROM tblpaidlog where us_id = ?';
+		$us_id = $data['us_id'];
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql = "SELECT * FROM tblpaidlog where us_id = ? ORDER BY paid_time DESC LIMIT ".$data['start'].", ".$data['perpage']." ";
 		$query = $this->db->query ( $sql, array (
 				$us_id
@@ -492,3 +493,14 @@
 		return $row;
 	}
+	
+	public function countPaiglogs($us_id)
+	{
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql="SELECT COUNT(paid_id) AS total FROM tblpaidlog WHERE us_id = ?";
+		$query = $this->db->query ( $sql, array (
+				$us_id
+		) );
+		$result = $query->row_array();
+		return $result['total'];
+	}
 }
Index: pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 573)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 574)
@@ -229,5 +229,5 @@
 											<label id="charging" style="display: none;"><span class="icon-refresh icon-refresh-animate"></span> Xin chá»...</label>
                                             <div class="space-4"></div>
-                                            <a href="#" data-toggle="modal" data-target="#trade-history"><i class="icon-archive"></i> Lá»ch sá»­ giao dá»ch</a>
+                                            <a onclick="tradeHistory(<?php echo $us_id; ?>, 1);" data-toggle="modal"><i class="icon-archive"></i> Lá»ch sá»­ giao dá»ch</a>
                                         </div>
                                         <div class="clearfix">
@@ -331,5 +331,4 @@
                                 </th>
                                 <th class="center">Sá» tiá»n (VNÄ)</th>
-
                                 <th>
                                     <i class="icon-time bigger-110 hidden-480"></i>
@@ -338,23 +337,13 @@
                             </tr>
                         </thead>
-
-                        <tbody>
-							<?php if (isset($paidlogs)) {?>
-							<?php foreach($paidlogs as $paidlog): ?>
-                            <tr>
-                                <td class="center">
-								<?php echo $paidlog['source']; ?>
-                                </td>
-                                <td class="center"><?php echo number_format($paidlog['amount'], 0); ?></td>
-                                <td><?php echo date('d-m-Y H:i:s', strtotime($paidlog['paid_time']));?></td>
-                            </tr>
-							<?php endforeach; ?>
-							<?php }else{ ?>
-							<tr>
-                                <td class="center" colspan=3>QuÃ­ vá» chÆ°a cÃ³ giao dá»ch nÃ o!</td>
-							</tr>
-							<?php } ?>
+                        <tbody id="content-trade-histoty">
                         </tbody>
                     </table>
+					<div>
+						<div class="dataTables_paginate paging_bootstrap">
+							<ul class="pagination">
+							</ul>
+						</div>
+					</div>
                 </div><!-- /.table-responsive -->
             </div>
@@ -498,4 +487,5 @@
 	var url="<?php echo base_url();?>";
 	var current_tab="<?php echo $current_tab;?>";
+
 </script>
 <?php
