<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$carIB=IntVal(trim($_REQUEST["IB"]));
$carSB=IntVal(trim($_REQUEST["SB"]));
$carMEST=trim($_REQUEST["MEST"]) ;
$carPRIVOD=trim($_REQUEST["PRIVOD"]) ;
$carDVIG=trim($_REQUEST["DVIG"]) ;
if(CModule::IncludeModule("iblock")){
$arSelect = Array("ID", "NAME", "PROPERTY_MEST", "PROPERTY_PRIVOD", "PROPERTY_PRICE", "PROPERTY_DVIG", "PROPERTY_MODEL");
$arFilter = Array("IBLOCK_ID"=>$carIB, "SECTION_ID"=>$carSB, "PROPERTY_MEST"=>$carMEST, "PROPERTY_PRIVOD"=>"Задний", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1), $arSelect);
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
$json['MEST']=$arFields['PROPERTY_MEST_VALUE'];
$json['PRIVOD']=$arFields['PROPERTY_PRIVOD_VALUE'];
$json['DVIG']=$arFields['PROPERTY_DVIG_VALUE'];
$json['PRICE']=$arFields['PROPERTY_PRICE_VALUE'];
$json['MODEL']=$arFields['PROPERTY_MODEL_VALUE'];
}
echo json_encode($json);
}
?>
|