<?php if (isset($_POST['btnCatUpdate'])) { require_once CLASSES . 'category.php'; $cat_id = $_POST['hidCatID']; $cat_name = $_POST['txtCatName']; $cat_desc = $_POST['txtCatDesc']; $cat = new Category($cat_id, 'edit'); if ($cat->update_category($cat_name, $cat_desc)) { url_redirect(HTTP_SERVER . 'index.php?category=1'); } else { } } if (isset($_POST['btnCatAdd'])) { require_once CLASSES . 'category.php'; $cat_name = $_POST['txtCatName']; $cat_desc = $_POST['txtCatDesc']; $cat = new Category(); if ($cat->add_category($cat_name, $cat_desc)) { url_redirect(HTTP_SERVER . 'index.php?category=1'); } else { } } if (isset($_POST['btnCatDelete'])) { require_once CLASSES . 'category.php'; $cat_id = $_POST['hidCatID']; $cat = new Category($cat_id, 'edit'); if ($cat->delete_category()) { url_redirect(HTTP_SERVER . 'index.php?category=1'); } else { }