本文整理汇总了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);
}
示例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'];
}