<?php


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

$active_query = "SELECT username, log_in, last_active  FROM active_users  ";
$active_result = $con->query($active_query);
$active_num = mysqli_num_rows($active_result);
while($row = $active_result->fetch_assoc()) {
	$a0 = $row["username"];
	$a1 = $row["log_in"];
	$a2 = $row["last_active"];
	
	
	$last_time=strtotime($a2);
	
	$a10 = ($time - $last_time);
		
	if ( $a10 > 3000) {
		  
		  $delete_query = "DELETE FROM active_users WHERE username='".$a0." ' ";
		  $delete_result = $con->query($delete_query);
		 		  
	}
	
}

?>