} else {
        header("Location:../product_index.php?action=add&result=-1");
    }
} else {
    if (isset($_POST["btnUpdateProduct"])) {
        include_once "../../../controller/ProductController.php";
        $id = $_REQUEST["id"];
        $name = $_REQUEST["name"];
        $type = $_REQUEST["type"];
        $sub_type = $_REQUEST["sub_type"];
        $description = $_REQUEST["description"];
        $description = str_replace("'", "", $description);
        $price = $_REQUEST["price"] * 1000;
        $promotion_id = $_REQUEST["promotion_id"];
        $present_type = $_REQUEST["present_type"];
        $result = ProductController::Update($id, $name, $type, $sub_type, $price, $description, $promotion_id, $present_type);
        if ($result) {
            header("Location:../product_index.php?action=view&id=" . $id);
        }
    } else {
        if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "delete") {
            include_once "../../../controller/ProductController.php";
            require_once "../utils/product_util.php";
            $id = $_REQUEST["id"];
            $result = ProductController::Delete($id);
            if ($result) {
                echo ProductUtil::createMessageBox("DELETE PRODUCT", "Delete completed!");
            } else {
                echo ProductUtil::createMessageBox("DELETE PRODUCT", "Delete does not complete!");
            }
        } else {