0) { $row = mysql_fetch_array($result); $cn=$row['catname']; } if ($firmkod<>0) { $sql="select firmname from ".$s_pf."_firm where firmkod=$firmkod"; $result=mysql_query($sql, $_SESSION['link']); $numrows=mysql_num_rows($result); if ($numrows>0) { $row = mysql_fetch_array($result); $fn=$row['firmname']; } } if ($subkod<>0) { $sql="select subcatname from ".$s_pf."_subcat where subcatkod=$subkod"; $result=mysql_query($sql, $_SESSION['link']); $numrows=mysql_num_rows($result); if ($numrows>0) { $row = mysql_fetch_array($result); $sn=$row['subcatname']; } } if ($s_showprod==0) {$sql="select prodname from ".$s_pf."_prod a, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d, ".$s_pf."_present e where a.subcatkod=b.subcatkod and b.catkod=$ckod";} else {$sql="select prodname from ".$s_pf."_prod a, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d where a.subcatkod=b.subcatkod and b.catkod=$ckod";} if ($firmkod<>0) {$sql=$sql." and c.firmkod=$firmkod";} if ($subkod<>0) {$sql=$sql." and a.subcatkod=$subkod";} if ($s_showprod==0) {$sql=$sql." and a.plantkod=d.plantkod and c.firmkod=d.firmkod and e.prodkod=a.prodkod and e.present<>0 order by prodname";} else {$sql=$sql." and a.plantkod=d.plantkod and c.firmkod=d.firmkod order by prodname";} $result=mysql_query($sql, $_SESSION['link']); $s=''; while ($row = mysql_fetch_array($result)) { $s=$s.' '.$row['prodname']; } ?> 0) {$tl=$tl.' ('.$sn.')';} if ($firmkod<>0) {$tl=$tl.'. Производитель - '.$fn;} $s_proddescription=str_replace('$tl',$tl, $s_proddescription); $s_proddescription=str_replace('$s',$s, $s_proddescription); $s_prodheadertxt=str_replace('$tl',$tl, $s_prodheadertxt); $s_prodheadertxt=str_replace('$s',$s, $s_prodheadertxt); echo ''; echo ''; $s_prodtitle=str_replace('$tl',$tl, $s_prodtitle); $s_prodtitle=str_replace('$s',$s, $s_prodtitle); echo "$s_prodtitle"; ?>

Сайт продается, подробности в разделе Контакты

0 order by firmname";} else {$sql="select distinct firmname, c.firmkod from ".$s_pf."_prod a, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d where a.subcatkod=b.subcatkod and b.catkod=$ckod and a.plantkod=d.plantkod and c.firmkod=d.firmkod order by firmname";} $result=mysql_query($sql, $_SESSION['link']); $numrows=mysql_num_rows($result); if ($numrows>1) {echo '
Производители:'; if ($firmkod==0) {echo "  Все   ";} else {echo "  Все   ";} while ($row = mysql_fetch_array($result)) {if (($firmkod<>0) and ($firmkod==$row['firmkod'])) {echo "  ".$row['firmname']." ";} else {echo "  ".$row['firmname']."  ";} } echo "
"; } if ($s_showprod==0) {$sql="select distinct subcatname, a.subcatkod from ".$s_pf."_prod a, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d, ".$s_pf."_present e where a.subcatkod=b.subcatkod and b.catkod=$ckod and a.plantkod=d.plantkod and c.firmkod=d.firmkod and e.prodkod=a.prodkod and e.present<>0 order by subcatname";} else {$sql="select distinct subcatname, a.subcatkod from ".$s_pf."_prod a, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d where a.subcatkod=b.subcatkod and b.catkod=$ckod and a.plantkod=d.plantkod and c.firmkod=d.firmkod order by subcatname";} $result=mysql_query($sql, $_SESSION['link']); $numrows=mysql_num_rows($result); if ($numrows>1) {echo '
Подкатегории:'; if ($subkod==0) {echo "   Все  ";} else {echo "  Все   ";} while ($row = mysql_fetch_array($result)) {if (($subkod<>0) and ($subkod==$row['subcatkod'])) {echo "  

".$row['subcatname']."

  ";} else {echo "  ".$row['subcatname']."   ";} } echo "
"; } $sql="select kurs from ".$s_pf."_kurs"; $result=mysql_query($sql, $_SESSION['link']); $numrows=mysql_num_rows($result); if ($numrows==0) { $sql="INSERT INTO ".$s_pf."_kurs (kurs) VALUES (2200)"; mysql_query($sql, $_SESSION['link']); $kurs=2200; } else { $row = mysql_fetch_array($result); $kurs=$row['kurs']; } if ($s_showprod==0) {$sql="select a.prodkod, prodname, firmname, plantname, sprim, price from ".$s_pf."_prod a Left Join ".$s_pf."_price f ON a.prodkod=f.prodkod, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d, ".$s_pf."_present e where a.subcatkod=b.subcatkod and b.catkod=$ckod";} else {$sql="select a.prodkod, prodname, firmname, plantname, sprim, price from ".$s_pf."_prod a Left Join ".$s_pf."_price f ON a.prodkod=f.prodkod, ".$s_pf."_subcat b, ".$s_pf."_firm c, ".$s_pf."_plant d where a.subcatkod=b.subcatkod and b.catkod=$ckod";} if ($firmkod<>0) {$sql=$sql." and c.firmkod=$firmkod";} if ($subkod<>0) {$sql=$sql." and a.subcatkod=$subkod";} if ($s_showprod==0) {$sql=$sql." and a.plantkod=d.plantkod and c.firmkod=d.firmkod and e.prodkod=a.prodkod and e.present<>0 order by firmname, prodname, plantname";} else {$sql=$sql." and a.plantkod=d.plantkod and c.firmkod=d.firmkod order by firmname, prodname, plantname";} $result=mysql_query($sql, $_SESSION['link']); while ($row = mysql_fetch_array($result)) { require("ss.html"); } ?>