本文整理汇总了PHP中Products::del方法的典型用法代码示例。如果您正苦于以下问题:PHP Products::del方法的具体用法?PHP Products::del怎么用?PHP Products::del使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products
的用法示例。
在下文中一共展示了Products::del方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
if (isset($_POST['checkin_product']) && !empty($_POST['id'])) {
$result = $product->checkProducts($_POST['id'], 1);
}
if (isset($_POST['checkout_product']) && !empty($_POST['id'])) {
$result = $product->checkProducts($_POST['id'], 2);
}
if (isset($_POST['del'])) {
$deleted = false;
foreach ($_POST['id'] as $val) {
$picture = $product->field("picture", "id=" . $val);
@unlink($media_paths['attachment_dir'] . $picture);
@unlink($media_paths['attachment_dir'] . $picture . ".small.jpg");
}
if (is_array($_POST['id'])) {
$deleted = $product->del($_POST['id']);
if (!$deleted) {
flash();
}
}
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == "edit") {
if (!empty($id)) {
$res = $product->getInfo($id);
if (!empty($res['picture'])) {
$res['image'] = pb_get_attachmenturl($res['picture'], '../', 'small');
示例2: massdelete
/**
* delete the products selected
* @param array
* @return Boolean
*/
public static function massdelete($ids)
{
foreach ($ids as $id) {
Products::del($id);
}
return true;
}
示例3: deleteAction
/**
*
* Delete a record previously selected by the product
*/
public function deleteAction()
{
$this->view->headTitle()->append($this->translator->translate("Delete product"));
$id = $this->getRequest()->getParam('id');
try {
if (is_numeric($id)) {
if (Products::del($id)) {
$this->_helper->redirector('list', 'products', 'admin', array('mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
} else {
$this->_helper->redirector('list', 'products', 'admin', array('mex' => 'The product is locked by a order', 'status' => 'danger'));
}
}
} catch (Exception $e) {
$this->_helper->redirector('list', 'products', 'admin', array('mex' => $e->getMessage(), 'status' => 'danger'));
}
}
示例4: flash
break;
}
if (!empty($id)) {
$vals['state'] = $state;
$updated = $pdb->Execute("UPDATE {$tb_prefix}products SET state={$state} WHERE id={$id} AND member_id={$the_memberid}");
if (!$updated) {
flash();
}
} else {
flash();
}
}
if (($do == "del" || $_GET['act'] == "del") && !empty($id)) {
$res = $product->read("id", $id);
if ($res) {
if (!$product->del($_GET['id'], $conditions)) {
flash();
}
} else {
flash("data_not_exists");
}
}
}
if (isset($_GET['typeid']) && !empty($_GET['typeid'])) {
$conditions[] = "producttype_id = " . $_GET['typeid'];
}
$amount = $product->findCount(null, $conditions, "Product.id");
$page->setPagenav($amount);
$result = $product->findAll("sort_id,id,name,picture,content,created,status,state", null, $conditions, "Product.id DESC", $page->firstcount, $page->displaypg);
if ($result) {
$i_count = count($result);
示例5: flash
break;
}
if (!empty($id)) {
$vals['state'] = $state;
$updated = $pdb->Execute("UPDATE {$tb_prefix}products SET state={$state} WHERE id={$id} AND member_id={$the_memberid}");
if (!$updated) {
flash();
}
} else {
flash();
}
}
if (($do == "del" || $_GET['act'] == "del") && !empty($id)) {
$res = $product->read("id", $id);
if ($res) {
if (!$product->del($id, $conditions)) {
flash();
}
} else {
flash("data_not_exists");
}
}
}
if (isset($_GET['typeid']) && !empty($_GET['typeid'])) {
$conditions[] = "type_id = '" . intval($_GET['typeid']) . "'";
}
$amount = $product->findCount(null, $conditions, "Product.id");
$page->setPagenav($amount);
$result = $product->findAll("sort_id,id,name,picture,content,created,status,state", null, $conditions, "Product.id DESC", $page->firstcount, $page->displaypg);
if ($result) {
$i_count = count($result);