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


PHP CRatings::Update方法代碼示例

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


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

示例1: dirname

# http://www.bitrixsoft.com                  #
# mailto:admin@bitrixsoft.com                #
##############################################
require_once dirname(__FILE__) . "/../include/prolog_admin_before.php";
ClearVars();
if (!$USER->CanDoOperation('edit_ratings')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
$ID = intval($ID);
$message = null;
$bVarsFromForm = false;
if ($_SERVER['REQUEST_METHOD'] == "POST" && ($_POST['save'] != "" || $_POST['apply'] != "") && check_bitrix_sessid()) {
    $arFields = array("ACTIVE" => isset($_POST['ACTIVE']) ? $_POST['ACTIVE'] : 'N', "NAME" => $_POST['NAME'], "ENTITY_ID" => $_POST['ENTITY_ID'], "CALCULATION_METHOD" => $_POST['CALCULATION_METHOD'], "CONFIGS" => $_POST['CONFIGS'], "POSITION" => isset($_POST['POSITION']) ? 'Y' : 'N', "AUTHORITY" => isset($_POST['AUTHORITY']) ? 'Y' : 'N', "NEW_CALC" => isset($_POST['NEW_CALC']) ? 'Y' : 'N');
    if ($ID > 0) {
        $res = CRatings::Update($ID, $arFields);
    } else {
        $ID = CRatings::Add($arFields);
        $res = $ID > 0;
    }
    if ($res) {
        if ($apply != "") {
            $_SESSION["SESS_ADMIN"]["RATING_EDIT_MESSAGE"] = array("MESSAGE" => GetMessage("RATING_EDIT_SUCCESS"), "TYPE" => "OK");
            LocalRedirect("rating_edit.php?ID=" . $ID . "&lang=" . LANG);
        } else {
            LocalRedirect($_REQUEST["addurl"] != "" ? $_REQUEST["addurl"] : "rating_list.php?lang=" . LANG);
        }
    } else {
        if ($e = $APPLICATION->GetException()) {
            $message = new CAdminMessage(GetMessage("RATING_EDIT_ERROR"), $e);
        }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:rating_edit.php

示例2: IntVal

		"ACTIVE"	=> $find_active,
		"ID"		=> $find_id,
		"ENTITY_ID"	=> $find_entity_id,
	);
}

if($lAdmin->EditAction())
{
	foreach($FIELDS as $ID=>$arFields)
	{
		$ID = IntVal($ID);
		if($ID <= 0)
			continue;
		$arUpdate['NAME'] = $arFields['NAME'];
		$arUpdate['ACTIVE'] = $arFields['ACTIVE'] == 'Y' ? 'Y' : 'N';
		if(!CRatings::Update($ID, $arUpdate))
		{
			$e = $APPLICATION->GetException();
			$lAdmin->AddUpdateError(($e? $e->GetString():GetMessage("RATING_LIST_ERR_EDIT")), $ID);
		}
	}
}

if(($arID = $lAdmin->GroupAction()))
{
	if($_REQUEST['action_target']=='selected')
	{
		$rsData = CRatings::GetList(array($by=>$order), $arFilter);
		while($arRes = $rsData->Fetch())
			$arID[] = $arRes['ID'];
	}
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:31,代碼來源:rating_list.php


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