Example #1
0
}
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 {
    }
}
if (isset($_POST['btnTagUpdate'])) {
    require_once CLASSES . 'tag.php';
    $tag_id = $_POST['hidTagID'];
    $tag_name = $_POST['txtTagName'];
    $tag = new Tag($tag_id, 'edit');
    if ($tag->update_tag($tag_name)) {
        url_redirect(HTTP_SERVER . 'index.php?tag=1');
    } else {
    }
}
if (isset($_POST['btnTagAdd'])) {