<?php define('access',"False");
require_once ("include/connect.php"); require_once ("include/tarihfonksiyonu.php"); require_once ("include/zamanfonksiyonu.php");
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8">
<base href="<?php echo $SiteBilgi["siteurl"]; ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<title>Escort Yazıları | <?php echo $SiteBilgi["logoyazi"]; ?> <?php echo htmlspecialchars($_SERVER["HTTP_HOST"], ENT_QUOTES, 'utf-8'); ?></title>
<meta name="keywords" content="<?php echo $SiteBilgi["anahtar"]; ?>" />
<meta name="description" content="<?php echo $SiteBilgi["meta"]; ?>">
<link rel="amphtml" href="<?php echo $SiteBilgi["ampurl"].'makaleler'; ?>" />
<link rel="canonical" href="<?php echo $SiteBilgi["ampurl"].'makaleler'; ?>" />
<?php echo $SiteBilgi["head"]; ?>
<link rel="icon" href="img/favicon.png">
<link rel="stylesheet" href="css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/site.php">
<script src="js/jquery-1.10.2.js"></script>
<script src="js/anasayfa.js"></script>
</head>
<body id="top">
<?php include('include/ustmenu.php'); ?>
<div class="Header_Alani">
<h1>ESCORT YAZILARI</h1>
</div>
<div class="container">
<div class="col-md-8">
<ol class="breadcrumb">
<li><a href="./">Ana Sayfa</a></li>
<li class="active"><a href="makaleler">Escort Blog</a></li>
</ol>	
<?php 
$verisayisi = count($conn->query("select * from blog where durum='Aktif'",PDO::FETCH_ASSOC)->fetchAll());
$gosterilecek = 10;
$sayfa;
$sayfasayisi = ceil($verisayisi/$gosterilecek);
if(isset($_GET['sayfa'])){
$sayfa = htmlentities($_GET["sayfa"],  ENT_QUOTES,  "utf-8");
}else{
$sayfa = 1;
}
if($sayfa > $sayfasayisi){
$sayfa  = 1;
}elseif(!is_numeric($sayfa) || $sayfa < 1){
$sayfa = 1;
}
$baslangic = ($gosterilecek * $sayfa)-$gosterilecek;
?>
<?php 
$sorustur = $conn->prepare("SELECT * FROM blog where durum=? order by id desc LIMIT $baslangic,$gosterilecek");
$sorustur->execute(array('Aktif'));
while($Makale = $sorustur->fetch()){ 
$kategoriSorgula = $conn->prepare("select * from kategori where id = ?");
$kategoriSorgula->execute(array($Makale['kategori']));
$kateqoriCek = $kategoriSorgula->fetch();	
?>	
<div class="panel panel-default panel-stili">
<div class="panel-body">
<div class="media">
<a class="pull-left" href="escort/<?php echo $Makale['seo']; ?>">
<div class="cerceve"><img src="<?php if($Makale['resim'] != ''){ echo 'BlogResim/'.$Makale['resim']; }else{ echo 'img/resimsiz.jpg'; } ?>" alt="<?php echo $Makale['baslik']; ?>" class="resim"></div>
</a>
<div class="panel-body">
<h4 class="media-heading"><a href="escort/<?php echo $Makale['seo']; ?>"><?php echo $Makale['baslik']; ?></a></h4>
<p class="detay"><?php $metin = mb_substr($Makale['aciklama'],0,900).'... '; echo strip_tags($metin); ?> <a href="escort/<?php echo $Makale['seo']; ?>"> okumaya devam et</a></p><hr/>
<ul class="list-inline list-unstyled">
<small><i class="glyphicon glyphicon-calendar"></i> <?php echo turkcetarih('j F Y',$Makale['yil'].'-'.$Makale['tarih']); ?></small>
<li>|</li>
<small><i class="glyphicon glyphicon-th-list"></i> <a href="kategori/<?php echo $kateqoriCek['seo']; ?>"><?php echo $kateqoriCek['baslik']; ?></a></small>
<li>|</li>
<small><i class="glyphicon glyphicon-stats"></i> <?php echo $Makale['hit']; ?></small>
</ul>
</div>
</div>
</div>
</div>
<?php } ?>

<div class="list-group text-center">		
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm">
<?php 
if($sayfa > 1){
echo '<li><a href="makaleler?sayfa=1">İlk</a></li>';
echo '<li><a title="önceki" href="makaleler?sayfa='.($sayfa-1).'">&laquo;</a></li>';
}
$ekgoster = 2;
for($i = $sayfa - $ekgoster; $i <= $sayfa + $ekgoster;$i++){
if($i > 0 && $i <= $sayfasayisi){
if($i == $sayfa){
echo '<li><a href="makaleler?sayfa='.$i.'" class="active">'.$i.'</a></li>';
}else{
echo '<li><a href="makaleler?sayfa='.$i.'">'.$i.'</a></li>';
}
}
}
if($sayfa < $sayfasayisi){
echo '<li><a title="sonraki" href="makaleler?sayfa='.($sayfa+1).'">&raquo;</a></li>';
echo '<li><a href="makaleler?sayfa='.$sayfasayisi.'">Son</a></li>';
}
?>	
</ul></nav>	
</div>	
</div>
<div class="col-md-4">
<?php include('include/sidebar.php'); ?>
<?php include('include/sidebar-makale-etiket-bulutu.php'); ?>			
</div>		
<div class="temizle"></div>
<?php include('include/alt.php'); ?>
</div><!--/.container-->
<script src="js/bootstrap.js"></script>
</body>
</html>