Я решил так:
Но что-то я туплю сегодня, как бы это:
Побыстрее на Битрикс АПИ сделать?..
| Код |
|---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
//var_dump ($_GET);
//var_dump ($_REQUEST);
$strrepl = $arResult["FORM_ACTION"];
$strrepl = str_replace("/e-store/","",$strrepl);
$itxt = strpos($strrepl, '/');
$text11 = substr($strrepl, 0, $itxt);
$sId=$text11;
$arVendors=array();
//GetSubSectionIds($IBLOCK_ID, $SECTION_ID, $sId);
//if($sId)
//{
$r=mysql_query("SELECT ibp.VALUE FROM b_iblock_element AS ibe
LEFT JOIN b_iblock_element_property AS ibp ON (ibp.IBLOCK_ELEMENT_ID=ibe.ID AND ibp.IBLOCK_PROPERTY_ID=98)
WHERE ibe.IBLOCK_SECTION_ID IN ({$sId}) AND ibe.ACTIVE='Y' GROUP BY ibp.VALUE ORDER BY ibp.VALUE");
while($f=mysql_fetch_row($r))
{
// $arVendors[]=$f[0];
$arVendors[] = preg_replace('#(изготовитель:)?(.*)#i', '\\2', $f[0]);
}
//}
?>
<form name="<?echo $arResult["FILTER_NAME"]."_form"?>" action="<?echo $arResult["FORM_ACTION"]?>" method="get">
<?foreach($arResult["ITEMS"] as $arItem):
//var_dump ($arItem);
if(array_key_exists("HIDDEN", $arItem)):
echo $arItem["INPUT"];
endif;
endforeach;?>
<table class="data-table" cellspacing="0" cellpadding="2">
<thead>
<tr>
<td colspan="2" align="center"><h2>Фильтр товаров</h2></td>
</tr>
</thead>
<tbody>
<?foreach($arResult["ITEMS"] as $arItem):?>
<?if(!array_key_exists("HIDDEN", $arItem)):?>
<?
if($arItem["NAME"] == 'Производитель')
{?>
<tr>
<td valign="top"><?=$arItem["NAME"]?>:</td>
<td valign="top">
<?
echo '<select name="FILTER_pf[FPROIZV]" class="select"><option value=""></option>';
foreach($arVendors as $v)
{
if(!$v) { continue;}
if($v == $value) { $stmp=' selected';} else { $stmp='';}
$v=htmlspecialchars($v);
if ($v == $_REQUEST["FILTER_pf"]["FPROIZV"] && !$_REQUEST["del_filter"])
{
$stmp=' selected';
echo '<option value="'.$_REQUEST["FILTER_pf"]["FPROIZV"].'"'.$stmp.'>'.$_REQUEST["FILTER_pf"]["FPROIZV"].'</option>';
}
else
{
echo '<option value="'.$v.'"'.$stmp.'>'.$v.'</option>';
}
}
echo '</select></td></tr>';
}
else
{?>
<tr>
<td valign="top"><?=$arItem["NAME"]?>:</td>
<td valign="top"><?=$arItem["INPUT"]?></td>
</tr>
<?}?>
<?endif?>
<?endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan="2">
<input type="submit" name="set_filter" value="<?=GetMessage("IBLOCK_SET_FILTER")?>" /><input type="hidden" name="set_filter" value="Y" /> <input type="submit" name="del_filter" value="<?=GetMessage("IBLOCK_DEL_FILTER")?>" /></td>
</tr>
</tfoot>
</table>
</form> |
Но что-то я туплю сегодня, как бы это:
| Код |
|---|
$r=mysql_query("SELECT ibp.VALUE FROM b_iblock_element AS ibe
LEFT JOIN b_iblock_element_property AS ibp ON (ibp.IBLOCK_ELEMENT_ID=ibe.ID AND ibp.IBLOCK_PROPERTY_ID=98)
WHERE ibe.IBLOCK_SECTION_ID IN ({$sId}) AND ibe.ACTIVE='Y' GROUP BY ibp.VALUE ORDER BY ibp.VALUE");
while($f=mysql_fetch_row($r))
{
// $arVendors[]=$f[0];
$arVendors[] = preg_replace('#(изготовитель:)?(.*)#i', '\\2', $f[0]);
} |
Побыстрее на Битрикс АПИ сделать?..
