<script src="assets/js/king-table.js"></script>
<!-- MAIN CONTENT WRAPPER -->

<div class="content">
	
	<div class="main-content">
		<!-- DATA EXPORT -->
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> View Employees</h3>
			</div>
			<div class="widget-content">
				<table id="datatable-data-export" class="table table-sorting table-striped table-hover table-bordered datatable">
					<thead>
						<tr>
							<th>User type</th>
							<th>Branch</th>
							<th>Name</th>
							<th>Login ID</th>
							<th>Contact No.</th>
							<th>Email ID</th>
							<th>Note</th>
							<th>Status</th>			
							<?php if($data['edit']=='1' || $data['delete']=='1'){echo'<th>Action</th>';}?>						
						</tr>
					</thead>
					<?php
					/*
					<tbody>
						@foreach($data['User'] as $User)
						<tr>
							<td>{{$User->ut_type}}</td>
							<td>{{$User->br_name}}</td>
							<td>{{$User->usr_name}}</td>
							<td>{{$User->usr_loginid}}</td>
							<td>{{$User->usr_contact1}}</td>
							<td>{{$User->usr_emailid}}</td>
							<td>{{$User->usr_note}}</td>
							<td>{{$User->usr_status}}</td>
							
							<?php if($data['edit']=='1' || $data['delete']=='1'){ echo'<td>';}?>	
								
								<?php if($data['edit']=='1'){echo'<button class="btn btn-default btn-xs print" href="edituser/'.$User->usr_id.'">Edit</button>'; } if($data['delete']=='1'){echo' <button class="btn btn-default btn-xs print" onclick="Delete('.$User->usr_id.')">Delete</button>';} echo '</td>';?>
							
						</tr>
						@endforeach
					</tbody>
					*/
					?>
				</table>
			</div>
		</div>
		<!-- END DATA EXPORT -->
		
	</div>
</div>
<!-- /main -->
<script>
	$('.createMod').click(function(e)
	{   
		e.preventDefault();
		$('#sideMenu').load($(this).attr('href'));
	});
	
	
	$('.edit').click(function(e)
	{
		e.preventDefault();
		$('#sideMenu').load($(this).attr('href')); 
	});
	
	function Delete(id)
	{
		//alert(id);
		k = 0;
		if(k == 0)
		{
			k++;
			$.ajax({
				type: "GET",
				url:"/deluser",
				dataType: "json",
				data: {
					'_token': $('input[name=_token]').val(),
					'id': id
				},
				success: function (sdata) {
					if(sdata.status == 1)
					{
						//printSuccessMsg(sdata.message);
						$('#sideMenu').load('viewuser');
					}
					else
					{
						//printErrorMsg(sdata.message)
					}
				}
			});
		}
		
	}	
	
	
</script>