<div class="right_col" role="main">
	<div class="">
		<div class="page-title">
			<div class="title_left">
				<table>
					<tr>
						<td width="150px"><h3>Admin list</h3></td>
						<td><a href="index.php?pagecontent=#"><button type="button" class="btn btn-dark">Add Staff</button></a></td>
					</tr>
				</table>
			</div>
		</div>
		<div class="clearfix"></div>
		<div class="row">
			<div class="col-md-12 col-sm-12 col-xs-12">
				<div class="x_panel">
					<div class="x_content">
						<table id="datatable" class="table table-striped table-bordered">
							<thead>
								<tr>
									<th>Admin</th>
									<th>Action</th>
								</tr>
							</thead>
							<tbody>
								<?php
									$result=mysqli_query($conn, "SELECT * FROM admin") or die (mysql_error());
									while($row = mysqli_fetch_array($result))
									{
								?>
								<tr>
									<td width="150"><?php echo $row['a_username'];?></a></td>
						
									<td>
										<a href="?pagecontent=admins&room=<?php echo $row['a_id']; ?>"><button class="btn btn-xs btn-primary">Update</button></a>
										
										<a href="?pagecontent=admins&withdrawal=<?php echo $row['a_id']; ?>"><button class="btn btn-xs btn-danger">Withdrawal</button></a>
									</td>
								</tr>
								<?php
									}
								?>
						</table>
					</div>
				</div>
			</div>
        </div>
    </div>
</div>

<?php
	if(isset($_REQUEST['withdrawal'])){
		
		$id = $_REQUEST['withdrawal'];
		
		//mysqli_query($conn,"DELETE FROM user_staff WHERE us_id=$id") or die (mysql_error());
		
		header('Location: index.php?pagecontent=admins');  
	}
?>