本文整理匯總了PHP中customer::action_update_taxes方法的典型用法代碼示例。如果您正苦於以下問題:PHP customer::action_update_taxes方法的具體用法?PHP customer::action_update_taxes怎麽用?PHP customer::action_update_taxes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類customer
的用法示例。
在下文中一共展示了customer::action_update_taxes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: exit
exit(0);
} else {
$_SESSION["error"]["form"]["customer_add"] = "failed";
header("Location: ../index.php?page=customers/add.php");
exit(0);
}
}
/*
Process Data
*/
// start transaction
$sql_obj = new sql_query();
$sql_obj->trans_begin();
// update customer
$obj_customer->action_update();
$obj_customer->action_update_taxes();
// commit
if (error_check()) {
$sql_obj->trans_rollback();
} else {
//if successful, change the number of contacts if there were some deleted
for ($i = 0; $i < $num_contacts; $i++) {
$_SESSION["error"]["num_records_{$i}"] = $_SESSION["error"]["num_records_{$i}"] - $num_del_records[$i];
}
$_SESSION["error"]["num_contacts"] = $_SESSION["error"]["num_contacts"] - $num_del_contacts;
$sql_obj->trans_commit();
}
// display updated details
header("Location: ../index.php?page=customers/view.php&id=" . $obj_customer->id);
exit(0);
} else {
示例2: customer
function set_customer_tax($id, $taxid, $status)
{
log_debug("customers_manager", "Executing set_customer_tax({$id}, values...)");
if (user_permissions_get("customers_write")) {
$obj_customer = new customer();
/*
Load SOAP Data
*/
$obj_customer->id = @security_script_input_predefined("int", $id);
$taxid = @security_script_input_predefined("int", $taxid);
$status = @security_script_input_predefined("any", $status);
foreach (array_keys($obj_customer->data) as $key) {
if ($obj_customer->data[$key] == "error") {
throw new SoapFault("Sender", "INVALID_INPUT");
}
}
if ($status != "on" && $status != "off") {
throw new SoapFault("Sender", "INVALID_INPUT");
}
/*
Error Handling
*/
// verify customer ID
if (!$obj_customer->verify_id()) {
throw new SoapFault("Sender", "INVALID_ID");
}
/*
Perform Changes
*/
// fetch customer's current tax status
$sql_customer_taxes_obj = new sql_query();
$sql_customer_taxes_obj->string = "SELECT taxid FROM customers_taxes WHERE customerid='" . $obj_customer->id . "'";
$sql_customer_taxes_obj->execute();
if ($sql_customer_taxes_obj->num_rows()) {
$sql_customer_taxes_obj->fetch_array();
foreach ($sql_customer_taxes_obj->data as $data_tax) {
$obj_customer->data["tax_" . $data_tax["taxid"]] = "on";
}
}
// change the status of the supplied option
if ($status == "on") {
$obj_customer->data["tax_" . $taxid] = "on";
} else {
$obj_customer->data["tax_" . $taxid] = "";
}
if ($obj_customer->action_update_taxes()) {
return 1;
} else {
throw new SoapFault("Sender", "UNEXPECTED_ACTION_ERROR");
}
} else {
throw new SoapFault("Sender", "ACCESS DENIED");
}
}