本文整理汇总了PHP中CSaleOrderUserProps::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderUserProps::Delete方法的具体用法?PHP CSaleOrderUserProps::Delete怎么用?PHP CSaleOrderUserProps::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderUserProps
的用法示例。
在下文中一共展示了CSaleOrderUserProps::Delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnUserDelete
public static function OnUserDelete($ID)
{
$ID = IntVal($ID);
$db_res = CSaleOrderUserProps::GetList($b = "ID", $o = "ASC", array("USER_ID" => $ID));
while ($ar_res = $db_res->Fetch()) {
CSaleOrderUserProps::Delete(IntVal($ar_res["ID"]));
}
return True;
}
示例2: foreach
// пройдем по списку элементов
foreach($arID as $ID)
{
if(strlen($ID)<=0){
continue;
}
$ID = IntVal($ID);
// для каждого элемента совершим требуемое действие
switch($_REQUEST['action'])
{
// удаление
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
if(!CSaleOrderUserProps::Delete($ID))
{
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("ws.saleuserprofiles_del_err"), $ID);
}
$DB->Commit();
break;
// активация/деактивация
/*case "activate":
case "deactivate":
if(($rsData = CSaleOrderUserProps::GetByID($ID)) && ($arFields = $rsData->Fetch()))
{
$arFields["ACTIVE"]=($_REQUEST['action']=="activate"?"Y":"N");
if(!CSaleOrderUserProps::Update($ID, $arFields))
$lAdmin->AddGroupError(GetMessage("ws.saleuserprofiles_save_error").$cData->LAST_ERROR, $ID);
}
示例3: Trim
$arParams["PATH_TO_DETAIL"] = Trim($arParams["PATH_TO_DETAIL"]);
if (strlen($arParams["PATH_TO_DETAIL"]) <= 0) {
$arParams["PATH_TO_DETAIL"] = htmlspecialcharsbx($APPLICATION->GetCurPage() . "?ID=#ID#");
}
$arParams["PER_PAGE"] = intval($arParams["PER_PAGE"]) <= 0 ? 20 : intval($arParams["PER_PAGE"]);
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
if ($arParams["SET_TITLE"] == 'Y') {
$APPLICATION->SetTitle(GetMessage("SPPL_DEFAULT_TITLE"));
}
//Delete profile
$errorMessage = "";
$del_id = IntVal($_REQUEST["del_id"]);
if ($del_id > 0 && check_bitrix_sessid()) {
$dbUserProps = CSaleOrderUserProps::GetList(array(), array("ID" => $del_id, "USER_ID" => IntVal($USER->GetID())));
if ($arUserProps = $dbUserProps->Fetch()) {
if (!CSaleOrderUserProps::Delete($arUserProps["ID"])) {
$errorMessage = GetMessage("SALE_DEL_PROFILE");
}
} else {
$errorMessage = GetMessage("SALE_NO_PROFILE");
}
if (strlen($errorMessage) > 0) {
LocalRedirect($APPLICATION->GetCurPageParam("del_id=" . $del_id, array("del_id", "sessid")));
} else {
LocalRedirect($APPLICATION->GetCurPageParam("success_del_id=" . $del_id, array("del_id", "sessid")));
}
}
if (IntVal($_REQUEST["del_id"]) > 0) {
$errorMessage = GetMessage("SALE_DEL_PROFILE", array("#ID#" => IntVal($_REQUEST["del_id"])));
} elseif (IntVal($_REQUEST["success_del_id"]) > 0) {
$errorMessage = GetMessage("SALE_DEL_PROFILE_SUC", array("#ID#" => IntVal($_REQUEST["success_del_id"])));
示例4: trim
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
CModule::IncludeModule("sale");
if ($_REQUEST["action"] == "delete" && intval($_REQUEST["id"]) > 0) {
CSaleOrderUserProps::Delete(intval($_REQUEST["id"]));
}
if ($_REQUEST["action"] == "update" && intval($_REQUEST["id"]) > 0) {
$profileName = trim($_REQUEST["f_name"] . " " . $_REQUEST["name"] . " " . $_REQUEST["last_name"]);
$arFields = array("NAME" => $profileName);
CSaleOrderUserProps::Update($_REQUEST["id"], $arFields);
if (!empty($_REQUEST["name"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["name_id"], array("VALUE" => $_REQUEST["name"]));
}
if (!empty($_REQUEST["f_name"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["f_name_id"], array("VALUE" => $_REQUEST["f_name"]));
}
if (!empty($_REQUEST["last_name"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["last_name_id"], array("VALUE" => $_REQUEST["last_name"]));
}
if (!empty($_REQUEST["email"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["email_id"], array("VALUE" => $_REQUEST["email"]));
}
if (!empty($_REQUEST["phone"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["phone_id"], array("VALUE" => $_REQUEST["phone"]));
}
if (!empty($_REQUEST["phone"])) {
CSaleOrderUserPropsValue::Update($_REQUEST["phone_id"], array("VALUE" => $_REQUEST["phone"]));
}