当前位置: 首页>>代码示例>>PHP>>正文


PHP category::delete方法代码示例

本文整理汇总了PHP中category::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP category::delete方法的具体用法?PHP category::delete怎么用?PHP category::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在category的用法示例。


在下文中一共展示了category::delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: category

<?php

include 'category.php';
if (isset($_GET['id'])) {
    if ($_GET['value'] == 'Delete') {
        $category = new category($_GET['id']);
        $category->delete();
        $jsondata = json_encode($category->getallcategory());
        echo $jsondata;
    }
    if ($_GET['value'] == 'Update') {
        $errors = [];
        $category = new category($_GET['id']);
        if (empty(trim($_GET['name']))) {
            $errors[] = "the name is empty";
            $_SESSION['errors'] = $errors;
        }
        if ($category->category_is_exist($_GET['name'])) {
            $errors[] = "the category is already exist";
            $_SESSION['errors'] = $errors;
        }
        if (empty(trim($_GET['desc']))) {
            $errors[] = "the desc is empty";
            $_SESSION['errors'] = $errors;
        }
        if (!empty($errors)) {
            $errors[] = $_GET["id"];
        } else {
            $category->category_name = $_GET['name'];
            $category->category_desc = $_GET['desc'];
            $category->update();
开发者ID:sherif700,项目名称:ourWork,代码行数:31,代码来源:category_server.php

示例2: category

                }
            }
        }
        break;
    case 'delete_entry':
        // Check for dependencies
        $administration_category = new category($_POST['categories_id']);
        if ($administration_category->has_dependencies()) {
            $error_level = 2;
            // Related role(s) exist
            $_POST['action'] = '';
        }
        break;
    case 'delete_entry_confirmed':
        $administration_category = new category($_POST['categories_id']);
        $administration_category->delete();
        unset($_POST['categories_id']);
        $_POST['action'] = '';
        break;
}
// Create a new category object with id == 0 (default)
$_SESSION['category'] = new category();
// header //
require DIR_WS_INCLUDES . 'header.php';
?>
<!-- body //-->
  <table border="0" width="100%" cellspacing="3" cellpadding="3">
    <tr>
      <td width="<?php 
echo BOX_WIDTH;
?>
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:31,代码来源:administration_categories.php

示例3: category

<?php

include 'categoryclass.php';
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    // get the 'id' variable from the URL
    $id = $_GET['id'];
    $categ = new category();
    $categ->delete($id);
    header("location:addcategory.php");
} else {
    header("location:addcategory.php");
}
开发者ID:zeinamagdy,项目名称:E-Commerce-Web-Application-,代码行数:12,代码来源:removecategory.php

示例4: localRedirect

                $_SESSION['category_manager']['error_msg'] = 'Please enter a name and description!';
            }
            localRedirect('/admin/category-manager.php');
            break;
        case 'update':
            if (!empty($_POST['catDesc']) and !empty($_POST['catName'])) {
                $result = category::update((int) $_POST['cat_parent'], $_POST['catName'], $_POST['catDesc']);
                $_SESSION['category_manager']['error_msg'] = PEAR::isError($result) ? 'Failed to insert category: ' . $result->message : 'Category updated';
            } else {
                $_SESSION['category_manager']['error_msg'] = 'Please enter a name and description!';
            }
            localRedirect('/admin/category-manager.php');
            break;
        case 'delete':
            if (!empty($_POST['cat_parent'])) {
                $result = category::delete($_POST['cat_parent']);
                $_SESSION['category_manager']['error_msg'] = PEAR::isError($result) ? 'Failed to delete category: ' . $result->message : 'Category deleted';
            } else {
                $_SESSION['category_manager']['error_msg'] = 'Please select a category';
            }
            localRedirect('/admin/category-manager.php');
            break;
        default:
            localRedirect('/admin/category-manager.php');
    }
}
/**
 * Create the menu, set the db to assoc mode
 */
require_once 'HTML/TreeMenu.php';
$treeMenu = new HTML_TreeMenu();
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:category-manager.php

示例5: foreach

     foreach ($CATEGORY as $c) {
         update_category($c);
     }
     $do->cache();
     dmsg('更新成功', "?mid={$mid}&file={$file}");
     break;
 case 'cache':
     $do->repair();
     dmsg('更新成功', "?mid={$mid}&file={$file}");
     break;
 case 'delete':
     if ($catid) {
         $catids = $catid;
     }
     $catids or msg();
     $do->delete($catids);
     $NUM > 200 ? $do->cache() : $do->repair();
     dmsg('删除成功', $forward);
     break;
 case 'update':
     if (!$category || !is_array($category)) {
         msg();
     }
     $do->update($category);
     foreach ($category as $catid => $v) {
         $CATEGORY[$catid] = $db->get_one("SELECT * FROM {$table} WHERE catid={$catid}");
         update_category($CATEGORY[$catid]);
     }
     $NUM > 200 ? $do->cache() : $do->repair();
     dmsg('更新成功', $forward);
     break;
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:category.inc.php

示例6: delete_category

 public function delete_category($id)
 {
     if (!$this->user->is_logged_in()) {
         redirect("/user/main/userLogin", 'location');
     } else {
         $category = new category($id);
         $category->delete();
         redirect('/index.php/user/blog/categories', 'location');
     }
 }
开发者ID:hyrmedia,项目名称:builderengine,代码行数:10,代码来源:User_blog.php

示例7: category

<?php

if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
    $object_category = new category();
    $object_category->setId($_REQUEST['i']);
    if ($object_category->delete()) {
        print 'sucess';
    } else {
        print 'error';
    }
} else {
    print 'error';
}
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:13,代码来源:category_del.php


注:本文中的category::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。