Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 775)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php	(revision 777)
@@ -79,6 +79,7 @@
         $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
         $data['total'] = $this->paidlog_model->countPaidlog($data);
-        $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data);
-
+        $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data)['paid_logs'];
+		$data['total_amount'] = $this->paidlog_model->getPaidlogs($data)['total_amount'];
+		
         $data['paging_url'] = base_url() . "/admin/doanh_thu_tong_hop/trang/";
         $data['num_links'] = 2;
Index: pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php	(revision 775)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php	(revision 777)
@@ -13,4 +13,11 @@
 	}
 	function getPaidlogs($data) {
+		if ($data['paid_type'] == 0){
+			$sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog";
+		}else{
+			$sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog WHERE paid_type = ".$data['paid_type'];
+		}
+		$r = $this->db->query($sql)->row_array();
+		$total_amount = (int)$r['total_amount'];
         $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id ";
 		if ($data['paid_type'] == 1){
@@ -47,5 +54,9 @@
         }
         $sql=$sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " ";
-        return $this->db->query($sql)->result_array();
+        //return $this->db->query($sql)->result_array();
+		$re = $this->db->query($sql)->result_array();
+		$result['paid_logs'] = $re;
+		$result['total_amount'] = $total_amount;
+		return $result;
     }
 
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 775)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php	(revision 777)
@@ -210,4 +210,4 @@
 </div><!-- /.modal-dialog -->
 <?php
-$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js')));
+$this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/report.js', 'assets/js/admin/user.js')));
 ?>
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php	(revision 775)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php	(revision 777)
@@ -66,5 +66,5 @@
 
 							<td class=" ">
-								<a href="#"><?php echo $paidlog['username'];?></a>
+								<a onclick="getUserHistory(<?php echo $paidlog['us_id']; ?>, 1);" data-toggle="modal"><?php echo $paidlog['username'];?></a>
 							</td>
 							<td class=" "><?php echo $paidlog['cellphone']?></td>
@@ -85,5 +85,12 @@
 
 
-
+						<tr>
+						<td colspan=2>
+						Tổng tiền
+						</td>
+						<td colspan=3>
+						<?php echo $total_amount; ?>
+						</td>			
+						</tr>
 					</tbody></table><div class="row"><div class="col-sm-6">
 							<div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>
@@ -104,5 +111,66 @@
 		
 	</div>
-
+<!-- Modal User History -->
+<div class="modal fade" id="user-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ử</h4>
+            </div>
+            <div class="modal-body">
+                <ul class="nav nav-tabs padding-16"> 
+                    <li class="active" >
+                        <a id="regis-tab" href="#regis" data-toggle="tab">
+                            Giao dịch
+                        </a>
+                    </li>
+                    <li>
+                        <a id="trade-tab" href="#trade" data-toggle="tab">
+                            Thông tin
+                        </a>
+                    </li>
+                </ul>
+                <div class="tab-content history-tab-content">
+                    <div class="tab-pane in active" id="regis">
+                        <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"> Số tiền (VNĐ) </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" id="regis-pagination">
+                                    </ul>
+                                </div>
+                            </div>
+                        </div><!-- /.table-responsive -->
+                    </div>
+                    <div class="tab-pane" id="trade">
+                        <div class="row">
+                           
+                                <div id="content-trade-histoty">
+                                </div>
+                        
+                            </div>
+                        </div><!-- /.table-responsive -->
+                    </div>
+                </div>
+            </div><!-- Modal Body -->
+        </div> <!-- Modal Content -->
+    </div>
 
 <script type="text/javascript">
