當前位置: 首頁>>代碼示例>>PHP>>正文


PHP customer::action_delete方法代碼示例

本文整理匯總了PHP中customer::action_delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP customer::action_delete方法的具體用法?PHP customer::action_delete怎麽用?PHP customer::action_delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在customer的用法示例。


在下文中一共展示了customer::action_delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

    /*
    	Error Handling
    */
    // make sure the customer actually exists
    if (!$obj_customer->verify_id()) {
        log_write("error", "process", "The customer you have attempted to edit - " . $obj_customer->id . " - does not exist in this system.");
    }
    // check if the customer can be safely deleted
    if ($obj_customer->check_delete_lock()) {
        log_write("error", "process", "This customer can not be removed because their account has invoices or time groups belonging to it.");
    }
    // return to the input page in the event of an error
    if ($_SESSION["error"]["message"]) {
        $_SESSION["error"]["form"]["customer_delete"] = "failed";
        header("Location: ../index.php?page=customers/delete.php&id=" . $obj_customer->id);
        exit(0);
    }
    /*
    	Delete Customer
    */
    // delete customer
    $obj_customer->action_delete();
    // return to customers list
    header("Location: ../index.php?page=customers/customers.php");
    exit(0);
} else {
    // user does not have perms to view this page/isn't logged on
    error_render_noperms();
    header("Location: ../index.php?page=message.php");
    exit(0);
}
開發者ID:carriercomm,項目名稱:amberdms-bs,代碼行數:31,代碼來源:delete-process.php

示例2: customer

 function delete_customer($id)
 {
     log_debug("customers", "Executing delete_customer_details({$id}, values...)");
     if (user_permissions_get("customers_write")) {
         $obj_customer = new customer();
         /*
         	Load SOAP Data
         */
         $obj_customer->id = @security_script_input_predefined("int", $id);
         if (!$obj_customer->id || $obj_customer->id == "error") {
             throw new SoapFault("Sender", "INVALID_INPUT");
         }
         /*
         	Error Handling
         */
         // verify customer ID
         if (!$obj_customer->verify_id()) {
             throw new SoapFault("Sender", "INVALID_ID");
         }
         // check that the customer can be safely deleted
         if ($obj_customer->check_delete_lock()) {
             throw new SoapFault("Sender", "LOCKED");
         }
         /*
         	Perform Changes
         */
         if ($obj_customer->action_delete()) {
             return 1;
         } else {
             throw new SoapFault("Sender", "UNEXPECTED_ACTION_ERROR");
         }
     } else {
         throw new SoapFault("Sender", "ACCESS DENIED");
     }
 }
開發者ID:carriercomm,項目名稱:amberdms-bs,代碼行數:35,代碼來源:customers_manage.php


注:本文中的customer::action_delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。