@body[] $codes[^table::load[nameless;/data/main_list/${site}.cfg]] $hmath[^hash::create[]] $codes_count(^codes.count[]) $ccr(0) $codes_random[^table::create{code ^while($ccr<20){ $math_random(^math:random($codes_count)) ^if(!def $hmath.$math_random){ ^codes.offset[set]($math_random) $codes.0 $hmath.$math_random[$math_random] ^ccr.inc[] }[^#0A] } }] $get_goods[^table::sql{ SELECT SQL_CACHE goods.id, goods.cid, goods.slug, goods.title, goods.description, goods.price, goods.pprice, goods.price_auto, goods.avail, goods.rest, goods_pics.iid, goods_pics.ext FROM goods LEFT JOIN goods_pics ON goods.id = goods_pics.gid AND goods_pics.mp = '1' AND goods_pics.pub = '1' WHERE code IN (^if($codes_random){^codes_random.menu{'$codes_random.code'}[,]}{''}) AND is_show != '0' GROUP BY id ORDER BY cid ASC }] ^if($get_goods){ ^show_goods[$get_goods] }{
Товаров нет
} @show_goods[data] $rb(0) $count_goods[^data.count[]] $c[^if($rb){2}{4}] $cols[^if($count_goods>$c){$c}{$count_goods}] ^if(!$rb){ }{ }
^show_goods_body[$data] ^show_goods_body[$data]
Акции
Только до конца 2006 года доставка &mdash^; бесплатно!
Новости
Компания Максол ^;&mdash^; высококачественный ремонт, строительство, технический надзор.
@show_goods_body[data] $goods_hash[^hash::create[]] ^data.menu{ $parent_id($data.cid) $margin_price(0) ^while($parent_id && $cHash.$parent_id && !$margin_price){ $margin_price[$cHash.[$parent_id].margin_price] $margin_form[$cHash.[$parent_id].margin_form] $parent_id($cHash.[$parent_id].parent_id) } $margin_price[^if(!def $result){$margin_price}] $margin_form[^if(!def $result){$margin_form}] $goodsInProcess[^table::sql{ SELECT orders_products.gid as gid, orders_products.count as _count FROM orders LEFT JOIN orders_products ON orders.order_id=orders_products.order_id WHERE type IN (1,2) AND gid = '$data.id' }] $gIP(0) ^if($goodsInProcess){^goodsInProcess.menu{^gIP.inc($goodsInProcess._count)}} ^if(!$data.price_auto){ ^if($data.avail && $data.rest){ ^if($data.price){ $ag(1) $price(${data.price}) $rest($data.rest-$gIP) }{ $ag(0) } }{ $ag(0) } }{ $goodsRest[^table::sql{ SELECT SQL_CACHE rest FROM suppliers_prices WHERE gid = '$data.id' }] $supPrice[^table::sql{ SELECT SQL_CACHE MIN(sprice) as price FROM suppliers_prices WHERE gid = '$data.id' AND avail = '1' AND rest > '0' }] $gR(0) ^if($goodsRest){^goodsRest.menu{^gR.inc($goodsRest.rest)}} ^if($supPrice.price && $gR){ $ag(1) $margin[ ^if(!$margin_form){ ^math:round(^eval(${supPrice.price}/100*${margin_price})) }{ $margin_price } ] $price($supPrice.price+$margin) $rest($gR-$gIP) }{ $ag(0) } } $i(^data.line[]) $goods_hash.$i[ $.id[$data.id] $.img[${data.iid}.${data.ext}] $.title[$data.title] $.text[$data.description] $.price[^if($ag && $rest>0){$price}] ] $rest[] }
$rows(^math:ceiling(^eval(^data.count[]/$cols))) $width[^eval(100\$cols + (^data.offset[] % $cols < 100 % $cols))%] $count_goods(^data.count[]) $nimg(1) $ntext(1) $line(1) ^while($rows > 0){ ^rows.dec[] ^for[i](1;$cols){ ^nimg.inc(1) } ^for[i](1;$cols){ ^ntext.inc(1) } ^line.inc(1) }[]
^if(-f "$host/i/catalog/small/list/$goods_hash.[$nimg].img"){$img[^image::measure[$host/i/catalog/small/list/$goods_hash.[$nimg].img]] }
^taint[optimized-as-is][$goods_hash.[$ntext].title] ^if(def $goods_hash.[$ntext].text){
^taint[optimized-as-is][$goods_hash.[$ntext].text]
}
^if($goods_hash.[$ntext].price){^numberFormat[$goods_hash.[$ntext].price] ^;руб.}{^if($goods_hash.[$ntext].id){отсутствует}}
^if($goods_hash.[$ntext].id && !$goods_hash.[$ntext].price){
можно заказать
}

@body[] $codes[^table::load[nameless;/data/main_list/${site}.cfg]] $hmath[^hash::create[]] $codes_count(^codes.count[]) $ccr(0) $codes_random[^table::create{code ^while($ccr<20){ $math_random(^math:random($codes_count)) ^if(!def $hmath.$math_random){ ^codes.offset[set]($math_random) $codes.0 $hmath.$math_random[$math_random] ^ccr.inc[] }[^#0A] } }] $get_goods[^table::sql{ SELECT SQL_CACHE goods.id, goods.cid, goods.slug, goods.title, goods.description, goods.price, goods.pprice, goods.price_auto, goods.avail, goods.rest, goods_pics.iid, goods_pics.ext FROM goods LEFT JOIN goods_pics ON goods.id = goods_pics.gid AND goods_pics.mp = '1' AND goods_pics.pub = '1' WHERE code IN (^if($codes_random){^codes_random.menu{'$codes_random.code'}[,]}{''}) AND is_show != '0' GROUP BY id ORDER BY cid ASC }] ^if($get_goods){ ^show_goods[$get_goods] }{
Товаров нет
} @show_goods[data] $rb(0) $count_goods[^data.count[]] $c[^if($rb){2}{4}] $cols[^if($count_goods>$c){$c}{$count_goods}] ^if(!$rb){ }{ }
^show_goods_body[$data] ^show_goods_body[$data]
Акции
Только до конца 2006 года доставка &mdash^; бесплатно!
Новости
Компания Максол ^;&mdash^; высококачественный ремонт, строительство, технический надзор.
@show_goods_body[data] $goods_hash[^hash::create[]] ^data.menu{ $parent_id($data.cid) $margin_price(0) ^while($parent_id && $cHash.$parent_id && !$margin_price){ $margin_price[$cHash.[$parent_id].margin_price] $margin_form[$cHash.[$parent_id].margin_form] $parent_id($cHash.[$parent_id].parent_id) } $margin_price[^if(!def $result){$margin_price}] $margin_form[^if(!def $result){$margin_form}] $goodsInProcess[^table::sql{ SELECT orders_products.gid as gid, orders_products.count as _count FROM orders LEFT JOIN orders_products ON orders.order_id=orders_products.order_id WHERE type IN (1,2) AND gid = '$data.id' }] $gIP(0) ^if($goodsInProcess){^goodsInProcess.menu{^gIP.inc($goodsInProcess._count)}} ^if(!$data.price_auto){ ^if($data.avail && $data.rest){ ^if($data.price){ $ag(1) $price(${data.price}) $rest($data.rest-$gIP) }{ $ag(0) } }{ $ag(0) } }{ $goodsRest[^table::sql{ SELECT SQL_CACHE rest FROM suppliers_prices WHERE gid = '$data.id' }] $supPrice[^table::sql{ SELECT SQL_CACHE MIN(sprice) as price FROM suppliers_prices WHERE gid = '$data.id' AND avail = '1' AND rest > '0' }] $gR(0) ^if($goodsRest){^goodsRest.menu{^gR.inc($goodsRest.rest)}} ^if($supPrice.price && $gR){ $ag(1) $margin[ ^if(!$margin_form){ ^math:round(^eval(${supPrice.price}/100*${margin_price})) }{ $margin_price } ] $price($supPrice.price+$margin) $rest($gR-$gIP) }{ $ag(0) } } $i(^data.line[]) $goods_hash.$i[ $.id[$data.id] $.img[${data.iid}.${data.ext}] $.title[$data.title] $.text[$data.description] $.price[^if($ag && $rest>0){$price}] ] $rest[] }
$rows(^math:ceiling(^eval(^data.count[]/$cols))) $width[^eval(100\$cols + (^data.offset[] % $cols < 100 % $cols))%] $count_goods(^data.count[]) $nimg(1) $ntext(1) $line(1) ^while($rows > 0){ ^rows.dec[] ^for[i](1;$cols){ ^nimg.inc(1) } ^for[i](1;$cols){ ^ntext.inc(1) } ^line.inc(1) }[]
^if(-f "$host/i/catalog/small/list/$goods_hash.[$nimg].img"){$img[^image::measure[$host/i/catalog/small/list/$goods_hash.[$nimg].img]] }
^taint[optimized-as-is][$goods_hash.[$ntext].title] ^if(def $goods_hash.[$ntext].text){
^taint[optimized-as-is][$goods_hash.[$ntext].text]
}
^if($goods_hash.[$ntext].price){^numberFormat[$goods_hash.[$ntext].price] ^;руб.}{^if($goods_hash.[$ntext].id){отсутствует}}
^if($goods_hash.[$ntext].id && !$goods_hash.[$ntext].price){
можно заказать
}