<form name="lapozas" action="index.php?page=kategoria" method="POST" >
	<input type="hidden" name="kateg" value="<?php echo $kateg?>"                               
    <p><strong>Termékek oldalanként:</strong>
    <select name="laponkent" size="1" onChange="document.lapozas.submit()">
      <option value="5" <?php if ($laponkent == 5) {print "selected";} ?>>5</option>
      <option value="20" <?php if ($laponkent == 20) {print "selected";} ?>>20</option>
      <option value="50" <?php if ($laponkent == 50) {print "selected";} ?>>50</option>
      <option value="999999" <?php if ($laponkent == 999999) {print "selected";} ?>>összes</option>
    </select>
    </p>
    <p>Összesen <?php echo $osszes?> találat</p>          
    <p><strong>Oldalak:</strong>
    <?php
    for ($i = 1; $i <= $oldalak; $i++) 
    {
      if ($i == $oldal) 
      {
        ?>
        [<strong><?php echo $i?></strong>]&nbsp;
        <?php
      }
      else 
      {
        ?>
        <a href="index.php?page=kategoria&kateg=<?php echo $kateg?>&oldal=<?php echo $i?>&laponkent=<?php echo $laponkent?>"><?php echo $i?></a>&nbsp;
        <?php
      }
    }
    ?>
  </p>
</form>

<?php		
$sql = "SELECT * FROM termekek WHERE raktaron=1 AND kateg=$kateg ORDER BY nev LIMIT $mettol, $laponkent";
$eredmeny = mysql_query($sql);

if(mysql_num_rows($eredmeny) > 0)
{         
  while($sor = mysql_fetch_array($eredmeny)) 
  {
    $id = $sor["id"];
    $nev = $sor["nev"];
    $kateg = $sor["kateg"];
    $kis_kep = $sor["kis_kep"];
    $nagy_kep = $sor["nagy_kep"];
    $rovid_leiras = $sor["rovid_leiras"];
    $ar = $sor["ar"];
    $min_egyseg = $sor["min_egyseg"];
    $egyseg = $sor["egyseg"];
?>
    <div class="pia_box">
        <a href="<?php echo $nagy_kep ?>" rel="lightbox[plants]" title="<?php echo $nev?>"><img src="<?php echo $kis_kep ?>" alt="<?php echo $nev ?>" /></a><br />
        <span class="pia_r_nev"><a href="index.php?page=leiras&id=<?php echo $id ?>"><?php echo $nev ?></a></span><br /><br />
        <span class="pia_r_leiras"><?php echo $rovid_leiras ?></span>
        <span class="pia_r_ar"><?php echo $ar ?> Ft</span>
        <form name="rendeles" action="kosarba.php" method="POST">
            <input type="hidden" name="termek_id" id="termek_id" value="<?php echo $id ?>" />
            <input type="hidden" name="kateg" id="kateg" value="<?php echo $kateg ?>" />
            <input class="mennyiseg" name="db" id="db" value="<?php echo $min_egyseg ?>" /><span class="menny_szoveg">&nbsp;<?php echo $egyseg ?></span><br />
            <input type="image" name="kosarba" id="kosarba" src="images/button/kosarba.png" />
        </form>        
    <!-- END: .pia_box --></div>
<?php
  }
}
else 
{
  print "<strong>Nincs ilyen termékünk!</strong>";
}
?>