<?php
session_start();
include 'config/db.php';
include 'config/function.php';
include 'config/config.php';

if (isset($_SESSION["USER_LOGIN"]) && $_SESSION['USER_LOGIN'] != "") {
    $user = $_SESSION['USER_LOGIN'];
    $Get = mysqli_query($link, "SELECT * FROM users WHERE email = '$user' ");
    
    if (mysqli_num_rows($Get) > 0) {
        $row = mysqli_fetch_assoc($Get);
        
        $user_id = $row['id'];
        $uid = $row['id'];
        $name = $row['name'];
        $email = $row['email'];
        $created_at  = $row['created_at'];
    } else {
        // echo '<script>window.location.href = "login.php";</script>';

    }
} else {
    // echo '<script>window.location.href = "login.php";</script>';

}
?>
