Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
setQuery(" SELECT id,name
FROM #__zoo_category
where
parent=\"{$cat}\"
and published=1
order by ordering")->loadAssocList();
if (count($list)<>0)
{
foreach($list as $row)
{
$m[]=$row['id'] ;
$m = array_merge($m, modWfitemsHelper::getCat($row['id'] ));
}
}
return $m;
}
static function getItems($type,$count,$limit)
{
$db = JFactory::getDbo();
$jinput = JFactory::getApplication()->input;
$category_id=preg_replace('/[^0-9]/', '',$jinput->get( 'category_id'));
if ($category_id)
{
//child
$sql_cat=' and (ci.category_id='.$category_id;
$m = modWfitemsHelper::getCat($category_id);
foreach($m as $item)
{
$sql_cat.=' or ci.category_id='.$item;
}
$sql_cat.=')';
if ($type=="МИ") {$sql_type=" and instr(i.elements,'\"mi\"')<>0";}
if ($type=="БП") {$sql_type=" and instr(i.elements,'\"bp\"')<>0";}
if ($count<>'') {$sql_count=" limit ".$count;}
$item = $db->setQuery(" SELECT distinct i.id
FROM jos_zoo_item i, jos_zoo_category_item ci
WHERE i.id=ci.item_id and i.state=1 and type=\"product\"{$sql_type}{$sql_cat}
order by created desc
{$sql_count}")->loadAssocList();
if ($item)
{
$l=array();
foreach($item as $elem)
{
$l[]=$elem['id'];
}
$item=$l;
}
//parent
if (count($item)<=$limit and $limit<>'')
{
$parent=$db->setQuery(" SELECT parent FROM #__zoo_category WHERE id=".$category_id)->loadAssoc();
$parent=$parent['parent'];
if ($parent)
{
$sql_cat=' and (ci.category_id='.$parent;
$m = modWfitemsHelper::getCat($parent);
foreach($m as $i)
{
$sql_cat.=' or ci.category_id='.$i;
}
$sql_cat.=')';
if ($type=="МИ") {$sql_type=" and instr(i.elements,'\"mi\"')<>0";}
if ($type=="БП") {$sql_type=" and instr(i.elements,'\"bp\"')<>0";}
if ($count<>'') {$sql_count=" limit ".$count;}
$item2 = $db->setQuery(" SELECT distinct i.id
FROM jos_zoo_item i, jos_zoo_category_item ci
WHERE i.id=ci.item_id and i.state=1 and type=\"product\"{$sql_type}{$sql_cat}
order by created desc
{$sql_count}")->loadAssocList();
if ($item2)
{
$l=array();
foreach($item2 as $elem)
{
$l[]=$elem['id'];
}
$item2=$l;
}
$item=array_merge($item,$item2);
}
}
//grandfather
/*if (count($item)<=$limit and $limit<>'')
{
$gfather=$db->setQuery(" SELECT parent FROM #__zoo_category WHERE id=".$parent)->loadAssoc();
$gfather=$gfather['parent'];
if ($gfather)
{
$sql_cat=' and (ci.category_id='.$gfather;
$m = modWfitemsHelper::getCat($gfather);
foreach($m as $i)
{
$sql_cat.=' or ci.category_id='.$i;
}
$sql_cat.=')';
if ($type=="МИ") {$sql_type=" and instr(i.elements,'\"mi\"')<>0";}
if ($type=="БП") {$sql_type=" and instr(i.elements,'\"bp\"')<>0";}
if ($count<>'') {$sql_count=" limit ".$count;}
$item3 = $db->setQuery(" SELECT distinct i.id
FROM jos_zoo_item i, jos_zoo_category_item ci
WHERE i.id=ci.item_id and i.state=1 and type=\"product\"{$sql_type}{$sql_cat}
order by created desc
{$sql_count}")->loadAssocList();
if ($item3)
{
$l=array();
foreach($item3 as $elem)
{
$l[]=$elem['id'];
}
$item3=$l;
}
$item=array_merge($item,$item3);
}
}*/
}
if ($item)
{
$item=array_unique($item);
if ($count<>'')
{
$item = array_slice($item, 0, $count);
}
$n[]="