<?php 


include('../conn.php');


if(isset($_POST['submit'])){
    $data =$_POST['id'];
	$name =$_POST['name'];
    $price=$_POST['price'];
    $date=$_POST['date'];
    $by=$_POST['by'];
    $location=strtolower($_POST['location']);

		$sql = "UPDATE `menu` SET `name`='$name',`price`='$price',`date`='$date',`uploadby`='$by'WHERE id='$data'";
		if(mysqli_query($conn,$sql)){
      echo"<script>alert('You Have Successfully updated  menu'); window.location='../$location'</script>";
		}
		else{
		  echo 'Error: '.mysqli_error($conn);
		}
	}
 
