<?php
session_start();
require("../mainconfig.php");
if (isset($_SESSION['user'])) {
	$sess_username = $_SESSION['user']['username'];
	}
session_destroy();
				 	$insert_user = mysqli_query($db, "INSERT INTO catatan (username, note, waktu) VALUES ('$sess_username', 'Kamu telah melakukan aktifitas Logout', '$date $time')");
				 	if ($insert_user == TRUE) {
					header("Location: ".$cfg_baseurl."pages/user/login");
				 }