%PDF- %PDF-
Direktori : /home/bitrix/www/local/components/UB/main.profile.map/ |
Current File : /home/bitrix/www/local/components/UB/main.profile.map/component.php |
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); $arResult["ID"] = intval($USER->GetID()); $strError = ''; if($_SERVER["REQUEST_METHOD"]=="POST" && ($_REQUEST["save"] <>'' || $_REQUEST["apply"] <> '') && check_bitrix_sessid()) { $arFields = array( "WORK_STREET" => $_REQUEST["WORK_STREET"], // Адрес (улица, дом и тд) "WORK_PROFILE" => $_REQUEST["WORK_PROFILE"], // График работы "WORK_NOTES" => $_REQUEST["WORK_NOTES"], // Комментарий к схеме "WORK_POSITION" => $_REQUEST["WORK_POSITION"], // Позиция метки на карте ); $obUser = new CUser; if(!$obUser->Update($arResult["ID"], $arFields, true)) $strError .= $obUser->LAST_ERROR; if ($strError=='') $arResult['DATA_SAVED'] = 'Y'; } $res = CIBlockElement::GetList(array(), array("IBLOCK_ID"=>IBLOCK_PROFILE_ID, "PROPERTY_ACCOUNT"=>$arResult["ID"]), false, false, array("IBLOCK_ID", "ID", "PROPERTY_REGION")); $arResult['REGION'] = ''; if($ar_fields = $res->GetNext()) { $res = CIBlockElement::GetByID($ar_fields['PROPERTY_REGION_VALUE']); if($ar_res = $res->GetNext()) {$region = $ar_res["NAME"]; $s_id=$ar_res["IBLOCK_SECTION_ID"];} $res = CIBlockSection::GetByID($s_id); if($ar_res = $res->GetNext()) {$region = $ar_res["NAME"].", ".$region; $s_id=$ar_res["IBLOCK_SECTION_ID"];} $res = CIBlockSection::GetByID($s_id); if($ar_res = $res->GetNext()) {$region = $ar_res["NAME"].", ".$region; $s_id=$ar_res["IBLOCK_SECTION_ID"];} $arResult['REGION'] = $region; } $arResult["strProfileError"] = $strError; $arResult["BX_SESSION_CHECK"] = bitrix_sessid_post(); $rsUser = CUser::GetByID($arResult["ID"]); $arUser = $rsUser->Fetch(); $arResult['arUser'] = $arUser; $this->IncludeComponentTemplate();