<?php
$path="../../";
include("../../map.php");
include("../../scripts.php");
?>
<?php if($_GET["durum"]=="ok"){ ?>
	<div class="alert alert-success" role="alert">
		<?php echo $sdil[212]; //islem Basariyla Gerçeklestirilmistir !?>
	</div>
<?php }?>
<?php
$sql = mysqli_query($conn, "select * FROM genel where ne='yorum' and id=".$_GET["yid"].""); $rs=mysqli_fetch_assoc($sql);
$sql1 = mysqli_query($conn, "select * FROM t5 where id=".$rs["s2"].""); $rs5=mysqli_fetch_assoc($sql1);
$sql2 = mysqli_query($conn, "select * FROM ".$rs["t1"]." where  id=".$rs["s1"].""); $konu=mysqli_fetch_assoc($sql2);
$notify = array ('desktop' => '1','ndesktop' => '1','browser' => '1','nbrowser' => '1');
$rjsn = json_encode($notify, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
$Up = mysqli_query($conn, "update genel set n12='".addslashes(stripslashes($rjsn))."' where id=".$_GET["yid"]."");
if($_GET["durum"]=="oku"){
	?>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title"></b><?php if(mysqli_num_rows($sql1)>0){echo $rs5["t1"];}elseif($rs["t4"]<>""){echo $rs["t4"];}else{?>Misafir<?php }?></b>'in Yorumu (<?php if($rs["s2"]<>0){?>Üye<?php }else{?>Ziyaretçi<?php }?>)<br /><span style="color:#999; font-size:11px;"><?php echo $rs["t3"];?></span></h3>
		</div>
		<div class="panel-body">
			<?php echo $rs["n1"];?><hr />
			<?php echo $rs["n2"];?>
		</div>
		<div class="panel-footer"><?php if(mysqli_num_rows($sql2)<0){?>Belirtilmemiş<?php }else{?><?php echo $konu["t1"];?><?php }?></div>
	</div>
<?php }elseif($_GET["durum"]=="cevap"){ ?>
	<form action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&yid=<?php echo $rs["id"];?>&durum=kaydet" method="post" class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title"><b><?php if(mysqli_num_rows($sql1)>0){echo $rs5["t1"];}elseif($rs["t4"]<>""){echo $rs["t4"];}else{?>Misafir<?php }?></b>'in Yorumu (<?php if($rs["s2"]<>0){?>Üye<?php }else{?>Ziyaretçi<?php }?>)<br /><span style="color:#999; font-size:11px;"><?php echo $rs["t3"];?></span></h3>
		</div>
		<div class="panel-body">
			<textarea class="form-control" name="n2" placeholder="<?php echo $rs["n1"];?>" style="height:150px;"><?php echo $rs["n2"];?></textarea>
			<button class="btn btn-default" style="margin-top:3px; float:right;">Cevapla</button>
		</div>
		<div class="panel-footer"><?php if(mysqli_num_rows($sql2)<0){?>Belirtilmemiş<?php }else{?><?php echo $konu["t1"];?><?php }?></div>
	</form>
	<?php
}elseif($_GET["durum"]=="kaydet"){
	$Rs = mysqli_query($conn, "update genel set n2='".$_POST["n2"]."', ts2=now() where id=".$_GET["yid"]."");
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&yid=".$rs["id"]."&durum=ok",self,500,1);
}?>