<?php
require_once ("../include/connect.php");
$tarih = date("Y").'-'.date("m").'-'.date("d").'T'.date("H:i:s").'+00:00';
header ("content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" 
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">';


//Sabit Sayfalar+ 
echo "<url><loc>".$SiteBilgi['siteurl']."Anasayfa</loc></url>";
echo "<url><loc>".$SiteBilgi['siteurl']."Makaleler</loc></url>"; 
echo "<url><loc>".$SiteBilgi['ampurl']."</loc></url>";  
//Sabit Sayfalar-


//Kategoriler+
$query = $conn->query("SELECT * FROM kategori ORDER BY baslik ASC");
foreach( $query as $goster ){ 
$id  = $goster["id"];
$seo = $goster["seo"];
echo "<url><loc>".$SiteBilgi['siteurl']."Kategori/".$seo."/".$id."</loc></url>";
}
//Kategoriler-
 

//Ilanlar+
$query = $conn->prepare("SELECT * FROM uyeler WHERE durum = ? ORDER BY id DESC");
$query->execute(array('Yayında'));
while($goster = $query->fetch()){ 
$id    = $goster["id"];
$seo   = $goster["seo"];
echo "<url><loc>".$SiteBilgi['siteurl']."Escort/".$seo."/".$id."</loc></url>";
}
//Ilanlar-


//Makaleler+
$query = $conn->prepare("SELECT * FROM blog WHERE durum = ? ORDER BY id DESC");
$query->execute(array('Aktif'));
foreach( $query as $goster ){ 
$id  = $goster["id"];
$seo = $goster["seo"];
echo "<url><loc>".$SiteBilgi['siteurl']."Yazi/".$seo."/".$id."</loc>   </url>";
}
//Makaleler-
 


echo "</urlset>";
?>