<?php  header ("Content-Type: text/html; charset=iso-8859-9"); 
include("ayar.php");
$kon=$_GET["kontrol"];
if($kon=="ilanonay" || $kon==""){


if($_GET['onay']){
		mysql_query("update ilan set secim=1 where id='".$_GET['onay']."'")or die(mysql_error());
		echo "İlan yayında";
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"> 
<link href="css/emre.css" rel="stylesheet" type="text/css">
<form method="post" enctype="multipart/form-data" name="example"     action="<?php echo $_SERVER['REQUEST_URI'] ?>" ><table width="628" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td width="628">


<table width="632"  cellpadding="3" cellspacing="0" class="liste" id="tabloq"  style="BORDER-RIGHT: #d1d9e1 1px solid; BORDER-TOP: medium none; BORDER-LEFT: #d1d9e1 1px solid; BORDER-BOTTOM: #d1d9e1 1px solid" align="center" bordercolor="#000066">
  <tr>
    <td colspan="6" class="tablobaslik">Onay Bekleyenler</td>
    </tr> 
  <tr>
    <td width="104" class="detay"><strong>İlan Adı</strong></td>
    <td width="115"><strong>Fiyat</strong></td>
    <td width="108"><strong>Kategori</strong></td>
    <td width="88"><strong>İlan Sahibi</strong></td>
    <td width="82"><strong>Detay</strong></td>
    <td width="68"><strong>Se&ccedil;im</strong></td>
  </tr>
    <?
      $s=mysql_query("select * from ilan where secim=0 order by id");
        while($oku=mysql_fetch_array($s)){
			$uye = mysql_fetch_assoc(mysql_query("SELECT * FROM uyeler where id='".$oku["uye_id"]."'"));
			$kat = mysql_fetch_assoc(mysql_query("SELECT * FROM kategoriler where id='".$oku["kategori_id"]."'"));
	?>
  <tr>
    <td class="detay"><?php echo $oku['ilan_adi']; ?></td>
    <td><?php echo $oku['fiyat']; ?> TL</td>
    <td><?php echo $kat['kategoriler']; ?></td>
    <td><?php echo $uye['adi_soyadi']; ?></td>
    <td><a href="../sayfa.php?sayfa=ilan&id=<?=$oku['id']?>" target="_blank">İlanı Gör</a> </td>
    <td>
    <?php
	if($oku['secim']=="0"){
	?>
    <a href="?kontrol=ilanonay&onay=<?=$oku['id']?>">Onay</a>
    <?php	
	}
	?>
 </td>
  </tr>
  <?
}
?>
</table>
<br>
<script language="JavaScript" type="text/JavaScript">
var windowNesnesi
var as;
function pencere(as){

windowNesnesi = window.open("yeni.php?id="+as, "YeniPencere", "toolbar=0, width=600, height=400,left=160,top=20, resizable=1")
}
    </script>

   &nbsp;</td>
  </tr>
</table></form>
  <?
	}
?>