<?php
/*
********************************************************************************

    filename:    foodlistprocess.php
    description: redirect to header based on action selected
    inputs:      foodId
    outputs:     add
                 update, foodId
                 delete, foodId
    actions:     none
    redirection: foodaddupdate (add, update)
                 fooddeleteprocess (delete)

********************************************************************************
*/
    if ($_POST["add"]) {
        header('Location: foodaddupdate.php?action=add');
    } elseif ($_POST["update"]) {
        $foodId = $_POST["foodId"];
        header('Location: foodaddupdate.php?action=update&foodId=' . $foodId);
    } elseif ($_POST["delete"]) {
        $foodId = $_POST["foodId"];
        header('Location: fooddeleteprocess.php?foodId=' . $foodId);
    } else {
        header('Location: foodlist.php');
   }
?>