<?php
include 'db_connection.php';
 session_start();
 $cek_uid =$_SESSION['username'];
 $timezone = "Asia/Jakarta";
 date_default_timezone_set($timezone);  
 $datetime = new DateTime(date("Y-m-d H:i:s"));
 $str_datetime = $datetime->format("Y-m-d H:i:s");
 //$datetime = date('Y-m-d H:i:s'); 
 $sql  = ("UPDATE user SET status = 'A', last_activity = '$str_datetime' WHERE user_id = '$cek_uid'");
 $query = mysqli_query($conn, $sql);
 session_destroy();
 echo "<script>  window.location.href='../../login.php';</script>";
?>