An error happened.

\n"; } } if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["edit"])) { if (isset($_POST["edit"])) foreach (get_users_products_array() as $product) { if ($product["public_id"] === $_POST["edit"]) { $edit_id = $_POST["edit"]; $edit_name = $product["name"]; $edit_description = $product["description"]; $edit_expiration = $product["expiration_date"]; } } } if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["edit_completed"])) { if (isset($_POST["name"]) && isset($_POST["description"]) && isset($_POST["expiration"])) { if (!update_product($_POST["edit_completed"], $_POST["name"], $_POST["description"], $_POST["expiration"])) { $erreur = "

Something went wrong. Try again later.

"; } } else { $erreur = "

One of the edited section is missing.

"; } } $product_list = ""; foreach (get_users_products_array() as $row) { $product_list = $product_list . "" . htmlspecialchars($row["name"]) . "" . htmlspecialchars($row["description"]) . "" . htmlspecialchars($row["added_date"]) . "" . htmlspecialchars($row["expiration_date"] !== NULL ? $row["expiration_date"] : "-") . "" . htmlspecialchars($row["cupboard_name"] !== NULL ? $row["cupboard_name"] : "-") . "" . "
" . "" . "
" . "\n"; } ?> List products
Nom Description Ajouté le Expiration Rangement associé Editer Supprimer