<?php

include("dbset.php");

$con = mysqli_connect("localhost",$dbu,$dbp);
if (!$con)
  {
  die('Could not connect to database: ' . mysqli_error());
  }
   
mysqli_select_db($con, $dbs);

	$cx =$_GET['cx'];
	
	$table_name = "system_users";
	$access_query = "SELECT username FROM $table_name WHERE access_id = '".$cx."' ";
	$access_result = $con->query($access_query);
	$row = mysqli_fetch_assoc($access_result);
	$login_name = $row["username"];
	
	$table_name = "active_users";
	$delete_query = "DELETE FROM $table_name WHERE username = '".$login_name."' "; 
	$delete_result = $con->query($delete_query);
?>

<script language="javascript" type="text/javascript">
          window.location="../main.php?e=";
</script>