<?php

require_once "_class/baglan.php";
require_once "_class/fonksiyon.php";
if (!file_exists("language/dil_" . $_SESSION["k_dil"] . ".php")) {
    exit("Mevcut dilin dosyası bulunamadı!");
}
require_once "language/dil_" . $_SESSION["k_dil"] . ".php";
require_once "_class/seo.php";
header("Content-Type:text/xml; Charset=utf-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<urlset\r\n      xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\r\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n      xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\r\n            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\r\n";
$protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"], 0, 5)) == "https" ? "https" : "http";
$protocol = isset($_SERVER["HTTPS"]) ? "https://" : "http://";
$url = $protocol . $_SERVER["HTTP_HOST"] . dirname($_SERVER["PHP_SELF"]);
if ($moduller["alan20"] == "1") {
    $html = ".html";
} else {
    $html = "";
}
echo "<url>\r\n  <loc>";
echo $url;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["belgeurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["sssurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["ekiburl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["musteriurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["ikurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["dokumanurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["birimurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["kursurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["yemekmenusuurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["bursformurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["onbasvuruformurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["etkinlikurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["hizmeturl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["haberurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["fotourl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["videourl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n\r\n<url>\r\n  <loc>";
echo $url;
echo altklasor == "1" ? "/" : "";
echo $htc["iletisimurl"];
echo $html;
echo "</loc>\r\n</url>\r\n\r\n\r\n";
$cek = $db->query("SELECT * FROM sayfalar WHERE durum=1 ORDER BY id DESC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["sayfaurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM etkinlikler WHERE durum=1 ORDER BY id ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["etkinlikdetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM egitim_birimleri WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["birimdetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM haberler WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["haberdetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM hizmetler WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["hizmetdetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM kurslar WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["kursdetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM foto_galeri WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["fotodetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
$cek = $db->query("SELECT * FROM video_galeri WHERE durum=1 ORDER BY sira ASC");
while ($veri = $cek->fetch(PDO::FETCH_OBJ)) {
    echo "<url>\r\n<loc>";
    echo $url;
    echo altklasor == "1" ? "/" : "";
    echo $htc["videodetayurl"];
    echo "/";
    echo $veri->seo;
    echo $html;
    echo "</loc>\r\n</url>\r\n\n";
}
echo "</urlset>";

?>