<?php

session_start();

if (!isset($_SESSION['email'])) {
  echo ("<script>location.href = 'login.php';</script>");
}
require_once 'db.php';
$id = $_SESSION['id'];
$query = "SELECT * FROM parcel WHERE id = '$id'";
$result = mysqli_query($db, $query);
$row = mysqli_fetch_assoc($result);
?>

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="assects/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="assects/css/font-awesome.min.css">
  <link rel="stylesheet" href="assects/css/font-awesome-animation.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="assects/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
  folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="assects/css/_all-skins.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="assects/css/dataTables.bootstrap.min.css">
  <script src="https://use.fontawesome.com/2aec379aeb.js"></script>

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

<body class="hold-transition skin-purple sidebar-mini">
  <div class="wrapper">

    <title>Admin Panel | Courier Cargo</title>
    <header class="main-header">
      <!-- Logo -->
      <a href="index.php" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>Admin</b></span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>Admin</b> Panel</span>
      </a>
      <!-- Header Navbar: style can be found in header.less -->
      <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
          <span class="sr-only">Toggle navigation</span>
        </a>

        <div class="navbar-custom-menu">
          <ul class="nav navbar-nav">
            <li class="dropdown user user-menu">
              <a><span class="hidden-xs">Welcome Admin</span></a>
            </li>
          </ul>
        </div>
      </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
      <!-- sidebar: style can be found in sidebar.less -->
      <section class="sidebar">

        <ul class="sidebar-menu" data-widget="tree">
          <li><a href="index.php"><i class="fa fa-dashboard"></i> <span>Dashboard</span></a></li>
          <li class="treeview active">
            <a href="#">
              <i class="fa fa-truck"></i> <span>Shipment</span>
              <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
            </a>
            <ul class="treeview-menu">
              <li><a href="new.php"><i class="fa fa-angle-double-right"></i> Add Shipment</a></li>
              <li class='active'><a href="index.php"><i class="fa fa-angle-double-right"></i> List of Pending Shipment</a></li>
            </ul>
          </li>
<li><a href="change_password.php"><i class="fa fa-sign-out"></i> <span>Change Password</span></a></li>
          <li><a href="logout.php"><i class="fa fa-sign-out"></i> <span>Logout</span></a></li>
        </ul>
      </section>
      <!-- /.sidebar -->
    </aside>
    <br />
    <script type="text/javascript">
      function loadrec(x) {
        if (x == 3)
          document.getElementById('delivered').style.display = "block";
        else
          document.getElementById('delivered').style.display = "none";
      }
    </script>
    <link rel="stylesheet" href="assects/css/bootstrap-timepicker.min.css">
    <link href="assects/css/jquery-ui.min.css" rel="stylesheet" type="text/css" />
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <h1>
          Update Status - <?php echo $row['cno']; ?> </h1>
        <ol class="breadcrumb">
          <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
          <li class="active">Shipment - Update Status</li>
        </ol>
      </section>

      <!-- Main content -->
      <section class="content">
        <!-- Small boxes (Stat box) -->
        <div class="row">



          <div class="col-md-10 col-md-offset-1">
            <form name="addcustomers" method="post" action="process.php">
              <div class="box">

                <div class="box-body">

                  <h3 class="box-title">Update Status</h3>


                  <?php if (isset($_SESSION['msg-s'])) { ?>
                    <div class="alert alert-success alert-dismissible">
                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                      <h4><i class="icon fa fa-check"></i> Success!</h4> <?php echo $_SESSION['msg-s']; ?>
                    </div>
                  <?php unset($_SESSION['msg-s']);
                  } ?>

                  <?php if (isset($_SESSION['msg-e'])) { ?>
                    <div class="alert alert-error alert-dismissible">
                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                      <h4><i class="icon fa fa-check"></i> Error!</h4> <?php echo $_SESSION['msg-e']; ?>
                    </div>
                  <?php unset($_SESSION['msg-e']);
                  } ?>
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="updateddate">Updated Date<span class="text-red">*</span></label>
                      <input type="text" class="form-control" name="updateddate" id="updateddate">
                    </div>
                  </div>

                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="updatedtime">Updated Time<span class="text-red">*</span></label>
                      <input type="text" class="form-control" name="updatedtime" id="updatedtime">
                    </div>
                  </div>
                 
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="destination">Status</label>
                      <select name="ustatus" id="status" class="form-control">
                        <option value="In Transit" selected>In Transit</option>
                        <option value="Pending">Pending</option>
                        <option value="Delivered">Delivered</option>
                        <option value="Delayed">Delayed</option>
                        <option value="On Hold">On Hold</option>
                        <option value="Landing">Landing</option>
                        <option value="Clearance">Clearance </option>
                        <option value="In  Sorting">In Sorting</option>
                        <option value="In  Process">In Process</option>
                        <option value="In  Progress">In Progress</option>
                        <option value="Arrived">Arrived</option>
                        <option value="Shipment Pickup">Shipment Pickup</option>
                      </select>
                    </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="location">Location<span class="text-red">*</span></label>
                      <input name="location" placeholder="London" id="location" class="form-control">
                    </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="destination">About Shipment</label>
                      <select name="about" id="status" class="form-control">
                        <option value="Item has left" selected> Item has left</option>
                        <option value="Item has left"> Item has left</option>
                        <option value="Item has arrived at"> Item has arrived at</option>
                        <option value="Item received at"> Item received at</option>
                        
                        
                      </select>
                    </div>
                  </div>
                  <div class="clearfix"></div>
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="remarks">Remarks</label>
                      <textarea class="form-control" placeholder="Enter Remarks" name="remarks" id="remarks"></textarea>
                    </div>
                  </div>
                  <input type="hidden" name="cno" value="<?php echo $row['cno']; ?>">
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                  <button type="submit" name="updatestatus" class="btn btn-primary pull-right">Submit</button>
                </div>
              </div>
            </form>
          </div>
        </div>
        <!-- /.row -->

      </section>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
      <strong>Copyright &copy; 2022.</strong> All rights reserved.
    </footer>
  </div>
  <!-- ./wrapper -->

  <!-- jQuery 3 -->
  <script src="assects/js/jquery.min.js"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="assects/js/jquery-ui.min.js"></script>
  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <!-- Bootstrap 3.3.7 -->
  <script src="assects/js/bootstrap.min.js"></script>
  <!-- DataTables -->
  <script src="assects/js/jquery.dataTables.min.js"></script>
  <script src="assects/js/dataTables.bootstrap.min.js"></script>
  <!-- AdminLTE App -->
  <script src="assects/js/adminlte.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="assects/js/demo.js"></script>
</body>

</html>
<script src="assects/js/bootstrap-timepicker.min.js"></script>

<script src="assects/js/jquery.validate.min.js"></script>