<?php
include('config.php');

            if($__username=="" || $__password==""  )
            {
                 header('Location: setup.php');
            }

			if ($_SERVER['REQUEST_METHOD'] == 'POST')
			{
				if( isset($_POST["Username"]) && isset($_POST["password"]) )
				{
					if($_POST["Username"]==$__username && $_POST["password"]==$__password )
					{
						session_start();
						$_SESSION['LoggedIn'] = true;
						 header('Location: stickerpack.php');
					}
					else
					{
						echo "<div class='alert alert-danger'>Login Failed</div>";
					}	
				}
				else{
					echo "SSomething is wrong !";
				}
			}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex, nofollow">

    <title>StickerAdmin Login </title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
    <style type="text/css">
    body{
   background-color: rgba(26,32,44,var(--bg-opacity));
    --bg-opacity: 1;
    font-size:14px;
    color:#fff;
}
.simple-login-container{
    width:300px;
    max-width:100%;
    margin:50px auto;
}
.simple-login-container h2{
    text-align:center;
    font-size:20px;
}

.simple-login-container .btn-login{
    background-color:#FF5964;
    color:#fff;
}
a{
    color:#fff;
}    </style>
    <script src="scripts/jquery.min.js"></script>
    <script src="scripts/bootstrap.min.js"></script>
    
</head>
<body>



	<form action="index.php" method="post">
    <div class="simple-login-container">
    <h2>StickerAdmin Login </h2>
    <div class="row">
        <div class="col-md-12 form-group">
            <input type="text" class="form-control" placeholder="Username" name="Username" id="Username">
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 form-group">
            <input type="password" placeholder="Enter your Password" class="form-control" name="password" id="password">
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 form-group">
            <input type="submit" class="btn btn-block btn-login" placeholder="Enter your Password" >
        </div>
    </div>
    	</form>
		
		<?php
			
		?>
</div>

    <?php
        if($__testMode==true)
        {
            ?>
                <script type="text/javascript">
                    $(document).ready(function(){
                        $('#Username').val('<?php echo $__username?>');
                        $('#password').val('<?php echo $__password?>');
                    });
                </script>
            <?php
        }
    ?>

</body>
</html>
