28
designed to check if a user is logged in as an admin. If the $_SESSION['ADMIN_ID'] is empty, it redirects the user to the index.php page.
However, there's a small typo in the function name. It should be admin_login_check instead of adimn_login_check. Additionally, it's good practice to include an exit() after the header('Location: ../index.php'); to ensure that no further code execution occurs after the redirection.
public function admin_login_check()
{
if(empty($_SESSION['ADMIN_ID']))
{
header('Location: ../index.php');
exit();
}
}