Index: pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc.php	(revision 366)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/admin_acc.php	(revision 370)
@@ -69,4 +69,10 @@
 							});
 						</script>
+						<?php 
+						if($this->session->flashdata('insert_error'))
+						{
+							echo "TÃªn ÄÄng nháº­p ÄÃ£ ÄÆ°á»£c sá»­ dá»¥ng !";
+						}
+						?>
 						<div class="row">
 							<div class="col-xs-12">
@@ -75,5 +81,5 @@
 									Thá»ng kÃª tÃ i khoáº£n
 
-									<button class="btn btn-success pull-right" data-toggle="modal" href="#addUser">
+									<button class="btn btn-success pull-right" data-toggle="modal" href="#addAdmin">
 										<i class="icon-plus"></i>
 										ThÃªm quáº£n trá» viÃªn
@@ -184,5 +190,5 @@
 								</div>
 								
-								<!-- Edit User -->
+								<!-- Edit Admin -->
 								<div tabindex="-1" class="modal fade in" id="editAdmin">
 									<div class="modal-dialog">
@@ -198,5 +204,5 @@
 									
 											<div class="modal-body">
-												<form method="post" class="form-horizontal" id="validation-edit-form" action="<?php echo $base_url; ?>admin/home/update">
+												<form method="post" class="form-horizontal" id="validation-edit-form" action="<?php echo $base_url; ?>admin/admin_account/update">
 													<input type="hidden" name="id" id="form-field-0" value="">
 													<div class="form-group">
@@ -273,7 +279,7 @@
 									</div>
 								</div>
-								<!-- End Edit User -->
+								<!-- End Edit Admin -->
 								
-								<!-- Delete User -->
+								<!-- Delete Admin -->
 								<div tabindex="-1" class="modal fade in" id="deleteAdmin">
 									<div class="modal-dialog">
@@ -289,5 +295,5 @@
 											
 											<div class="modal-body">
-												<form method="post" class="form-horizontal" id="validation-form" action="<?php echo $base_url; ?>admin/home/delete">
+												<form method="post" class="form-horizontal" id="validation-form" action="<?php echo $base_url; ?>admin/admin_account/delete">
 													<input type="hidden" name="id" id="form-field-0" value="">
 													<div class="form-group">
@@ -336,5 +342,5 @@
 								
 								<!-- Add User -->
-								<div tabindex="-1" class="modal fade in" id="addUser">
+								<div tabindex="-1" class="modal fade in" id="addAdmin">
 									<div class="modal-dialog">
 										<div class="modal-content">
@@ -349,8 +355,10 @@
 
 											<div class="modal-body">
-												<form method="post" class="form-horizontal" id="validation-add-form" action="<?php echo $base_url; ?>admin/home/insert">
+												<form method="post" class="form-horizontal" id="validation-add-form" action="<?php echo $base_url; ?>admin/admin_account/insert" >
 													<div class="form-group">
 														<label for="form-field-1" class="col-sm-3 control-label no-padding-right"> TÃ i khoáº£n </label>
-														<div class="col-sm-9">
+														
+														<div class="col-sm-9">
+															
 															<label class="block clearfix has-error">
 																<span class="input-icon">
@@ -358,6 +366,8 @@
 																	<i class="icon-user blue"></i>
 																</span>
-																<div class="help-block"> </div>
+																<span style="" class="help-block" id="exist"><span>
+																<div class="help-block" id="usr" > </div>
 															</label>
+															
 														</div>
 													</div>
@@ -371,5 +381,6 @@
 																	<i class="icon-lock blue"></i>
 																</span>
-																<div class="help-block"> </div>
+																
+																<div class="help-block" id="pwd"> </div>
 															</label>
 														</div>			
@@ -418,5 +429,5 @@
 													<div class="clearfix form-actions">
 														<div class="col-md-offset-3 col-md-9">
-															<button type="submit" name="submit" class="btn btn-info">
+															<button id="insert-admin" type="submit" name="submit" class="btn btn-info">
 																<i class="icon-ok bigger-110"></i>
 																HoÃ n táº¥t
@@ -438,5 +449,72 @@
 								</div>
 								<!-- End Add User -->
-
+								<script>
+									$('#addAdmin').on('show.bs.modal', function(e) {
+										var isExist = false;
+										$(e.currentTarget).find('input[name="username"]').bind('input', function(){
+											var username = $(this).val();
+											$.ajax({
+											  url: "<?php echo $base_url; ?>admin/admin_account/check_data",
+											  type: "POST",
+											  data: 'username=' + username,
+											  success: function(result){			 
+														 if(result==="1"){
+															$('#exist').html("TÃ i khoáº£n ÄÃ£ tá»n táº¡i !");
+															isExist = true;
+															$(e.currentTarget).find('input[name="username"]').focus();
+															
+															$('#insert-admin').click(function(){
+																$(e.currentTarget).find('input[name="username"]').focus();
+															});
+														 }
+														 else{
+															$('#exist').html("");
+														 }
+													   }
+											  });
+										});
+										
+										$('#insert-admin').click(function(){
+											//$('#validation-add-form').valid();
+											var username = $('#username').val();
+											var password = $(e.currentTarget).find('input[name="password"]').val();
+											var fullname = $(e.currentTarget).find('input[name="fullname"]').val();
+											var email = $(e.currentTarget).find('input[name="email"]').val();
+											var phone = $(e.currentTarget).find('input[name="phone"]').val();
+											data = 'username=' + username + '&password=' + password + '&fullname=' + fullname + '&email=' + email + '&phone=' + phone;
+											if (isExist){
+												alert(isExist);
+											}
+											
+											if(username === "")
+											{
+												//alert("NULL");
+											}else
+											{
+												//alert(username);
+											}
+											/*
+											$.ajax({
+												url: "<?php echo $base_url; ?>admin/admin_account/insert",
+												type: "POST",
+												data: data,
+												success: function(result){			 
+														
+														}
+												
+											  });
+											*/
+										});
+									});
+									/*
+									$(document).ready(function() {
+										$('#insert-admin').click(function(){
+											$('#validation-add-form').valid();
+											var username = $(this).val();
+											alert($username);
+											//location.href = "<?php echo $base_url; ?>admin/admin_account/insert";
+										});
+									});*/
+								</script>
 								<!-- PAGE CONTENT ENDS -->
 							</div><!-- /.col -->
Index: pro-violet-viettel/sourcecode/application/modules/admin/views/user_acc.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/views/user_acc.php	(revision 370)
+++ pro-violet-viettel/sourcecode/application/modules/admin/views/user_acc.php	(revision 370)
@@ -0,0 +1,370 @@
+<?php
+$base_url = base_url();
+$this->load->view('layout/admin/header', array('base_url' => $base_url));
+$this->load->view('layout/admin/sidebar', array('base_url' => $base_url));
+?>				
+				<div class="main-content">
+					<div class="breadcrumbs" id="breadcrumbs">
+						<script type="text/javascript">
+							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
+						</script>
+
+						<ul class="breadcrumb">
+							<li>
+								<i class="icon-home home-icon"></i>
+								<a href="#">Trang chá»§</a>
+							</li>
+
+							<li>
+								<a href="#">Quáº£n lÃœ tÃ i khoáº£n</a>
+							</li>
+							<li>
+								<a href="#">NgÆ°á»i dÃ¹ng</a>
+							</li>
+							<li class="active">Thá»ng kÃª tÃ i khoáº£n</li>
+						</ul><!-- .breadcrumb -->
+
+						<div class="nav-search" id="nav-search">
+							<form class="form-search">
+								<span class="input-icon">
+									<input type="text" placeholder="TÃ¬m kiáº¿m ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
+									<i class="icon-search nav-search-icon"></i>
+								</span>
+							</form>
+						</div><!-- #nav-search -->
+					</div>
+
+					<div class="page-content">
+						<div class="page-header">
+							<h1>
+								NgÆ°á»i dÃ¹ng
+								<small>
+									<i class="icon-double-angle-right"></i>
+									thá»ng kÃª tÃ i khoáº£n
+								</small>
+							</h1>
+						</div><!-- /.page-header -->
+						
+						<script src="<?php echo $base_url;?>assets/js/jquery-2.0.3.min.js"></script>
+						<script src="<?php echo $base_url;?>assets/js/jquery.dataTables.min.js"></script>
+						<script src="<?php echo $base_url;?>assets/js/jquery.dataTables.bootstrap.js"></script>
+						<script type="text/javascript">
+							
+							jQuery(function($) {
+								var oTable1 = $('#sample-table-2').dataTable( {
+								"aoColumns": [
+								  { "bSortable": false },
+								  null, null,null, null,
+								  { "bSortable": false }
+								] } );
+								
+								
+								$('table th input:checkbox').on('click' , function(){
+									var that = this;
+									$(this).closest('table').find('tr > td:first-child input:checkbox')
+									.each(function(){
+										this.checked = that.checked;
+										$(this).closest('tr').toggleClass('selected');
+									});
+										
+								});
+							
+							});
+						</script>
+
+						<div class="row">
+							<div class="col-xs-12">
+								<!-- PAGE CONTENT BEGINS -->
+								<div class="table-header" style="padding-bottom:4px">
+									Thá»ng kÃª tÃ i khoáº£n
+
+									<button class="btn btn-success pull-right" data-toggle="modal" href="#addUser">
+										<i class="icon-plus"></i>
+										ThÃªm thÃ nh viÃªn
+									</button>
+										
+								</div>
+
+								<div class="table-responsive">
+									<table id="sample-table-2" class="table table-striped table-bordered table-hover">
+										<thead>
+											<tr>
+												<th class="center">
+													<label>
+														<input type="checkbox" class="ace" />
+														<span class="lbl"></span>
+													</label>
+												</th>
+												<th>Sá» Äiá»n thoáº¡i</th>
+												<th class="hidden-480">Tiá»n</th>
+
+												<th>
+													<i class="icon-time bigger-110 hidden-480"></i>
+													NgÃ y ÄÄng kÃœ
+												</th>
+												<th class="hidden-480">Tráº¡ng thÃ¡i</th>
+
+												<th></th>
+											</tr>
+										</thead>
+
+										<tbody>
+											<?php foreach ($users as $key=>$user): ?>
+											<tr>
+												<td class="center">
+													<label>
+														<input type="checkbox" class="ace" />
+														<span class="lbl"></span>
+													</label>
+												</td>
+
+												<td>
+													<a href="#"><?php echo $user->cellphone; ?></a>
+												</td>
+												<td class="hidden-480"><?php echo $user->acc_balanced; ?></td>
+												<td><?php echo $user->created_time; ?></td>
+
+												<td class="hidden-480">
+													<span class="label label-sm label-success">KÃ­ch hoáº¡t</span>
+												</td>
+
+												<td>
+													<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
+														<a class="blue" href="#">
+															<i class="icon-zoom-in bigger-130"></i>
+														</a>
+											
+														<a class="green" data-us-index=<?php echo $key; ?> data-toggle="modal" href="#editUser" title="Edit">
+															<i class="icon-pencil bigger-130"></i>
+														</a>
+
+														<a class="red" data-us-id=<?php echo $user->us_id; ?> data-toggle="modal" href="#deleteUser" title="Delete">
+															<i class="icon-trash bigger-130"></i>
+														</a>
+													</div>
+
+													<div class="visible-xs visible-sm hidden-md hidden-lg">
+														<div class="inline position-relative">
+															<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
+																<i class="icon-caret-down icon-only bigger-120"></i>
+															</button>
+
+															<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
+																<li>
+																	<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
+																		<span class="blue">
+																			<i class="icon-zoom-in bigger-120"></i>
+																		</span>
+																	</a>
+																</li>
+
+																<li>
+																	<a class="green" data-us-index=<?php echo $key; ?> data-toggle="modal" href="#editUser" title="Edit">
+																		<span class="green">
+																			<i class="icon-edit bigger-120"></i>
+																		</span>
+																	</a>
+																</li>
+
+																<li>
+																	<a class="red" data-admin-id=<?php echo $user->us_id; ?> data-toggle="modal" href="#deleteUser" title="Delete">
+																		<span class="red">
+																			<i class="icon-trash bigger-120"></i>
+																		</span>
+																	</a>
+																</li>
+															</ul>
+														</div>
+													</div>
+												</td>
+											</tr>
+											<?php endforeach; ?>
+										</tbody>
+									</table>
+								</div>
+								
+								<!-- Edit User -->
+								<div tabindex="-1" class="modal fade in" id="editUser">
+									<div class="modal-dialog">
+										<div class="modal-content">
+											<div class="modal-header no-padding">
+												<div class="table-header">
+													<button aria-hidden="true" data-dismiss="modal" class="close" type="button">
+														<span class="white">Ã</span>
+													</button>
+													Sá»­a ngÆ°á»i dÃ¹ng
+												</div>
+											</div>
+									
+											<div class="modal-body">
+												<form method="post" class="form-horizontal" id="validation-edit-form" action="<?php echo $base_url; ?>admin/user_account/update">
+													<input type="hidden" name="id" id="form-field-0" value="">
+													<div class="form-group">
+														<label for="form-field-1" class="col-sm-3 control-label no-padding-right"> Sá» Äiá»n thoáº¡i </label>
+														<div class="col-sm-9">
+															<label class="block clearfix has-error">
+																<span class="input-icon">
+																	<input type="text" name="phone" placeholder="Phone" id="form-field-1" value="">
+																	<i class="icon-user blue"></i>
+																</span>
+																<div class="help-block"> </div>
+															</label>
+														</div>
+													</div>
+
+													<div class="form-group">
+														<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> Tiá»n </label>
+														<div class="col-sm-9">
+															<span class="input-icon">
+																<input type="text" name="balance" placeholder="" id="form-field-2" value="">
+																<i class="icon-user blue"></i>
+															</span>
+														</div>
+														<label class="block clearfix has-error">
+															<div class="help-block"> </div>
+														</label>
+														
+													</div>
+
+													<div class="space-4"></div>
+													<div class="clearfix form-actions">
+														<div class="col-md-offset-3 col-md-9">
+															<button type="submit" name="submit" class="btn btn-info">
+																<i class="icon-ok bigger-110"></i>
+																HoÃ n táº¥t
+															</button>
+
+															&nbsp; &nbsp; &nbsp;
+															<button type="reset" name="reset" class="btn">
+																<i class="icon-undo bigger-110"></i>
+																XÃ³a háº¿t
+															</button>
+														</div>
+													</div>
+												</form>
+											</div>
+										</div>
+									</div>
+								</div>
+								<!-- End Edit Admin -->
+								
+								<!-- Add User -->
+								<div tabindex="-1" class="modal fade in" id="addUser">
+									<div class="modal-dialog">
+										<div class="modal-content">
+											<div class="modal-header no-padding">
+												<div class="table-header">
+													<button aria-hidden="true" data-dismiss="modal" class="close" type="button">
+														<span class="white">Ã</span>
+													</button>
+													Táº¡o má»i thÃ nh viÃªn
+												</div>
+											</div>
+
+											<div class="modal-body">
+												<form method="post" class="form-horizontal" id="validation-form" action="<?php echo $base_url; ?>admin/user_account/insert">
+													<div class="form-group">
+														<label for="form-field-1" class="col-sm-3 control-label no-padding-right"> Sá» Äiá»n thoáº¡i </label>
+
+														<div class="col-sm-9">
+															<span class="input-icon">
+																<input type="number" name="cellphone" placeholder="phone" id="form-field-1">
+																<i class="icon-phone blue"></i>
+															</span>
+														</div>
+														<div class="help-block"> </div>
+													</div>
+
+													<div class="clearfix form-actions">
+														<div class="col-md-offset-3 col-md-9">
+															<button type="submit" name="submit" class="btn btn-info">
+																<i class="icon-ok bigger-110"></i>
+																HoÃ n táº¥t
+															</button>
+
+															&nbsp; &nbsp; &nbsp;
+															<button type="reset" class="btn">
+																<i class="icon-undo bigger-110"></i>
+																XÃ³a háº¿t
+															</button>
+														</div>
+													</div>
+
+													</div>
+												</form>
+											</div>
+										</div><!-- /.modal-content -->
+									</div><!-- /.modal-dialog -->
+								</div>
+								
+								<!-- Delete User -->
+								<div tabindex="-1" class="modal fade in" id="deleteUser">
+									<div class="modal-dialog">
+										<div class="modal-content">
+											<div class="modal-header no-padding">
+												<div class="table-header">
+													<button aria-hidden="true" data-dismiss="modal" class="close" type="button">
+														<span class="white">Ã</span>
+													</button>
+													XÃ³a ngÆ°á»i dÃ¹ng
+												</div>
+											</div>
+											
+											<div class="modal-body">
+												<form method="post" class="form-horizontal" id="validation-form" action="<?php echo $base_url; ?>admin/user_account/delete">
+													<input type="hidden" name="id" id="form-field-0" value="">
+													<div class="form-group">
+														<center><h4> Cháº¯c cháº¯n muá»n xÃ³a tÃ i khoáº£n nÃ y? </h4></center>
+													</div>
+													<div class="clearfix form-actions">
+														<div class="col-md-offset-3 col-md-9">
+															<button type="submit" name="submit" class="btn btn-info">
+																<i class="icon-ok bigger-110"></i>
+																XÃ³a
+															</button>
+
+															&nbsp; &nbsp; &nbsp;
+															<button type="reset" name="reset" class="btn" data-dismiss="modal">
+																<i class="icon-undo bigger-110"></i>
+																Há»§y
+															</button>
+														</div>
+													</div>
+												</form>
+											</div>
+										</div>
+									</div>
+								</div>					
+								<!-- End Delete User -->		
+								<script>
+									$('#deleteUser').on('show.bs.modal', function(e) {
+										var id = parseInt($(e.relatedTarget).data('us-id'));
+										$(e.currentTarget).find('input[name="id"]').val(id);
+									});
+									$('#editUser').on('show.bs.modal', function(e) {
+										//get data-id attribute of the clicked element
+										var index = parseInt($(e.relatedTarget).data('us-index'));
+										//populate the textbox
+										var ar = <?php echo json_encode($users) ?>;
+										
+										$(e.currentTarget).find('input[name="phone"]').val(ar[index].cellphone);
+										$(e.currentTarget).find('input[name="balance"]').val(ar[index].acc_balanced);
+										$(e.currentTarget).find('input[name="id"]').val(ar[index].us_id);
+									});	
+									
+								</script>
+								<!-- PAGE CONTENT ENDS -->
+							</div><!-- /.col -->
+						</div><!-- /.row -->
+					</div><!-- /.page-content -->
+				</div><!-- /.main-content -->
+
+			</div><!-- /.main-container-inner -->
+
+			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
+				<i class="icon-double-angle-up icon-only bigger-110"></i>
+			</a>
+		</div><!-- /.main-container -->
+<?php
+$this->load->view('layout/admin/footer', array('base_url' => $base_url));
+?>
