<?
$dbAction = CIBlockElement::GetList(array('name'=>'ASC'), array('IBLOCK_ID'=>'5', 'ACTIVE'=>'Y', 'PROPERTY_FOR_DILER_VALUE'=>false), FALSE, array('nTopCount'=>30), array('PROPERTY_GROUP_OF_BRAND', 'PROPERTY_PROD_GRUP', 'IBLOCK_ID', 'ID', 'CODE', 'NAME', 'PROPERTY_BRAND', 'PROPERTY_COLOR_ELEM'));
if ($dbAction->SelectedRowsCount()>0) { ?>
<?
$sky=1;
?>
<div id="rbl_act_title">Акции</div>
<div id="rbl_act_content">
<div class="nav_act"><a id="next2" href="#"><img src="/templates/edm/img/uparrow.gif" width="46" alt="Предыдущие"></a></div>
<div id="s2">
<div>
<?
while ($arAction = $dbAction->GetNext()) {
/*if ($arAction['PROPERTY_BRAND_VALUE'] && $arAction['PROPERTY_GROUP_OF_BRAND_VALUE']=='да') {
$dbSec = CIBlockSection::GetList(array(), array('IBLOCK_ID'=>'2', 'ACTIVE'=>'Y', 'UF_BRAND_PROD'=>$arAction['PROPERTY_BRAND_VALUE']), FALSE, array('UF_*'));
while ($arSec = $dbSec->GetNext()) {
$arrID[] = array("ID"=>$arSec['ID'], "ACTION_ID"=>$arAction['ID'], "ACTION_NAME"=>$arAction['NAME']);
}
} elseif ($arAction['PROPERTY_PROD_GRUP_VALUE']) {
$dbEl = CIBlockElement::GetList(array(), array('IBLOCK_ID'=>'2', 'ACTIVE'=>'Y', 'SECTION_ID'=>$arAction['PROPERTY_PROD_GRUP_VALUE'], 'INCLUDE_SUBSECTIONS'=>'Y'), array('IBLOCK_SECTION_ID'), FALSE, array('IBLOCK_ID', 'ID', 'IBLOCK_SECTION_ID'));
while ($arEl = $dbEl->GetNext()) {
if (!in_array($arEl['IBLOCK_SECTION_ID'], $arrID)) {
$arrID[] = array("ID"=>$arEl['IBLOCK_SECTION_ID'], "ACTION_ID"=>$arAction['ID'], "ACTION_NAME"=>$arAction['NAME']);
}
}
}*/ if ($arAction['PROPERTY_COLOR_ELEM_VALUE']) {
$dbEl = CIBlockElement::GetList(array(), array('IBLOCK_ID'=>'2', 'ACTIVE'=>'Y', 'ID'=>$arAction['PROPERTY_COLOR_ELEM_VALUE'], 'INCLUDE_SUBSECTIONS'=>'Y'), FALSE, FALSE, array('IBLOCK_ID', 'ID', 'IBLOCK_SECTION_ID'));
while ($arEl = $dbEl->GetNext()) {
if (!in_array($arEl['IBLOCK_SECTION_ID'], $arrID)) {
$arrID[] = array("ID"=>$arEl['IBLOCK_SECTION_ID'], "ACTION_ID"=>$arAction['ID'], "ACTION_CODE"=>$arAction['CODE'], "ACTION_NAME"=>$arAction['NAME'], "COLOR_ID"=>$arAction['PROPERTY_COLOR_ELEM_VALUE']);
}
}
}
}
//var_dump($arrID);
//var_dump($arrID);
$skysky=0;
$in_str=0;
$biliSec=array();
while ($skysky!=8) {
$rand = rand(0, (count($arrID)-1));
$idSec = $arrID[$rand]['ID'];
//if (in_array($idSec, $biliSec)) {
// continue;
//}
// else {
$biliSec[]=$idSec;
//}
$idAct = $arrID[$rand]['ACTION_CODE'];
$nameAct = $arrID[$rand]['ACTION_NAME'];
$arSecL = GetIblockSection($idSec);
$tmpSec = array();
$nav = CIBlockSection::GetNavChain('2', $idSec);
while ($tmpNav = $nav->GetNext()) {
if ($tmpNav['CODE']!='') {
$tmpSec[]=$tmpNav['CODE'];
} else {
$tmpSec[]=$tmpNav['ID'];
}
}
$link = '/catalog/';
$link .= $tmpSec[count($tmpSec)-2].'/';
$link .= $tmpSec[count($tmpSec)-1].'/';
$arFilterMainGo |