Index: pro-violet-viettel/sourcecode/application/config/routes.php
===================================================================
--- pro-violet-viettel/sourcecode/application/config/routes.php	(revision 639)
+++ pro-violet-viettel/sourcecode/application/config/routes.php	(revision 642)
@@ -122,4 +122,7 @@
 $route['frontend/user/trade_history/:num/page/:any'] = 'frontend/user/trade_history/$1/$2';
 
+$route['frontend/user/regis_history/:num/page'] = 'frontend/user/regis_history/$1/1';
+$route['frontend/user/regis_history/:num/page/:any'] = 'frontend/user/regis_history/$1/$2';
+
 /* End of file routes.php */
 /* Location: ./application/config/routes.php */
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 639)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 642)
@@ -133,5 +133,5 @@
 		$source = 'web';
 		$toDate = date("Y-m-d", (strtotime($result['expire_date'])));
-		$this->user_model->insertRegisterVipLog($source,  $package['p_code'], $toDate);
+		$this->user_model->insertRegisterVipLog($user['cellphone'], $source,  $package['p_code']);
         echo json_encode($result);
     }
@@ -165,7 +165,5 @@
 			$message = preg_replace($aryPatterns, array(date('d-m-Y', strtotime($user['expire_date']))), lang('_SBG_REGISTER_VIP_SUCCESS_MS')); 
 			$source = 'web';
-			$this->user_model->insertRegisterVipLog($source,  $package['p_code']);
-           
-
+			$this->user_model->insertRegisterVipLog($user['cellphone'], $source,  $package['p_code']);
         }
 
@@ -366,4 +364,38 @@
         }
 	}
+	
+	public function regis_history()
+	{
+		$this->load->helper('pagging');
+		$us_id = $this->uri->segment(4);
+		$this->load->model('user_model');
+		$user = $this->user_model->get_user_by_id($us_id);
+		$username = $user['cellphone'];
+		$user_info = $this->session->userdata('userInfo');
+		if ($user_info) 
+		{
+			$data['username'] = $username;
+			$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->getPackagelog($data);
+			$data['total'] = $this->user_model->countPackagelogs($username);
+			$data['num_links'] = 2;
+			$data['paging_url'] = base_url() . "frontend/user/regis_history/".$us_id."/page/";
+			$data['paging'] = pagging($data);
+			$packagelogs = array();
+			foreach ($result as $packagelog):
+				$packagelog['created_time'] = date('d-m-Y H:i:s', strtotime($packagelog['created_time']));
+				array_push($packagelogs, $packagelog);
+			endforeach;
+			$data['packagelogs'] = $packagelogs;
+			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 639)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 642)
@@ -517,9 +517,11 @@
 	}
 	
-	public function insertRegisterVipLog($source, $p_code)
+	public function insertRegisterVipLog($username, $source, $p_code)
 	{
 		$createdTime = date('Y-m-d H:i:s');
-		$sql = 'INSERT INTO tblregisterpackagelog (source, p_code, created_time) VALUES (?,?,?)';
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql = 'INSERT INTO tblregisterpackagelog (username, source, p_code, created_time) VALUES (?,?,?,?)';
 		$query = $this->db->query ( $sql,  array (
+				'username'=>$username,
 				'source'=>$source,
 				'p_code'=>$p_code,
@@ -527,3 +529,26 @@
 		) );
 	}
+	
+	public function getPackagelog($data)
+	{
+		$username = $data['username'];
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql = "SELECT * FROM tblregisterpackagelog where username = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']." ";
+		$query = $this->db->query ( $sql, array (
+				$username
+		) );
+		$row = $query->result_array();
+		return $row;
+	}
+	
+	public function countPackagelogs($username)
+	{
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql="SELECT COUNT(id) AS total FROM tblregisterpackagelog WHERE username = ?";
+		$query = $this->db->query ( $sql, array (
+				$username
+		) );
+		$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 639)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php	(revision 642)
@@ -244,5 +244,5 @@
                                     <!--<form action="<?php echo base_url();?>frontend/user/packageRegister"  class="form-horizontal" id="package_register"> -->
                                     <form action="<?php echo base_url();?>frontend/user/packageRegister" method="POST" class="form-horizontal" id="package_register">
-                                        <h4 class="header blue bolder smaller">ThÃŽng tin dá»ch vá»¥</h4>
+                                        <h4 class="header blue bolder smaller">ThÃŽng tin dá»ch vá»¥ <a style="float:right;" onclick="regisHistory(<?php echo $us_id; ?>, 1);" data-toggle="modal"><i class="icon-archive"></i> Lá»ch sá»­ ÄÄng kÃœ dá»ch vá»¥</a></h4>
 										<div class="col-sm-6">
                                             <h4><b>Thá»i háº¡n sá»­ dá»¥ng</b></h4> <h3><b><span class="blue"><?php echo isset($expire_date) && strtotime($expire_date)>0 ? date('d/m/Y', strtotime($expire_date)) : '';?> </span></b></h3>
@@ -461,4 +461,41 @@
 </div>
 
+<div class="modal fade" id="regis-history" tabindex="-1" role="dialog"aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                <h4 class="modal-title">Lá»ch sá»­ ÄÄng kÃœ dá»ch vá»¥</h4>
+            </div>
+            <div class="modal-body">
+                <div class="table-responsive">
+                    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
+                        <thead>
+                            <tr>
+                                <th class="center">
+									Tá»«
+                                </th>
+                                <th class="center"> GÃ³i dá»ch vá»¥ </th>
+                                <th>
+                                    <i class="icon-time bigger-110 hidden-480"></i>
+                                    Thá»i gian
+                                </th>
+                            </tr>
+                        </thead>
+                        <tbody id="content-regis-histoty">
+                        </tbody>
+                    </table>
+					<div>
+						<div class="dataTables_paginate paging_bootstrap">
+							<ul class="pagination">
+							</ul>
+						</div>
+					</div>
+                </div><!-- /.table-responsive -->
+            </div>
+        </div>
+    </div>
+</div>
+
 <script type="text/javascript">
 	var url="<?php echo base_url();?>";
Index: pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 639)
+++ pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 642)
@@ -198,5 +198,5 @@
 				$smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code);
 				$source = 'sms';
-				$this->objUserModel->insertRegisterVipLog($source, $p_code);
+				$this->objUserModel->insertRegisterVipLog($sentNumber, $source, $p_code);
 				break;
 			case _SBG_MO_PAY_TO_ACCOUNT:
Index: pro-violet-viettel/sourcecode/application/views/layout/frontend/header.php
===================================================================
--- pro-violet-viettel/sourcecode/application/views/layout/frontend/header.php	(revision 639)
+++ pro-violet-viettel/sourcecode/application/views/layout/frontend/header.php	(revision 642)
@@ -35,5 +35,5 @@
 				to { transform: scale(1) rotate(360deg);}
 			}
-			#frm3 a
+			form a
 			{
 				cursor: pointer;
Index: pro-violet-viettel/sourcecode/assets/js/frontend/user.js
===================================================================
--- pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 639)
+++ pro-violet-viettel/sourcecode/assets/js/frontend/user.js	(revision 642)
@@ -212,4 +212,49 @@
 }
 
+function regisHistory(id, page)
+{
+	$.ajax({
+		url: '/frontend/user/regis_history/'+id +'/page/'+page,
+		type: 'POST',
+		success: function(data)
+		{
+			results = jQuery.parseJSON(data);
+			paging = results.paging;
+			result = results.packagelogs;
+			content = "";
+			if(result.length>0){
+				for (var i in result)
+				{
+					content += '<tr><td class="center">'+result[i].source+'</td><td class="center">'+result[i].p_code+'</td><td>'+result[i].created_time+'</td></tr>';
+					
+				}
+			}else
+			{
+				content += '<tr><td class="center" colspan=3>QuÃœ vá» chÆ°a ÄÄng kÃ­ gÃ³i dá»ch vá»¥ nÃ o!</td></tr>';
+			}
+			$("#regis-history").find("#content-regis-histoty").html(content);
+			$("#regis-history").find(".pagination").html(paging);
+			 $(".ajax_paging").click(function ()
+			 {
+				$.ajax({
+					url: $(this).attr("href"),
+					type: "POST",
+					success: function (data, textStatus, jqXHR)
+					{
+						results = jQuery.parseJSON(data);
+						regisHistory(id, results.current_page);
+					},
+					error: function ()
+					{
+						$(".ajaxloading").hide();
+					}
+				});
+				return false;
+			 });
+			$("#regis-history").modal('show');
+		}
+	});
+}
+
 function addCommas(nStr)
 {
