<?php

	session_start();
    require_once('libs/Ultraviolet.php');
	require_once('libs/Database.php');
	require('libs/FormKey.php');

	$database =& DatabaseConnect::getInstance();
	$database->query("SET CHARACTER SET utf8");
	
	if(!isset($_SESSION['admin_username'])){
		
		if(!isset($_COOKIE['username']) && !isset($_COOKIE['password'])){
			
	header('location:login.php');
	
		}
		
		else{ 
			header('location:libs/CookieCheck.php');
		}
	
	}
	
	else { 
	
		header('location:admin.php');
	
	}
	

	
?>

