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


PHP customer::delete方法代码示例

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


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

示例1: delete

 public function delete($id = 0)
 {
     if ($id != 0) {
         // Create and delete customer
         $customer = new customer($id);
         $customer->delete();
     } else {
         $database = $_SESSION['database'];
         $id = $database->prepare_input($id);
         $customer_query = $database->query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $this->id . "'");
         // Reset id, otherwise one might think this customer (still) exists in db
         $this->id = 0;
     }
 }
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:14,代码来源:customer.php

示例2: customer

$customerInst = new customer();
#######################################################################
## perform action
$status = 1;
if (tool::securePost('action') == "save" && tool::securePost('id')) {
    # fill customer with submitted data
    $customerInst->id = tool::securePost('id');
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->update();
} elseif (tool::securePost('action') == "save") {
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->insert();
}
if (tool::securePost('action') == "delete") {
    $customerInst->id = tool::securePost('id');
    $customerInst->delete();
}
if (tool::securePost('action') == "edit") {
    $status = 0;
    $customerInst->activate(tool::securePost('id'));
}
#######################################################################
## make edit / new form
if (!$status) {
    echo "<h2>" . $lang['common_editRecord'] . " (<a href=\"" . $toolInst->encodeUrl("index.php?content=" . $content) . "\">" . $lang['common_newRecord'] . "</a>)</h2>\n";
} else {
    $customerInst->clear();
    echo "<h2>" . $lang['common_newRecord'] . "</h2>\n";
}
?>
开发者ID:pmtool,项目名称:pmtool,代码行数:30,代码来源:customers.php

示例3: database

<?php

if ($_POST) {
    include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php';
    include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/customer.php';
    $database = new database();
    $db = $database->getConnection();
    $customer = new customer($db);
    $customer->cust_kode = $_POST['object_id'];
    if ($customer->delete()) {
        echo "customer berhasil dihapus.";
    } else {
        echo "customer tidak bisa dihapus.";
    }
}
开发者ID:ilhamdoanggg,项目名称:penjualan_salon,代码行数:15,代码来源:delete.php


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