<!DOCTYPE html>
<?php
session_start();
require_once ("db/AppManager.php");
if (isset($_SESSION['error']) != 'order_not_found' || isset($_SESSION['error']) != 'invalid_code'||isset($_SESSION['error'])!='order_id_Exisist') {
    header('Location:index.php');
} else {
    $error = $_SESSION['error'];
    if ($error == 'order_id_Exisist') {
        $error = 'This order ID has already been redeemed! Please contact
<a href="mailto:sales@playzusa.com" target="_top" >sales@playzusa.com </a>if you think this is a mistake';
    } else if ($error == 'order_not_found') {
        $error = "the order ID you entered is invalid! Please contact <a href='mailto:sales@playzusa.com' target='_top'> sales@playzusa.com </a>";
    }
    session_destroy();
}
?>
<?php include 'fragments/head.php';?>
    <body style="background: #fff">
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="">Playz $5 Rebate</a>
            </div>
        </nav>
		 <div class="row center_" >
        <div class="col-lg-12">           
             <center>  <img src="img/alllogo.jpg" width="30%"></img>    </center>     
        </div>
    </div>
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <?php
                    if (!empty($error)) {
                        ?>
                        <div class="alert alert-danger">
                            <strong>Sorry!</strong> <?php echo $error; ?>
                        </div>
                        <?php
                    }
                    ?>
                </div>
            </div>
        </div>
        <?php include 'fragments/js.php';?>
    </body>
</html>
