<style>
	.rating { overflow: hidden; display: inline-block; font-size: 0; position: relative; margin-top:10px;}
	.rating label{ margin-right:5px;}
	.rating-input { float: right; width: 16px; height: 16px; padding: 0; margin: 0 0 0 -16px; opacity: 0;}
	.rating:hover .rating-star:hover, .rating:hover .rating-star:hover ~ .rating-star, .rating-input:checked ~ .rating-star { background-position: 0 0;}
	.rating-star,.rating:hover .rating-star {position: relative; float: right; display: block; width: 16px; height: 16px; background: url('deppo/tools/img/star.png') 0 -16px;}
</style>
<?php
$result = mysqli_query($conn, "select * FROM genel where ne='yorum' and s1=".$id." and s4=1"); $total_comment = mysqli_num_rows($result);
$sqly=mysqli_query($conn, "select * from genel where ne='yorum' and s1=".$id." and s4=1");while($rsy=mysqli_fetch_assoc($sqly)){$cs3=$cs3+$rsy["s3"];}
?>
<div class="v3-row" style="">
	<h3 style="margin:0px; margin: 0px 10px;">
		<button id="byorum" style="float:right; margin: 0px 5px;<?php if(mysqli_num_rows($sqly)==0){echo "display:none;";}?>" class="v3-btn v3-btn-info" onclick="show('yform');hide('byorum');"><?php echo $sdil[90]?></button>
	</h3>
	<div id="err"></div>
	<form name="yorum" method="POST" action="/" id="yform" style="<?php if(mysqli_num_rows($sqly)<>0){echo "display:none;";}?>">
		<input type="hidden" name="id" value="<?php echo $id?>">
		<input type="hidden" name="t1" value="<?php if ($sayfa[0]=="d" or $sayfa[0]=="s" or $sayfa[0]=="h" or $sayfa[0]=="m"){echo $_SESSION["lang"];}elseif ($sayfa[0]=="u"){echo "t5";}else{echo "medya";}?>">
		<input type="hidden" name="t2" value="<?php if ($sayfa[0]=="d"){echo "kayit";}elseif ($sayfa[0]=="s"){echo "sayfa";}elseif ($sayfa[0]=="h"){echo "haber";}elseif ($sayfa[0]=="u"){echo "uye";}else{echo "video";}?>">
<?php if($_SESSION["User_ID"]==""){?>
		<div class="v3-col-md-12 v3-col-xs-12 mt5 mmt5">
			<div class="v3-input-group">
				<span class="v3-input-group-addon"><i class="fas fa-user"></i></span>
				<input type="text" class="v3-form-control" name="t4" value="<?php echo $_SESSION["User_Name"];?>" placeholder="<?php echo translate("Kullanıcı Adı")?>">
			</div>
		</div>
<?php }else{?>
			<input type="hidden" class="v3-form-control" name="t4" value="<?php echo $_SESSION["User_Name"];?>">
<?php }?>
			<input type="hidden" class="v3-form-control" name="t5" value="<?php echo $_SESSION["User_Email"];?>">
			<div class="v3-col-md-10 v3-col-xs-10 mt10" style="display:none;">
				<input type="text" class="v3-form-control" name="t3" placeholder="<?php echo $sdil[93]?>">
			</div>
		<div class="v3-col-md-12 v3-col-xs-12 mt5 mmt5">
			<textarea name="n1" class="v3-form-control" tabindex="1" placeholder="<?php echo $sdil[92]?>"></textarea>
		</div>
		<div class="v3-col-md-9 v3-col-xs-6 mt5 mmt5" style="">
			<span class="rating">
				<input type="radio" class="rating-input" id="rating-input-1-5" style="display:none;" name="s3" value="5"/>
				<label for="rating-input-1-5" class="rating-star"></label>
				<input type="radio" class="rating-input" id="rating-input-1-4" style="display:none;" name="s3" value="4"/>
				<label for="rating-input-1-4" class="rating-star"></label>
				<input type="radio" class="rating-input" id="rating-input-1-3" style="display:none;" name="s3" value="3"/>
				<label for="rating-input-1-3" class="rating-star"></label>
				<input type="radio" class="rating-input" id="rating-input-1-2" style="display:none;" name="s3" value="2"/>
				<label for="rating-input-1-2" class="rating-star"></label>
				<input type="radio" class="rating-input" id="rating-input-1-1" style="display:none;" name="s3" value="1"/>
				<label for="rating-input-1-1" class="rating-star"></label>
			</span>
		</div>
		<div class="v3-col-md-3 v3-col-xs-6 mt5 mmt5" style="">
			<button type="button" <?php if ($module["m18_uye_zorunlu"]=="1" and $_SESSION["User_ID"]=="") {echo "disabled";}?> class="v3-btn v3-form-control v3-btn-warning fsend" data-url="config/func.php?islem=yorum" data-form="#yform" data-msg="" style="float:right; margin-left:5px;"><i class="fas fa-paper-plane"></i> <?php if ($module["m18_uye_zorunlu"]=="1" and $_SESSION["User_ID"]==""){echo translate("Üye Girişi Yapmalısınız");}else{echo $sdil[101];}?></button>
		</div>
	</form>
</div>
<div class="alert-success suc" style="font-size: 12px; margin-top: 5px; border-radius: 5px; display:none"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i> <?php echo translate("#Yorumunuz için Teşekkürler")?></div>
<div id="comments"><img src="deppo/tools/img/table-loader.gif"></div>
<?php if($total_comment>0){?>
<div class="" style=""><?php echo translate("#Bu içerik toplam");?> <span class="v3-badge cw" style="margin-top: -3px;"><?php echo $total_comment?></span> <?php echo translate("#yorum ile ortalama");?> <span class="v3-badge cw" style="margin-top: -3px;"><?php echo wcount($cs3/$total_comment)?></span><?php echo translate("#oy aldı");?>.</div>
<?php }else{?>
<div class="" style=""><?php echo translate("#İlk Yorumu Sen Yap!..");?></div>
<?php }?>
<script>
	jQuery(".fsend").click(function() {
		jQuery(".fsend").html("Gönderiliyor");
		setTimeout(function(){
			loadFunction('<?php echo $cpath?>deppo/tools/script/comments.php?id=<?php echo $id?>','#comments');
			jQuery('#yform')[0].reset();
			jQuery(".fsend").html("Gönder");
			show('.suc');
		 }, 1000);
		setTimeout(function(){
			hide('.suc');
		 }, 3000);
	});
	jQuery(document ).ready(function() {
		setTimeout(function(){
			loadFunction('<?php echo $cpath?>deppo/tools/script/comments.php?id=<?php echo $id?>','#comments');
		}, 3000);
	});
</script>