<?php
session_start();
if (!empty($_SESSION['step3'])) {
    session_destroy();
}
if (!empty($_SESSION['step1'])) {
    header('location:step_1.php');
} else if (!empty($_SESSION['step1']) && !empty($_SESSION['step2'])) {
    header('location:step_2.php');
}
require_once("db/AppManager.php");
$pm = AppManager::getPM();
?>
<?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="index.php">Playz $5 Rebate & Warranty Form</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 class="row center_">
        <div class="col-lg-12">
            <h1 class="page-header">
                <img src="img/front.jpg" width="100%"></img>
            </h1>
        </div>
    </div>
    <div class="row center_">
        <div class="col-lg-12">
            <b>Playz $5 Rebate + Extended Warranty Form!</b>
        </div>
    </div>
    <div class="row center_">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <form method="post" action="function.php" autocomplete="off">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label>17 Digit Amazon Order # with Dashes: </label>
                                    <input class="form-control" name="order_id" type="text" placeholder="xxx-xxxxxxx-xxxxxxx" required="">
                                </div>
                                <div class="form-group">
                                    <label>Email Address: </label>
                                    <input class="form-control" name="email_address" placeholder="your@email.com" type="email" required="">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <input type="hidden" name="action" value="step_1" required>
                                    <br>
                                    <button type="submit" class="btn btn-primary pull-right" name="user_sub">Next</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <?php include 'fragments/js.php';
    ?>
</body>

</html>