<?php
header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <?php
    define('SECURE_ACCESS', true);
    require_once 'includes/functions.php';
    
    // Ana site sayfaları
    $site_pages = [
        [
            'url' => 'index.php',
            'priority' => '1.0',
            'changefreq' => 'weekly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'services.php',
            'priority' => '0.9',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'process.php',
            'priority' => '0.9',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'faq.php',
            'priority' => '0.8',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'blog.php',
            'priority' => '0.9',
            'changefreq' => 'daily',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'pricing.php',
            'priority' => '0.8',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'about.php',
            'priority' => '0.7',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'contact.php',
            'priority' => '0.7',
            'changefreq' => 'monthly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'privacy.php',
            'priority' => '0.3',
            'changefreq' => 'yearly',
            'lastmod' => date('Y-m-d')
        ],
        [
            'url' => 'terms.php',
            'priority' => '0.3',
            'changefreq' => 'yearly',
            'lastmod' => date('Y-m-d')
        ]
    ];
    
    foreach ($site_pages as $page) {
        $page_url = url($page['url']);
        ?>
        <url>
            <loc><?php echo $page_url; ?></loc>
            <lastmod><?php echo $page['lastmod']; ?></lastmod>
            <changefreq><?php echo $page['changefreq']; ?></changefreq>
            <priority><?php echo $page['priority']; ?></priority>
        </url>
        <?php
    }
    ?>
</urlset>
