<?php 
include('buiapp/partials/header.php');
 $username = $_SESSION['staff_session'];
$cookie_name = "username";
$cookie_value = password_hash($username, PASSWORD_DEFAULT);
setcookie($cookie_name, $cookie_value);
include ('buiapp/phpClasses/functions.php');
if (isset($_SESSION['staff_session'])) {
    $username = $_SESSION['staff_session'];
	$csession =  currentSession();
		$role = getrole($username, $csession);
		include('header.php');
		
		if(!isset($_COOKIE[$cookie_name])) {
		    
//cookiemail($username);
} else {
      
}

} else {
    	if(!isset($_COOKIE[$cookie_name])) {
     // cookiemail($username);
} else {
     
}
    header('Location: index.php');
    
    exit();
}
if(authenticate() != 1){
		header('Location: error.php');
		exit();
}else{
	$pid = $_SESSION['pid'];
	$buino = $_SESSION['staff_session'];
	$hma = $_SESSION['username'];
	
}







?>