<?php 
include("conn.php"); 
if(isset($_GET['id'])){
    $l=$_GET['l'];
    $type=$_GET['type'];
	$id=mysqli_real_escape_string($conn, $_GET['id']);
    $id=base64_decode($id);
      $sql2= "SELECT * FROM orders WHERE orderid = '$id'"; 
$result2 = mysqli_query($conn,$sql2)or die( mysqli_error($conn));
      while ($row2=mysqli_fetch_array($result2)) {
        $data=$row2['id'];
$order_id=$row2['orderid'];
$real_id=substr($order_id,-2);
$ord = sprintf('%03d',$real_id);
 }  
}
 ?>
<?php include("common/head.php");?>
<div class="activate-itme text-center m-5 card">
     <p class="activate"> Are you sure you want to Cancel #<?php echo $ord?> order</p>
     <form action="edit/order_status_update.php" method="post">
     <div class="form-group">
    <label for="exampleFormControlSelect1">Select Reason of Canceling order</label>
    <select class="form-control" name="reason" id="exampleFormControlSelect1">
    <option value="nan">Select</option>
      <option value="Item Out of stock" >Item Out of stock</option>
      <option value="Additional Item Not available">Additional Item Not available </option>
      <option value="Item Kept to Long to prepare">Item Kept to Long to prepare</option>
      <option value="Customer Request">Customer Request</option>
    </select>
  </div>
        <input type="hidden" name="id" value="<?php echo $data?>">
         <input type="hidden" name="location" value="<?php echo $l?>">
        <input type="hidden" name="orderid" value="<?php echo $order_id?>">
        <input type="hidden" name="status" value="2">
        <input type="hidden" name="by" value="<?php echo $id_user?>">
        <input type="hidden" name="date" value="<?php echo date("F j, Y, h:ia")?>">
        <button name=submit class=" btn btn-primary   btn-sm m-2">Submit</button>
        <a href="<?php echo $l ?>"  class=" btn btn-success btn-sm m-2">Back</a>
    </form>
</div>
  