} else { $filepath = ""; } $food = new Foods(); $food->setFood(mysql_real_escape_string($_POST['food'])); $food->setPrice(mysql_real_escape_string($_POST['price'])); $food->setIngredients(mysql_real_escape_string($_POST['ingredients'])); $food->setDescription(mysql_real_escape_string($_POST['description'])); $food->setType(mysql_real_escape_string($_POST['types'])); $food->setMeal(mysql_real_escape_string($_POST['meal'])); $food->setVeg(mysql_real_escape_string($_POST['veg'])); $food->setSpicy(mysql_real_escape_string($_POST['spicy'])); $food->setDelivery(mysql_real_escape_string($_POST['deliver'])); $food->setDtime(mysql_real_escape_string($_POST['dtime'])); $food->setImgs($filepath); $processfood = new Processfood(); $msg_register = $processfood->addFood($food); if ($msg_register == 0) { header("Location: myfood.php"); } } ?> <section id="form" style="margin-top: 0px"><!--form--> <div class="container"> <div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="login-form" ><!--login form--> <h2>Add food item</h2> <form enctype="multipart/form-data" action="addfood.php" method="post" onsubmit="return addFoodisValid()">
}*/ $food = new Foods(); $food->setId($_POST['id']); $food->setFood(mysql_real_escape_string($_POST['food'])); $food->setPrice(mysql_real_escape_string($_POST['price'])); $food->setIngredients(mysql_real_escape_string($_POST['ingredients'])); $food->setDescription(mysql_real_escape_string($_POST['description'])); $food->setType(mysql_real_escape_string($_POST['types'])); $food->setMeal(mysql_real_escape_string($_POST['meal'])); $food->setStock(mysql_real_escape_string($_POST['stock'])); $food->setVeg(mysql_real_escape_string($_POST['veg'])); $food->setSpicy(mysql_real_escape_string($_POST['spicy'])); $food->setDelivery(mysql_real_escape_string($_POST['delivery'])); $food->setDtime(mysql_real_escape_string($_POST['dtime'])); $food->setImgs($filepath); $processfood = new Processfood(); $msg_register = $processfood->updateFood($food); if ($msg_register == 0) { // header("Location: myfood.php"); } } ?> <section id="form" style="margin-top: 0px"><!--form--> <div class="container"> <div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="login-form" ><!--login form--> <h2>Edit food item</h2> <form enctype="multipart/form-data" action="editFood.php" method="post" onsubmit="return addFoodisValid();">
<?php include '../include/adminheader.php'; include_once '../model/dbconnect.php'; include '../model/processfood.php'; include '../view/food.php'; if (!isset($_POST['btn-submit'])) { $processfood = new Processfood(); $foods = $processfood->getFood(); } if (isset($_GET['delete'])) { $delete = $_GET['delete']; $processfood = new Processfood(); $msg = $processfood->deleteFood($delete); if ($msg == 1) { header("Location: myfood.php"); } } ?> <section id="cart_items"> <div class="container"> <h4>My Food</h4> <?php if ($msg == 1) { ?> <div class="alert alert-success"> <strong>Success!</strong> Food item was deleted. </div> <?php