當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。