<?php
require_once './MySQL/db.php';

$db = new DB();
$classFunctions = new Functions();

$cookie_name = "defaultDestId";
$defaultDestinationSelected = false;
$defaultDestinationId = 0;
if (!isset($_COOKIE[$cookie_name])) {
    $defaultDestinationSelected = false;
    $defaultDestinationId = 0;
} else {
    $defaultDestinationSelected = true;
    $defaultDestinationId = $_COOKIE[$cookie_name];
}

if (isset($_GET["action"]) AND $_GET["action"] == "clear") {
    $classFunctions->deleteAllCookies();
    header("Refresh:0; url=index.php");
}

if (isset($_POST['setDefaultDestId'])) {
    $getDestinationIdAsDefault = filter_input(INPUT_POST, 'setDefaultDestId');
    if ($classFunctions->testDestination($getDestinationIdAsDefault)) {
        $classFunctions->setCookie("defaultDestId", $getDestinationIdAsDefault);
        header("Refresh:0; url=index.php");
    }
}
?>  
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="robots" content="noindex, nofollow" />
        <meta name="author" content="Robert Michálek;info(at)all-computer.cz"/>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>Robertos agency - Enhance your travel experience</title>
        <meta name="description"  content="We are new business team in tourism - we want to help people to enjoy their dream vacation or trip for 200%, without any stress." />
        <meta name="keywords"  content="destination, country, poi, restaurant, travel, tourism, experince, vacation" />

        <!--[if lte IE 8]><script src="<?php echo Init::HOMEURL; ?>assets/js/ie/html5shiv.js"></script><![endif]-->
        <link rel="stylesheet" href="<?php echo Init::HOMEURL; ?>/assets/css/main.min.css" />
        <!--[if lte IE 8]><link rel="stylesheet" href="<?php echo Init::HOMEURL; ?>assets/css/ie8.min.css" /><![endif]-->
    </head>
    <body class="homepage">
        <div id="page-wrapper">

            <!-- Header -->
            <div id="header-wrapper">
                <header id="header" class="container">

                    <!-- Logo -->
                    <div id="logo">
                        <a href="<?php echo Init::HOMEURL; ?>" title="Back to homepage">
                            <h1><img src="<?php echo Init::HOMEURL; ?>/images/icon.png" alt="Logo" class="logoR">obertos</h1>
                        </a>
                        <span>agency</span>                        
                    </div>

                    <!-- Nav -->
                    <nav id="nav">
                        <ul>
                            <li><a href="<?php echo Init::HOMEURL; ?>"title="Back to homepage">Home</a></li>
                            <li><a href="<?php echo Init::HOMEURL; ?>about" title="About us page">About us</a></li>
                            <li>
                                <a href="<?php echo Init::HOMEURL; ?>pois" title="POIs page">POIs</a>
                            </li>
                            <li>
                                <a href="<?php echo Init::HOMEURL; ?>restaurants" title="Restaurants page">Restaurants</a>
                            </li>
                            <li><a href="<?php echo Init::HOMEURL; ?>contact" title="Contact us page">Contact us</a></li>
                        </ul>
                    </nav>
                </header>
            </div>