本文整理汇总了PHP中product::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP product::delete方法的具体用法?PHP product::delete怎么用?PHP product::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: product
<?php
include '../products.php';
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
// get the 'id' variable from the URL
$product_id = $_GET['id'];
//echo $product_id;
$product = new product();
$product->delete($product_id);
header("location:AllProduct.php");
} else {
header("location:AllProduct.php");
}
示例2: product
$products = new product($_GET['selected_pID']);
$subcategory = new Subcategory($products->scID);
$cID = $subcategory->cID;
$category = new Category($cID);
$data['scName'] = $subcategory->scName;
$data['cName'] = $category->cName;
$data['pro'] = (array) $products;
$data = json_encode($data);
echo $data;
exit;
}
}
if (isset($_GET['pID'])) {
if (!empty($_GET['pID'])) {
$products = new product($_GET['pID']);
$path = $products->pImg;
unlink($path);
$products->delete();
exit;
}
}
if (isset($_GET['op'])) {
if (!empty($_GET['op'])) {
if ($_GET['op'] == 'searchList') {
$products = new product();
$allPro = $products->products();
$allPro = json_encode($allPro);
echo $allPro;
}
}
}
示例3: foreach
!$product->get_value("sellPrice") and alloc_error("Please enter a Sell Price.");
if (!$TPL["message"]) {
$product->save();
$productID = $product->get_id();
// If they were in the middle of creating a sale, return them back there
if ($_REQUEST["productSaleID"]) {
alloc_redirect($TPL["url_alloc_productSale"] . "productSaleID=" . $_REQUEST["productSaleID"]);
} else {
alloc_redirect($TPL["url_alloc_product"] . "productID=" . $productID);
}
}
$product->set_values();
} else {
if ($_POST["delete"]) {
$product->read_globals();
$product->delete();
alloc_redirect($TPL["url_alloc_productList"]);
}
}
# Fixed costs
if ($_POST["save_costs"] || $_POST["save_commissions"]) {
foreach ((array) $_POST["productCostID"] as $k => $productCostID) {
// Delete
if (in_array($productCostID, (array) $_POST["deleteCost"])) {
$productCost = new productCost();
$productCost->set_id($productCostID);
$productCost->select();
$productCost->delete();
// Save
} else {
if (imp($_POST["amount"][$k])) {
示例4: dmsg
if ($do->pass($post)) {
$do->edit($post);
dmsg('修改成功', $forward);
} else {
msg($do->errmsg);
}
} else {
extract($do->get_one());
$addtime = timetodate($addtime);
$menuid = 1;
include tpl('product_edit', $module);
}
break;
case 'delete':
$itemid or msg('请选择产品');
$do->delete($itemid);
dmsg('删除成功', $forward);
break;
default:
$sfields = array('标题', '简介', '计量单位', '主要市场', '编辑', '参数名1', '参数名2', '参数名3', '参数值1', '参数值2', '参数值3');
$dfields = array('title', 'content', 'unit', 'market', 'editor', 'n1', 'n2', 'n3', 'v1', 'v2', 'v3');
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '报价数量降序', '报价数量升序', '浏览次数降序', '浏览次数升序');
$dorder = array('addtime DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'item DESC', 'item ASC', 'hits DESC', 'hits ASC');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
isset($order) && isset($dorder[$order]) or $order = 0;
$level = isset($level) ? intval($level) : 0;
$itemid or $itemid = '';
$fields_select = dselect($sfields, 'fields', '', $fields);
$level_select = level_select('level', '级别', $level);
$order_select = dselect($sorder, 'order', '', $order);
$condition = '1';
示例5: product
<?php
if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
$product = new product();
$product->setId($_REQUEST['i']);
if ($product->delete()) {
print 'sucess';
} else {
print 'error';
}
} else {
print 'error';
}