<?php
/* Displays all successful messages */
require 'db.php';
session_start();
//zobrazí zprávu podle toho zda je uřet již aktivován emailem
if ($_SESSION['active']==1) {
   $zprava = "Gratulujeme!";
}
else{
    $zprava = "Aktivujte email";
}
?>
<!DOCTYPE html>
<html>
<head>
    <title><?=$zprava?></title>
    
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class=" container my-5 p-4 col-md-5 col-sm-12 col-lg-5 bg-dark text-center text-white" style="height: 40%; border-radius: 15px">
    <h1><?=$zprava?></h1>
    <p>
    <?php 
    if( isset($_SESSION['message']) AND !empty($_SESSION['message']) ):
        echo $_SESSION['message'];    
    else:
        header( "location: index.php" );
    endif;
    ?>
    </p>
    <a href="index.php"><button class="btn btn-outline-success btn-lg"/>Home</button></a>
    <span style="display: block; margin-top: 60px ">iagriculture.cz</span>
</div>
</body>
</html>
