<?php
include("../include/session.php");

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

$userid = $_GET['userid'];

$table_name = $_SESSION['db_prefix']."_users";
$username_query = "SELECT username FROM $table_name WHERE userid = '".$userid."'  ";
$username_result = mySQL_query($username_query);
$username = mysql_result($username_result, 0, "username");

$table_name = $_SESSION['db_prefix']."_users";
$del_user_query  = "DELETE FROM $table_name WHERE userid = '".$userid."' ";
//echo $del_user_query;
execsql($del_user_query);

$table_name = $_SESSION['db_prefix']."_tracking_admin";
$trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '122', '".$username."','','', '' )";
$trackingResult = mySQL_query($trackingQuery);
?>
<script language="javascript" type="text/javascript">
          window.location="remove_user.php?user_select=&s=0;";
</script>

															  