<?php
include_once("./db.php");
ob_start();
date_default_timezone_set("Asia/Kolkata");
$logout_tym = date('Y-m-d H:i:s');
$user_detail['logout_time']=$logout_tym;
$user_id=$_SESSION["admin"]["uid"];
$myid=$db->getVal("SELECT max(id) from user_detail where user_id='".$user_id."' ORDER BY id DESC LIMIT 1");
$db->updateAry("user_detail",$user_detail," where id=".$myid);
//echo $db->getLastQuery();exit;
$db->updateAry("users",array("token"=>'')," where id='".$user_id."' ");
setcookie("user_session", "", time() - 3600);
//echo $db->getLastQuery();exit;
session_destroy() ;

session_regenerate_id();
?><br /><br /><br /><br /><br /><br />
        <center><img src="<?php echo URL_ROOT; ?>image/loader.gif" /></center>
        <?php
unset($_SESSION["admin"]);
unset($_SESSION);
header("Location: ./");
ob_flush();
?>