<?php
session_start();
require'Database.php';
$database = new Database;
if(!$_SESSION['username']){
	header('Location: ../index.php');
	die();
}else{
    

?>	
<!DOCTYPE html>
<html lang="en">
  <?php include'head.php'; ?>
  <body class="app sidebar-mini rtl">
    <!-- Navbar-->
    <?php include'topnav.php'; ?>
    <!-- Sidebar menu-->
    <div class="app-sidebar__overlay" data-toggle="sidebar"></div>
    <?php include'nav.php'; ?>
    <main class="app-content">
      
        <div class="clearfix"></div>
        <div class="col-md-12">
          <div class="tile">
            <h3 class="tile-title">Tracking Information</h3>
            <div class="table-responsive">
                <form method="post" class="form">
                  <input type="text" name="track" class="form-control" placeholder="Tracking Number"><br/>
                  <input type="text" name="location" class="form-control" placeholder="Location"><br/>
                  <select name="status" class="form-control">
                    <option>Select Status</option>
                    <option>Processing</option>
                    <option>Pending</option>
                    <option>Canceled</option>
                    <option>Delivered</option>
                  </select><br/>
                  <label for="date">Date</label>
                  <input type="date" name="date" class="form-control" placeholder="Enter Date"><br/>
                  <input type="submit" name="submit" value="Submit" class="form-control">


                </form>
            </div>
          </div>
            <?php
    include "../connect.php";
if(isset($_POST["submit"])){
    $track = $_POST['track'];
    $location = $_POST['location'];
    $status = $_POST['status'];
    $date = $_POST['date'];


        $adduser = $conn->query("INSERT INTO track(track_no,location,status,date_d) 
        VALUES('$track','$location','$status','$date')");
        echo "<font color='green'><b>Your Registration was successful<b></font>";
}
?>
        </div>
        </div>
    </main>

    <!-- Essential javascripts for application to work-->
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script>
    <!-- The javascript plugin to display page loading on top-->
    <script src="js/plugins/pace.min.js"></script>
    <!-- Page specific javascripts-->
    <!-- Google analytics script-->
    <script type="text/javascript">
      if(document.location.hostname == 'pratikborsadiya.in') {
      	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      	ga('create', 'UA-72504830-1', 'auto');
      	ga('send', 'pageview');
      }
    </script>
  </body>
</html>
<?php
}
?>