<?php
$path="../../../";
include("".$path."deppo/tools/script/cevir.php");
$path2="config/";  include("".$path."config/map.php");
include("".$path."deppo/tools/script/fonksiyon".$ver.".php");
if($_POST["q"]<>""){$key=$_POST["q"];}else{$key=$_GET["q"];}
//sayfalama
$klimit=10;	//Kayıt Limit
if($_GET["s"]<>""){$sayfa3=$_GET["s"];}
if($sayfa3 == "" or $sayfa3 == "1"){
	$gpage = 1; $flimit=0; $llimit= $klimit;
}else{
	$gpage = $sayfa3; $flimit=(($sayfa3 * $klimit) - $klimit); $llimit= $klimit;
}
$sqlic = mysqli_query($conn, "select * FROM ".$_SESSION["lang"]." where ne<>'kayit' and (t1 LIKE '%".$key."%' or n2 LIKE '%".$key."%' or n4 LIKE '%".$key."%' or n1 LIKE '%".$key."%' or n17 LIKE '%".$key."%') and s13=1"); $icount=mysqli_num_rows($sqlic); $tpc=$icount/$klimit;
//sayfalama
?>
<div class="qsearch" style="padding:15px 0px">
	<?php
	$sql=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne<>'kayit' and (t1 LIKE '%".$key."%' or n2 LIKE '%".$key."%' or n4 LIKE '%".$key."%' or n1 LIKE '%".$key."%' or n17 LIKE '%".$key."%') and s13=1 order by s1 asc limit $flimit,$llimit"); while($rs=mysqli_fetch_assoc($sql)){
	if($rs["ne"]=="sayfa"){$nedir="s";}elseif($rs["ne"]=="haber"){$nedir="h";}elseif($rs["ne"]=="kayit"){$nedir="d";}
	?>
		<div class="media cp" onclick="location.href='<?php echo linked($nedir,$rs["id"]);?>'">
			<div class="media-body">
				<h5 class="media-heading"><?php echo rlang(kisalt($rs["t1"],5))?></h5>
				<?php echo kisalt(rlang($rs["n2"]),10)?>
			</div>
		</div>
	<?php }?>
</div>
<div class="row <?php if($tpc<1){echo "dn";}?>">
	<ul class="v3-pagination clearfix page_margin_top_section">
		<li class="v3-left">
			<a class="cp" onclick="<?php if($gpage>1){?>jQuery('#qsearchresult').load('deppo/tools/script/qsearch.php?q=<?php echo $_GET["q"];?>&s=<?php echo $gpage-1;?>');<?php }?>" title=""><i class="fa fa-chevron-left" aria-hidden="true"></i></a>
		</li>
		<?php $p=0; for ($i = 0; $i <= $tpc; $i++) {$p++; ?>
		<li class="<?php if($p==$gpage){echo "v3-active cw";}?> <?php if($p > $gpage+5 or $p < $gpage-5){ echo "dn";}?>">
			<a class="cp" onclick="jQuery('#qsearchresult').load('deppo/tools/script/qsearch.php?q=<?php echo $_GET["q"];?>&s=<?php echo $p;?>');" title="<?php echo $p;?>">
				<?php if($p > $gpage+4 or $p < $gpage-4){ echo "...";}else{echo $p;}?>
			</a>
		</li>
		<?php }?>
		<li class="v3-right">
			<a class="cp" onclick="<?php if($gpage=="1" or $gpage<$tpc){?>jQuery('#qsearchresult').load('deppo/tools/script/qsearch.php?q=<?php echo $_GET["q"];?>&s=<?php echo $gpage+1;?>');"<?php }?> title=""><i class="fa fa-chevron-right" aria-hidden="true"></i></a>
		</li>
	</ul>
</div>