Index: pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php	(revision 720)
+++ pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php	(revision 728)
@@ -67,4 +67,5 @@
             }
         }
+       
         return $provinces;
     }
@@ -74,5 +75,5 @@
         $provinces = lang('_PROVINCES_');
         // tinh thue bao theo thang
-        $sql = "SELECT * FROM tbluser LEFT JOIN tblservicepackage ON tbluser.p_id=tblservicepackage.p_id  WHERE tbluser.created_time >'".$input['year']."-".$input['month']."-01' AND tbluser.created_time <'".$input['year']."-".$input['month']."-31' AND tblservicepackage.p_period > 0 " ;
+        $sql = "SELECT * FROM tbluser LEFT JOIN tblservicepackage ON tbluser.p_id=tblservicepackage.p_id  WHERE tbluser.created_time >'" . $input['year'] . "-" . $input['month'] . "-01' AND tbluser.created_time <'" . $input['year'] . "-" . $input['month'] . "-31' AND tblservicepackage.p_period > 0 ";
         $query = $this->db->query($sql);
         $users = $query->result_array();
@@ -96,5 +97,5 @@
 
         foreach ($provinces as $index => $province) {
-            $provinces[$index]['stt']=$index+1;
+            $provinces[$index]['stt'] = $index + 1;
             $provinces[$index]['total'] = 0;
             $totaluser = 0;
@@ -123,7 +124,7 @@
             }
         }
-      
-        $data['packages']=$packages;
-        $data['provinces']=$provinces;
+
+        $data['packages'] = $packages;
+        $data['provinces'] = $provinces;
         return $data;
     }
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 720)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php	(revision 728)
@@ -56,5 +56,5 @@
                                         <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">
                                             <?php foreach ($itemsoptions as $option) { ?>
-                                            <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option>
+                                                <option <?php if ($option == $perpage) echo "selected"; ?> value="<?php echo $option; ?>"><?php echo $option; ?></option>
                                             <?php } ?>
                                         </select> báº£n ghi</label>
@@ -62,35 +62,35 @@
                                 </div>
                             </div>
-								
+
                             <div class="col-sm-6">
                                 <div class="dataTables_filter" id="sample-table-2_filter">
                                     <label>TÃ¬m kiáº¿m: 
-                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
-                                </div>
-								<div class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lá»c:
-									<select onchange="filter();" name="status" size="1" style="width: 176px; height: 28px;">                                      
-										<?php foreach ($statusoptions as $key=>$option):?>
-										<option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
-										<?php endforeach; ?>
-									</select>
-								</div>
-								<div style="clear: both;"></div>
-								<div id="daterangepicker" class="selectbox pull-right">
-									<i class="icon-calendar"></i>
-									<input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
-										
-									</span>
-								</div>
-								</div>
-                            </div>
-
+                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword; ?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label>
+                                </div>
+                                <div class="dataTables_status" style="float: right;" id="sample-table-2_status"><label>Lá»c:
+                                        <select onchange="filter();" name="status" size="1" style="width: 176px; height: 28px;">                                      
+                                            <?php foreach ($statusoptions as $key => $option): ?>
+                                                <option <?php if ($key == $status) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $option; ?></option>
+                                            <?php endforeach; ?>
+                                        </select>
+                                </div>
+                                <div style="clear: both;"></div>
+                                <div id="daterangepicker" class="selectbox pull-right">
+                                    <i class="icon-calendar"></i>
+                                    <input id="daterange" type="text" name="daterange" class="daterangepicker" style="background: #ffffff; width: 176px; height: 28px; position: inherit;">
+
+                                    </span>
+                                </div>
+                            </div>
                         </div>
-							
-						<input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" />
-						<input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
-                    </form>
-					<!-- Table Content -->
-					<center><div id="loading" style="display:none;"><img src="<?php echo base_url();?>/assets/img/loading.gif"/></div></center>
-					<div id="table_content">
+
+                </div>
+
+                <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order; ?>" />
+                <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field; ?>"/>
+                </form>
+                <!-- Table Content -->
+                <center><div id="loading" style="display:none;"><img src="<?php echo base_url(); ?>/assets/img/loading.gif"/></div></center>
+                <div id="table_content">
                     <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
                         <thead>
@@ -102,83 +102,113 @@
                                     </label>
                                 </th>
-								<th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="TÃ i khoáº£n: activate to sort column ascending">Username</th>
-                                <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
-                                <th class="<?php if ($sorting_field == 'acc_balanced') {echo $sorting_order;} else {echo "sorting";}?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tiá»n: activate to sort column ascending">TÃ i khoáº£n (VNÄ)</th>
-								<th style="width: 140px;">Tá»nh/TP</th>
-                                <th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="NgÃ y ÄÄng kÃœ: activate to sort column ascending">
+                                <th class="<?php
+                                if ($sorting_field == 'cellphone') {
+                                    echo $sorting_order;
+                                } else {
+                                    echo "sorting";
+                                }
+                                ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="TÃ i khoáº£n: activate to sort column ascending">Username</th>
+                                <th class="<?php
+                                if ($sorting_field == 'cellphone') {
+                                    echo $sorting_order;
+                                } else {
+                                    echo "sorting";
+                                }
+                                ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
+                                <th class="<?php
+                                if ($sorting_field == 'acc_balanced') {
+                                    echo $sorting_order;
+                                } else {
+                                    echo "sorting";
+                                }
+                                ?>" id="acc_balanced" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tiá»n: activate to sort column ascending">TÃ i khoáº£n (VNÄ)</th>
+                                <th style="width: 140px;">Tá»nh/TP</th>
+                                <th class="<?php
+                                if ($sorting_field == 'created_time') {
+                                    echo $sorting_order;
+                                } else {
+                                    echo "sorting";
+                                }
+                                ?>" id="created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="NgÃ y ÄÄng kÃœ: activate to sort column ascending">
                                     <i class="icon-time bigger-110 hidden-480"></i>
                                     NgÃ y ÄÄng kÃœ
                                 </th>
-								<th class="<?php if ($sorting_field == 'expire_date') {echo $sorting_order;} else {echo "sorting";}?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 140px;" aria-label="NgÃ y háº¿t háº¡n: activate to sort column ascending">
+                                <th class="<?php
+                                if ($sorting_field == 'expire_date') {
+                                    echo $sorting_order;
+                                } else {
+                                    echo "sorting";
+                                }
+                                ?>" id="expire_date" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 140px;" aria-label="NgÃ y háº¿t háº¡n: activate to sort column ascending">
                                     <i class="icon-time bigger-110 hidden-480"></i>
                                     NgÃ y háº¿t háº¡n
                                 </th>
-								<th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">TÃ¬nh tráº¡ng</th>
+                                <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">TÃ¬nh tráº¡ng</th>
                             </tr>
                         </thead>
 
                         <tbody role="alert" aria-live="polite" aria-relevant="all">
-                            
-                            <?php
-                            foreach ($users as $user) {
-                                ?>
-                            <tr class="odd">
-                                <td class="center  sorting_1">
-                                    <label>
-                                        <input type="checkbox" class="ace">
-                                        <span class="lbl"></span>
-                                    </label>
-                                </td>
-								<td class=" ">
-                                    <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo $user['username']; ?></a>
-									 <!--<a href="#user-history" data-toggle="modal"><?php echo @$user['username']; ?></a>-->
-                                </td>
-                                <td class=" ">
-                                    <?php echo $user['cellphone']; ?>
-                                </td>
-                                <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
-								<td><?php echo $user['province']; ?></td>
-                                <td class=" "><?php echo $user['created_time']; ?></td>
-								<td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date'])>0 ? date('d/m/Y', strtotime($user['expire_date'])) : '';?></td>
-
-								<td class=" ">
-								<?php  if(strtotime($user['expire_date'])>time()){ ?>
-									<span class="label label-sm label-success">ÄÃ£ ÄÄng kÃœ</span>
-								<?php }else{ ?>
-									<span class="label label-sm label-warning">DÃ¹ng thá»­</span>
-								<?php } ?>
-								</td>
-
-                            </tr>
-                            <?php } ?>
+
+<?php
+foreach ($users as $user) {
+    ?>
+                                <tr class="odd">
+                                    <td class="center  sorting_1">
+                                        <label>
+                                            <input type="checkbox" class="ace">
+                                            <span class="lbl"></span>
+                                        </label>
+                                    </td>
+                                    <td class=" ">
+                                        <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo $user['username']; ?></a>
+                                                                             <!--<a href="#user-history" data-toggle="modal"><?php echo @$user['username']; ?></a>-->
+                                    </td>
+                                    <td class=" ">
+                                        <?php echo $user['cellphone']; ?>
+                                    </td>
+                                    <td class="hidden-480 "><?php echo number_format($user['acc_balanced'], 0); ?></td>
+                                    <td><?php echo $user['province']; ?></td>
+                                    <td class=" "><?php echo $user['created_time']; ?></td>
+                                    <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td>
+
+                                    <td class=" ">
+    <?php if (strtotime($user['expire_date']) > time()) { ?>
+                                            <span class="label label-sm label-success">ÄÃ£ ÄÄng kÃœ</span>
+    <?php } else { ?>
+                                            <span class="label label-sm label-warning">DÃ¹ng thá»­</span>
+    <?php } ?>
+                                    </td>
+
+                                </tr>
+                                    <?php } ?>
 
                         </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>
-                                    
-							</div>
-							<div class="col-sm-6">
-								<div class="dataTables_paginate paging_bootstrap">
-									<ul class="pagination">
-										<?php echo $paging; ?>
-									</ul>
-								</div>
-							</div>
-						</div>
-						</div>
-
+                    <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>
+
+                        </div>
+                        <div class="col-sm-6">
+                            <div class="dataTables_paginate paging_bootstrap">
+                                <ul class="pagination">
+<?php echo $paging; ?>
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
                 </div>
+
             </div>
-
-            
         </div>
 
-        <!-- PAGE CONTENT ENDS -->
-    </div><!-- /.col -->
+
+    </div>
+
+    <!-- PAGE CONTENT ENDS -->
+</div><!-- /.col -->
 </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-dialog">
         <div class="modal-content">
             <div class="modal-header">
@@ -186,74 +216,63 @@
                 <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">
-							ÄÄng kÃœ dá»ch vá»¥
-						</a>
-					</li>
-					<li>
-						<a id="trade-tab" href="#trade" data-toggle="tab">
-							Giao dá»ch
-						</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"> 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="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>
-											<i class="icon-time bigger-110 hidden-480"></i>
-											Thá»i gian
-										</th>
-									</tr>
-								</thead>
-								<tbody id="content-trade-histoty">
-								</tbody>
-							</table>
-							<div>
-								<div class="dataTables_paginate paging_bootstrap">
-									<ul class="pagination" id="trade-pagination">
-									</ul>
-								</div>
-							</div>
-						</div><!-- /.table-responsive -->
-					</div>
-				</div>
-			</div><!-- Modal Body -->
-		</div> <!-- Modal Content -->
-	</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"> 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>
 </div>
 
