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


PHP Products::del方法代码示例

本文整理汇总了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');
开发者ID:vuong93st,项目名称:w-game,代码行数:31,代码来源:product.php

示例2: massdelete

 /**
  * delete the products selected 
  * @param array
  * @return Boolean
  */
 public static function massdelete($ids)
 {
     foreach ($ids as $id) {
         Products::del($id);
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:12,代码来源:Products.php

示例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'));
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:20,代码来源:ProductsController.php

示例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);
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:product.php

示例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);
开发者ID:reboxhost,项目名称:phpb2b,代码行数:31,代码来源:product.php


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