<?php
//session_unset();
session_start();
include('../include/config.php');
$date = new DateTime("now", new DateTimeZone('Africa/Nairobi') );
$timenow=$date->format('Y-m-d H:i:s');
$timenow2=$date->format('Y-m-d');
$month=$date->format('M');

$id=$_SESSION['user_idd'];
//$scode=$_SESSION['sessioncode'];

$sql3=mysqli_query($con,"INSERT INTO activity(user,Action,Tim,Dat,shortmsg,Month)values('$id','signed out','$timenow','$timenow2','logout','$month')");
 if($sql3)
 {}
//$sql2=mysqli_query($con,"UPDATE logs set Timeout='$timenow' where sessionn ='$scode'");
 //if($sql2)
// { }
unset($_SESSION["betapos"]);
unset($_SESSION['user_idd']);
unset($_SESSION['name']);
 $gr=$_SESSION['cl'];
 unset($_SESSION['tm']);
 unset($_SESSION['yr']); 
 unset($_SESSION['cl']); 
                         

header("location:../");
?>