<?php
$sql2 = "SELECT termek_id, sum(mennyiseg) as hanydarab FROM kosar WHERE rendeles_id>0 GROUP BY termek_id ORDER BY hanydarab DESC LIMIT 0, 3";
$ered = mysql_query($sql2);

while($gyak_sor = mysql_fetch_array($ered)) 
{
  $cid = $gyak_sor["termek_id"];  
  
  $sql3 = "SELECT * FROM termekek WHERE id=$cid";
  $rs = mysql_query($sql3);
  $egysor = mysql_fetch_array($rs);
	$cnev = $egysor["nev"];
	$ckateg = $egysor["kateg"];
	$cmin_egyseg = $egysor["min_egyseg"];
	$cegyseg = $egysor["egyseg"];
	$car = $egysor["ar"];
	$ckis_kep = $egysor["kis_kep"];
	$cnagy_kep = $egysor["nagy_kep"];
  ?>
  <div class="center_blokk">
	<a href="<?php echo $cnagy_kep ?>" rel="lightbox[plants]" title="<?php echo $cnev?>"><img src="<?php echo $ckis_kep ?>" alt="<?php echo $cnev?>" /></a><br />
	<form name="akcio" action="kosarba.php" method="POST">
		<input type="hidden" name="termek_id" id="termek_id" value="<?php echo $cid ?>" />
		<input type="hidden" name="ar" id="ar" value="<?php echo $car ?>" />
    	<span class="pia_nev"><a href="index.php?page=leiras&id=<?php echo $cid ?>"><?php echo $cnev ?></a></span><br />
		<span class="pia_ar"><?php echo $car ?> Ft</span><br />
		<input class="mennyiseg" name="db" id="db" value="<?php echo $cmin_egyseg ?>" /><span class="menny_szoveg">&nbsp;<?php echo $cegyseg ?></span><br />
		<input type="image" name="kosarba" id="kosarba" class="kosarba_gomb" src="images/button/kosarba.png" />
	</form>
  <!-- END: #center_blokk --></div>
<?php
}
?>

<div class="bejelentkezes">
<?php 
if ($belepve == 1)
{
?>
  <form name="kilepes" id="kilepes" action="kilepes.php" method="POST">
	<?php
	print "<span class=\"udv\">Üdv " . $webshop_nev . "!</span>";
	?>
	<br /><br />
	<input type="image" name="kejelentkezes" id="kijelenkezes" class="kilepes_gomb" src="images/button/kijelentkezes.png" />
    <br /><br />
  </form>
<?php
}
else
{
?>
  <form name="bejelentkezes" action="belepes.php" method="POST" class="regform">
	  <input type="hidden" name="mit" value="ellenoriz">
	  <?php
	  if (belepes == 1)
	  {
	  ?>
		<p><strong>Belépés folyamatban</strong></p>
	  <?php
	  }
	  else
	  {
	  ?>
        <div class="inpdiv1" style="width:157px;"><div class="inpdiv2"><div class="inpdiv3">
          <div style="height:4px;"><!--  --></div>
          <input name="email" id="email" maxlength="64" value="E-mail" onFocus="if(this.value=='E-mail') {this.value=''}" />
        </div></div></div>
        <br />
        <div class="inpdiv1" style="width:157px;"><div class="inpdiv2"><div class="inpdiv3">
          <div style="height:4px;"><!--  --></div>
          <input type="password" name="jelszo" id="jelszo" maxlength="24" value="jelszo" onFocus="if(this.value=='jelszo') {this.value=''}" />
        </div></div></div>
		<br />
		<input type="image" name="bejelentkezes" id="bejelentkezes" class="belepes_gomb" src="images/button/bejelentkezes.png"/>
		<a href="index.php?page=regisztracio">Regisztráció</a><br />
	  <?php
	  }
	  ?>
  </form>
<?php
}
?>
<!-- END: .bejelentkezes --></div>