<div class="inner-wrapper">
	<?php
	if(!empty($_GET["show"])){$slmt=$_GET["show"];}else{$slmt=$module["slmt"];}
	$sayfa = $_GET['sayfa'];
	if($_GET['sayfa'] == "") {$sayfa = 0; $ss = 1;}else{$sayfa = ($sayfa-1) * $slmt; $ss = $_GET['sayfa'];}
	$sql = mysqli_query($conn, "select * from genel where ne='yorum' order by id desc limit $sayfa,$slmt");
	$sqls = mysqli_query($conn, "select id from genel where ne='yorum'"); $rcount = mysqli_num_rows($sqls);
	?>
	<section role="main" class="content-body">
		<header class="page-header">
			<h2><?php echo $sdil[18]; //Yorumlar?></h2>
			
			<div class="right-wrapper text-right">
				<ol class="breadcrumbs">
					<li>
						<a href=".">
							<i class="fa fa-home"></i>
						</a>
					</li>
					<li><span>Crm +Plus</span></li>
					<li><span><?php echo $sdil[18]; //Yorumlar?></span></li>
				</ol>
				
				<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
			</div>
		</header>
		<?php if($_GET["durum"]=="ok"){?>
			<div class="alert alert-success">
				<?php echo $sdil[212]; //Islem Basariyla Gerçeklestirilmistir !?>
			</div>
		<?php }?>
		<div class="v3-row" id="process"></div>
		<div class="row">
			<div class="col">
				<section class="card">
					<header class="card-header v3-bg-info">
						<div class="card-actions">
							<?php include("modules/public/filter.php");?>
							<a class="mb-1 mt-1 mr-1 btn btn-warning mfrm " data-toggle="modal" data-target="#myModal" data-url="fonksiyon.php?islem=add_comment" target="islem" onClick="openwin();"><i class="fa fa-plus" aria-hidden="true"></i> </a>
						</div>
						
						<h2 class="card-title"><?php echo $sdil[18]; //Yorumlar?></h2>
					</header>
					<div class="card-body" style="">
						<table class="table" style="">
							<thead>
								<tr class="mdn">
									<th class="w6" style="text-align:center;">ID</th>
									<th>
										<span class="column-sort">
											<a href="#" title="Sort up" class="sort-up"></a>
											<a href="#" title="Sort down" class="sort-down"></a>
										</span>
										Yorum Yapan
									</th>
									<th class="w30">Yorum Yapılan</th>
									<th class="w15">
										<span class="column-sort">
											<a href="#" title="Sort up" class="sort-up"></a>
											<a href="#" title="Sort down" class="sort-down"></a>
										</span>
										Tarih &amp; Saat
									</th>
									<th class="w8">İşlemler</th>
								</tr>
							</thead>
							<tbody>
								<?php
								while ($rs=mysqli_fetch_assoc($sql) ) {
									if(($_GET["ts1"]=="" and $_GET["ts2"]=="" and ($rs["ts1"] >= date('Y-m-d', strtotime(date("Y-m-d"). ' -30 days')) or $rs["ts1"]=="")) or ($_GET["ts1"]<>"" and $_GET["ts2"]<>"") and ($rs["ts1"]>=$_GET["ts1"] and $rs["ts1"]<=$_GET["ts2"])){
									$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);
									?>
									<tr>
										<th class="mdn mfrm v3-text-info cp" data-toggle="modal" data-target="#myModal" data-url="modules/comments/comment.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&yid=<?php echo $rs["id"];?>&durum=cevap"><?php echo i2a($rs["id"],7);?></th>
										<td>
											<a class="" style="float:left;cursor:pointer;">
												<?php if(mysqli_num_rows($sql1)>0){echo $rs5["t1"];}elseif($rs["t4"]<>""){echo $rs["t4"];}else{?>Misafir<?php }?>'in Yorumu (<?php if($rs["s2"]<>0){?>Üye<?php }else{?>Ziyaretçi<?php }?>)<br /><span style="color:#999; font-size:9px;"><?php echo $rs["t3"];?></span>
											</a>
											<span class="fr mdn">
												<?php for ($x = 1; $x <= $rs["s3"]; $x++) {?>
													<div style="width:16px; height:16px; background-image:url('../../../deppo/tools/img/star.png'); float:left;"></div>
												<?php }?>
											</span>
										</td>
										<td class="mdn"><?php if(mysqli_num_rows($sql2)==0){?>Belirtilmemiş<?php }else{?><?php echo $konu["t1"];?><?php }?></td>
										<td><?php echo dtarih($rs["ts1"],"gg aa yyyy time");?></td>
										<td class="table-actions">
											<?php if($rs["s4"]==0){?><a class="btn btn-warning" href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $rs["id"];?>&durum=onay&onay=1"><i class="fa fa-square"></i></a><?php }else{?><a class="btn btn-warning mbtn" href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $rs["id"];?>&durum=onay&onay=0"><i class="fa fa-check-square"></i></a><?php }?>
											<?php if ($authority==0){?>
												<a style="cursor:pointer;" title="<?php echo $sdil[216]; //Yetkili Değilsiniz ??>" class="btn btn-danger btn-ban-row " href="#"><i class="fa fa-lock" aria-hidden="true"></i></a>
											<?php }else{ ?>
												<a style="cursor:pointer;" title="<?php echo $sdil[204]; //Kaldir?>" class="btn btn-danger btn-delete-row " data-href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $rs["id"];?>&durum=sil"><i class="fa fa-times" aria-hidden="true" style="padding: 0px;"></i></a>
											<?php } ?>
										</td>
									</tr>
								<?php }}?>
							</tbody>
						</table>
					</form>
				</div>
			</section>
		</div>
	</div>
	<!-- end: page -->
</section>
</div>
<aside id="sidebar-right" class="sidebar-right">
	<div class="nano">
		<div class="nano-content">
			<a href="#" class="mobile-close d-md-none">
				Collapse <i class="fa fa-chevron-right"></i>
			</a>
			<div class="sidebar-right-wrapper">
				...
			</div>
		</div>
	</div>
</aside>
</section>
<?php
if($_GET["durum"]=="sil"){
//----------------------------------------------------->sil
	$sql = mysqli_query($conn, "select * FROM genel where id=".$_GET["id"].""); $rs=mysqli_fetch_assoc($sql);
	unlink("../deppo/dosya/".$rs["t6"]."");
	$Rs = mysqli_query($conn, "delete from genel where ne='yorum' and  id=".$_GET["id"]);
	header('Location: ?ne='.$_GET["ne"].'&islem='.$_GET["islem"].'&durum=ok');
//----------------------------------------------------->onay
}elseif($_GET["durum"]=="onay"){
	parapuan("yorum");
	$Rs = mysqli_query($conn, "update genel set s4='".$_GET["onay"]."' Where id=".$_GET["id"]."");
	header('Location: ?ne='.$_GET["ne"].'&islem='.$_GET["islem"].'&durum=ok');
}
?>