<?php 
require_once ('../../../vi_connect.php'); ##-> Mysql Bağlantısı
require_once ('../../../vi_global.php'); ##-> Global Değerler
header('Content-type: text/xml');?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';?>

<?php
$ayar_getir=mysql_query("SELECT * FROM genelayarlar WHERE id='1'"); 
$getir=mysql_fetch_array($ayar_getir); 
$geayar_siteadresi = $getir['geayar_siteadresi'];


## HİZMETLER MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='hizmetler'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/hizmetler/</loc>
<changefreq>monthly</changefreq>
</url>
";

$hizmet_alt_al = mysql_query("SELECT * FROM hizmetler ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($hizmet_alt_al)){
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/hizmet/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}

}

## PROJELER MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='projeler'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/projeler/</loc>
<changefreq>monthly</changefreq>
</url>
";

$proje_kat_al = mysql_query("SELECT * FROM proje_kategori ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($proje_kat_al)){
$p_id = $yaz['id'];
$p_seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/project/$p_seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}


$proje_alt_al = mysql_query("SELECT * FROM projeler ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($proje_alt_al)){
$id = $yaz['id'];
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/proje/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}

}

## BLOGLAR MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='bloglar'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/bloglar/</loc>
<changefreq>monthly</changefreq>
</url>
";

$blog_kat_al = mysql_query("SELECT * FROM blog_kategori ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($blog_kat_al)){
$b_seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/bloglar/$b_seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}


$blog_alt_al = mysql_query("SELECT * FROM bloglar ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($blog_alt_al)){
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/blog/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}


}

## FOTO GALERİ MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='fotogaleri'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/foto-galeri/</loc>
<changefreq>monthly</changefreq>
</url>
";
}

## VİDEO GALERİ MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='video_galeri'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/video-galeri/</loc>
<changefreq>monthly</changefreq>
</url>
";
}

## ÜRÜNLER MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='urunler'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/urunler/</loc>
<changefreq>monthly</changefreq>
</url>
";

$urun_kat_al = mysql_query("SELECT * FROM urun_kategori ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($urun_kat_al)){
$u_seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/urunler/$u_seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}


$urun_alt_al = mysql_query("SELECT * FROM urunler ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($urun_alt_al)){
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/urun/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}
}


## SORULAR MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='sorular'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/sorular/</loc>
<changefreq>monthly</changefreq>
</url>
";
}


## REFERANSLAR MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='referanslar'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/referanslar/</loc>
<changefreq>monthly</changefreq>
</url>
";
}


## PAKETLER MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='fiyattablosu'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
echo "
<url>
<loc>$geayar_siteadresi/paketler/</loc>
<changefreq>monthly</changefreq>
</url>
";
}

## SAYFALAR MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='sayfalar'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
$sayfa_alt_al = mysql_query("SELECT * FROM sayfalar ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($sayfa_alt_al)){
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/sayfa/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}
}

## HİZMET BÖLGELERİ MODÜLÜ 
$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='hizmetbolgeleri'"); $getir=mysql_fetch_array($m_kontrol); 	$m_s_d = $getir['modul_durum'];
if($m_s_d == "acik"){ 
$sayfa_alt_al = mysql_query("SELECT * FROM hizmetbolgeleri ORDER BY id DESC limit 0,999");
while($yaz=mysql_fetch_array($sayfa_alt_al)){
$seo_url = $yaz['seo_url'];
echo "
<url>
<loc>$geayar_siteadresi/sayfa/$seo_url</loc>
<changefreq>monthly</changefreq>
</url>
";
}
}




echo '</urlset>';
 ?>
