<?php
session_start();
if(isset($_SESSION['yazar'])){ $kulID = $_SESSION['yazar']; 
include("config.php");
include("plugin/functions.php");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_bin'");
$query = mysql_query("select * from settings");
while($print = mysql_fetch_array($query)){ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex,nofollow,nosnippet,noodp,noarchive,noimageindex">	
	<meta name="author" content="radyo sitesi, radyo dinle" />	

	<title>İstekler | <?php echo $print['title']; ?></title>	
	<link rel="shortcut icon" href="/images/favicon.png">
	<link rel="stylesheet" media="screen" href="css/superfish.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/stylesheet.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/color.css" type="text/css" />		
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic" type="text/css" />

	<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
	<script src="js/hoverIntent.js" type="text/javascript"></script>	
	<script src="js/superfish.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="js/custom.js"></script>
	<script type="text/javascript" src="js/jquery.animate-shadow.js"></script>	
<script type="text/javascript" src="yonetim/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		entity_encoding : "utf-8",
        mode : "exact",
        elements : "elm1",		
		theme : "advanced",
		plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

		// Theme options
		theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Style formats
		style_formats : [
			{title : 'Bold text', inline : 'b'},
			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
			{title : 'Example 1', inline : 'span', classes : 'example1'},
			{title : 'Example 2', inline : 'span', classes : 'example2'},
			{title : 'Table styles'},
			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
		],

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>	
</head>
<body>

<div id="panel" style="display: none;" align="center">
<div align="center"><b><?php $ozu = mysql_query("select * from uyeler where id='$kulID'"); while($kamil = mysql_fetch_array($ozu)){ echo $kamil['adsoyad']; ?>, hoşgeldin.</b>&nbsp;&nbsp;-&nbsp;&nbsp; <a href="newspost.php">Yazı Gönder</a> &nbsp;&nbsp;-&nbsp;&nbsp; <?php if($print['seourl']==".php"){ ?> <a href="/djpanel.php">İstekler</a> <?php }elseif($print['seourl']==".html"){ ?> <a href="/djpanel.php">İstekler</a> <?php } ?> &nbsp;&nbsp;-&nbsp;&nbsp; <a href="sessionout.php">Çıkış</a></div><?php } ?></div>
<?php include("header.php"); ?> 
  

<?php
			$i = $_GET['i'];

			switch ($i){
			
			case 'onayla':
			
			$id = $_GET['id'];
			
			$onayla = mysql_query("UPDATE  `istekler` SET  `onay` =  '1' WHERE  `id` ='".$id."';");
			if($onayla){
			
			echo '<font color="green">Mesaj Onaylandı...</font>';
			
			}else{
			echo '<font color="red">HATA ! Mesaj Onaylanamadı..</font>';
			}
			
			
			break;
			
			case 'sil':
			$id = $_GET['id'];
			
			
			$sil = mysql_query("DELETE FROM `istekler` WHERE `id`='".$id."'");
			if($sil){
			
			echo '<font color="green">Mesaj Silindi...</font>';
			
			}else{
			echo '<font color="red">HATA ! Mesaj Silinemedi..</font>';
			}
			break;
			}
			?>
  <div id="outer-wrapper">
    <div id="content-wrapper">
      <div id="inner-content">
        <div id="entry">
          <div id="post-top">
            <h3 id="post-title">İstekler</h3>
			<p><a href="/djpanel.php">Bütün İstekler</a> - <a href="/onayla.php">İstek Onaylama Sayfası</a> - <a href="/onaylananlar.php">Onay Kaldırma Sayfası</a> 
          </div>
          <div class="entry-content">
	<table>

				<tr>

				    <th>Ad Soyad</th>

				    <th>E-Mail</th>

					<th>Tarih</th>

					<th>IP Adresi</th>

				    <th style="text-align:center;">İşlemler</th>

				</tr>

<?php 

mysql_query("SET NAMES 'utf8'");

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET COLLATION_CONNECTION = 'utf8_bin'");

$sorgu = mysql_query("select * from istekler order by id desc");

if(mysql_num_rows($sorgu)=="0"){

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

while($gelen = mysql_fetch_array($sorgu)){ $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 style="background: #F7F7F7;border: 1px solid #CCCCCC;">'; }else{ echo '<tr style="border: 1px solid #CCCCCC;" class="bg">'; } ?>	

				    <td style="    width: 300px;
    padding-left: 10px;
    background: #EFEFEF;"><?php echo $gelen['adsoyad']; ?></td>

				    <td style="width: 400px;
    padding-left: 20px;"><?php echo $gelen['email']; ?></td>

				    <td style="width:100px;"><?php echo $yorum_z; ?></td>

				    <td style="width:100px;"><?php echo $gelen['ip']; ?></td>					

				    <td style="width:100px;" align="center"><a href="istekoku.php?id=<?php echo $gelen['id']; ?>"><img src="yonetim/design/views-icon.png" alt="" title="Ayrıntılar" /></a></td>

				</tr>

			<?php } } ?>

			</table>
          </div>
        </div>
      </div>
	  
      <div id="sidebar">
	<?php include("plugin/sidebar.php"); ?>
      </div>
      <div class="clear"></div>
    </div>
  </div>
  
  <div id="footer"> <span id="Scroll"><a href="#">&uarr;</a></span>
    <div id="footer_inner">
<?php echo $print['reklam3']; ?>
      <div class="clear"></div>
      <div class="footer_bottom">
        <ul class="footer_menu">
          <li><a href="index<?php echo $print['seourl']; ?>">Anasayfa</a> /</li>		
<?php $whistle = mysql_query("select * from pages order by sira asc"); while($baby = mysql_fetch_array($whistle)){ if($print['seourl']==".php"){ ?>		
          <li><a href="pages.php?url=<?php echo $baby['sefurl']; ?>"><?php echo $baby['baslik']; ?></a> /</li>
	<?php }elseif($print['seourl']==".html"){ ?>	  
          <li><a href="sayfa-<?php echo $baby['sefurl']; ?>.html"><?php echo $baby['baslik']; ?></a> /</li>
	<?php } } ?>	
          <li><a href="iletisim<?php echo $print['seourl']; ?>">İletişim</a></li>
        </ul>
        <p>&copy; Copyright <?php echo date('Y'); ?>, <?php echo $print['title']; ?>. Tüm hakları saklıdır.</p>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<?php } }else{ echo '<meta http-equiv="refresh" content="0;URL=404.php">'; } ?>