<?php 
include("conn.php"); 
if(isset($_POST["employee_idse"]))  
{  
     $data=$_POST['employee_idse'];


      $query = "SELECT * FROM menu WHERE id = '$data'";  
      $result = mysqli_query($conn, $query);  
      while ($row=mysqli_fetch_array($result)) {
          $name=$row['name'];
          $status=$row['status'];
          $price=$row['price'];
          $description=$row['discription'];
          $itemlocation=$row['itemlocation'];
          $text='';
        
          if($itemlocation=='Bar'){
              $item_location='bar';
              
          }
          else{
            $item_location='restaurant_menu';
              
          }
          



 }  
}
 ?>
<?php include("common/head.php");?>


  
  <!-- Modal -->
 
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title text-center text-dark" id="exampleModalLabel">Edit menu</h5>
        </div>
        <div class="modal-body">


     
            <form  method="post" action="edit/menu_item.php" enctype="multipart/form-data" class="text-dark">
                <div class="form-group">
                  <label for="exampleFormControlInput1">Menu Name</label>
                  <input type="text" name="name" class="form-control" id="exampleFormControlInput1" value="<?php echo $name?>">
                </div> 
               
                

                  <div class="form-group">
                    <label for="exampleFormControlInput1">Menu Price</label>
                    <input type="number" name="price" class="form-control" id="exampleFormControlInput1" value="<?php echo $price ?>">
                  </div>

                  <div class="form-group">
                    <label for="exampleFormControlInput1">Description</label>
                    <input type="text" name="description" class="form-control"  value="<?php echo $description ?>" >
                  </div>

                  <input type="hidden" name="location" value="<?php echo $item_location?>">
                  <input type="hidden" name="id" value="<?php echo $_POST['employee_idse']?>">
                  <input type="hidden" name="by" value="<?php echo $id_user ?>">
                  <input type="hidden" name="date" value="<?php echo date("F j, Y") ?>">
                  <button type="submit"  name="submit" class="btn btn-primary btn-sm">Submit</button>
              </form>
        </div>
        <div class="modal-footer">
          <a href="<?php echo $item_location?>" class="btn btn-secondary" >Close</a>
  
        </div>
      </div>
    </div>
