<?php 
session_start();
if(isset($_SESSION['newsphp']))
{
$kuladi = $_SESSION['newsphp']; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex,nofollow,nosnippet,noodp,noarchive,noimageindex">
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/reset.css" /> 
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" /> 
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/2col.css" title="2col" /> 
	<link rel="alternate stylesheet" media="screen,projection" type="text/css" href="css/1col.css" title="1col" /> 
	<!--[if lte IE 6]><link rel="stylesheet" media="screen,projection" type="text/css" href="css/main-ie6.css" /><![endif]--> 
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/style.css" />
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/mystyle.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/switcher.js"></script>
	<title>Radyo Sitesi Yönetim Paneli</title>	
</head>

<body>

<div id="main">

	<div id="tray" class="box">

		<p class="f-left box">

			<span class="f-left" id="switcher">
				<a href="#" rel="1col" class="styleswitch ico-col1" title="Display one column"><img src="design/switcher-1col.gif" alt="1 Column" /></a>
				<a href="#" rel="2col" class="styleswitch ico-col2" title="Display two columns"><img src="design/switcher-2col.gif" alt="2 Columns" /></a>
			</span>

			<strong>Radyo Sitesi Yönetim Paneli</strong>

		</p>

		<p class="f-right"><strong><a href="admin.php"><?php echo $kuladi; ?></a></strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong><a href="logout.php" id="logout">Çıkış</a></strong></p>

	</div>

	<hr class="noscreen" />

	<div id="menu" class="box">

		<ul class="box f-right">
			<li><a href="../index.php" target="_blank"><span><strong>Siteyi Görüntüle &raquo;</strong></span></a></li>
		</ul>

		<ul class="box">
			<li><a href="home.php"><span>Anasayfa</span></a></li>				
			<li><a href="sayfalar.php"><span>Sayfalar</span></a></li>
			
			<li><a href="yazilar.php"><span>Haberler</span></a></li>		
			<li><a href="fotogaleri.php"><span>Galeriler</span></a></li>	
			<li><a href="videolar.php"><span>Klipler</span></a></li>						
			<li><a href="yazarlar.php"><span>Yayıncılar</span></a></li>		
			<li><a href="yorumlar.php"><span>Yorumlar</span></a></li>						
			<li><a href="contact.php"><span>İletişim</span></a></li>
			<li><a href="admin.php"><span>Yönetici Bilgileri</span></a></li>
			<li><a href="ayarlar.php"><span>Ayarlar</span></a></li>
		</ul>

	</div>

	<hr class="noscreen" />

	<div id="cols" class="box">

		<div id="aside" class="box">

			<div class="padding box">

				<p id="logo"><a href="home.php"><img src="design/logo.png" title="Radyo Sitesi Yönetim Paneli" alt="" /></a></p><br><br>

			</div>
			
			<div class="padding box">
			
	<p id="btn-create" class="box"><a href="sayfaekle.php"><span>Sayfa Ekle</span></a></p>	
	<p id="btn-create" class="box"><a href="galeriekle.php"><span>Galeri Oluştur</span></a></p>	
	<p id="btn-create" class="box"><a href="resimekle.php"><span>Resim Ekle</span></a></p>	
	<p id="btn-create" class="box"><a href="videoekle.php"><span>Video Ekle</span></a></p>	
	<p id="btn-create" class="box"><a href="yazarekle.php"><span>Yayıncı Ekle</span></a></p>	
	
			</div>
			
			<div class="padding box" class="info msg">
			<br><br>
			
			
			</div>

		</div>

		<hr class="noscreen" />

		<div id="content" class="box">

			<h1>Radyo Sitesi Yönetim Paneli</h1>
			<br><br><br><br>

			<h3>Onay Bekleyen Yazılar</h3>
						
			<table>
				<tr>
				    <th>Başlık</th>
				    <th style="text-align:center;">Kategori</th>
					<th style="text-align:center;">Tarih</th>
				    <th style="text-align:center;">İşlemler</th>
				</tr>
<?php include("../config.php"); 

$limit = 20;

$page = @$_GET["page"];

if(empty($page) or !is_numeric($page)) {

$page = 1;

}
	$count			 = mysql_num_rows(mysql_query("SELECT id FROM news where onay='0' order by id desc"));
	$toplamsayfa	 = ceil($count / $limit);
	$baslangic		 = ($page-1)*$limit;

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_bin'");	
$sorustur = "SELECT * FROM news where onay='0' ORDER BY id desc LIMIT $baslangic,$limit";

$yazdir_sorgu = mysql_query($sorustur) or die(mysql_error());
if(mysql_num_rows($yazdir_sorgu)=="0"){

echo '<tr><td>Kayıt bulunamadı.</td><td></td><td></td><td></td></tr>';

}else{
while ($gelen = mysql_fetch_array($yazdir_sorgu)){ $kat = $gelen['kategori']; $id = $gelen['id'];

			$yorum_za=strtotime($gelen['tarih']);
			$ay=array('','Ocak','Şubat','Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'); 
			$yorum_z=date('d',$yorum_za)." ".$ay[date("n",$yorum_za)]." ".date('Y', $yorum_za); ?>					
			<?php if ($id%2!=0){ echo '<tr>'; }else{ echo '<tr class="bg">'; } ?>	
				    <td style="width:1000px;"><?php echo $gelen['baslik']; ?></td>			
				    <td align="center" style="width:150px;"><?php $query = mysql_query("select * from newskat where sefurl='$kat'"); while($print = mysql_fetch_array($query)){ echo $print['baslik']; } ?></td>
				    <td align="center" style="width:120px;"><?php echo $yorum_z; ?></td>					
				    <td style="width:100px;" align="center"><a href="yaziedit.php?id=<?php echo $gelen['id']; ?>"><img src="design/edit.png" alt="" title="Düzenle" /></a> &nbsp;&nbsp; <a href="plugin/yazidel.php?id=<?php echo $gelen['id']; ?>"><img src="design/cross.png" alt="" title="Sil" /></a></td>
				</tr>
	  <?php
	  } }
	echo '</table><br>';
 if($count > $limit) : 
  $x = 2; 
  $lastP = ceil($count/$limit); 

  if($page > 1){

  $onceki = $page-1;
  echo "<a href=\"?page=$onceki\">Geri</a>&nbsp;"; 
  }
 
  if($page==1) echo "1&nbsp;"; 
  else echo "<a href=\"?page=1\">1</a>&nbsp;";   

  
  if($page-$x > 2) { 
    echo "...&nbsp;"; 
    $i = $page-$x; 
  } else { 
    $i = 2; 
  } 

  for($i; $i<=$page+$x; $i++) { 
    if($i==$page) echo "$i&nbsp;"; 
    else echo "<a href=\"?page=$i\">$i&nbsp;</a>&nbsp;"; 
    if($i==$lastP) break; 
  } 

  if($page+$x < $lastP-1) { 
    echo "...&nbsp;"; 
    echo "<a href=\"?page=$lastP\">$lastP</a>"; 
  } elseif($page+$x == $lastP-1) { 
    echo "<a href=\"?page=$lastP\">$lastP</a>"; 
  } 
  
  if($page < $lastP){
  $sonraki = $page+1;
  echo "<a href=\"?page=$sonraki\">İleri</a>"; 
  }
endif;  ?>			
			
		</div>

	</div>

	<hr class="noscreen" />

	<div id="footer" class="box">

		<p class="f-left">&copy; 2016 Radyo Sitesi</p>


	</div> 

</div>

</body>
</html>
<?php } else { echo '<script language="javascript">location.href="../404.php";</script>'; } ?>