<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Каталог товаров, предоставляемых партнерами");
?><?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Каталог товаров, предоставляемых партнерами");
?><?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Каталог товаров, предоставляемых партнерами");
?> <?if(IsModuleInstalled('sale')):?>
<div align="right"><?$APPLICATION->IncludeComponent(
"bitrix:sale.basket.basket.line",
"",
Array(
"PATH_TO_BASKET" => "/personal/cart/",
"PATH_TO_PERSONAL" => "/personal/",
"SHOW_PERSONAL_LINK" => "N"
)
);?></div>
<?endif?> <?
if(CModule::IncludeModule("partnernet"))
{
//Получаем свой ид==================================
$arUser=CUser::GetByID($USER->GetID())->GetNext();
//==================================================
global $USER;
$currentUserId = ($USER->GetID());
$id;
$frId = Array();
$frComp = Array();
$dbFriends = CPNUserRelations::GetRelatedUsers(
$currentUserId,
PN_RELATIONS_FRIEND
);
while ($arFriends = $dbFriends->GetNext())
{
$first_friend_id = $arFriends["FIRST_USER_ID"];
$second_friend_id = $arFriends["SECOND_USER_ID"];
//если 1й ид мой собственный, то выводим 2й ид друга
if ($arUser["ID"] == $first_friend_id)
{ if(($second_friend_id != NULL)& ($arUser["ID"] != NULL))
{
$IDFr = $second_friend_id;
$FrUser = CUser::GetByID($IDFr);
$arFrUser = $FrUser->Fetch();
}
}
//если 2й ид - мой собственный, то выводим 1й ид друга
elseif ($arUser["ID"] == $second_friend_id)
{
if(($first_friend_id != NULL)& ($arUser["ID"] != NULL))
{
$IDFr = $first_friend_id;
$FrUser = CUser::GetByID($IDFr);
$arFrUser = $FrUser->Fetch();
}
}
else
{
echo "<pre>";
print_r("Нет у тебя друзей!)");
echo "</pre>";
}
array_push($frId,$IDFr);
array_push($frComp,$arFrUser[WORK_COMPANY]);
}
}
GLOBAL $arrFilterTop;
$arrFilterTop[] = array(
"LOGIC" => "OR",
"PROPERTY_CML2_COMPANY_SELLER" => $frComp
);
?>
|