<?php
header('Content-Type: application/xml');
require_once __DIR__ . '/includes/bootstrap.php';
require_once __DIR__ . '/includes/db.php';
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc><?= url() ?></loc><changefreq>daily</changefreq><priority>1.0</priority></url>
<url><loc><?= url('courses.php') ?></loc><changefreq>weekly</changefreq><priority>0.9</priority></url>
<url><loc><?= url('trial.php') ?></loc><changefreq>weekly</changefreq><priority>0.9</priority></url>
<url><loc><?= url('admission.php') ?></loc><changefreq>weekly</changefreq><priority>0.9</priority></url>
<url><loc><?= url('teacher-apply.php') ?></loc><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc><?= url('contact.php') ?></loc><changefreq>monthly</changefreq><priority>0.6</priority></url>
<url><loc><?= url('faq.php') ?></loc><changefreq>monthly</changefreq><priority>0.6</priority></url>
<url><loc><?= url('blog.php') ?></loc><changefreq>daily</changefreq><priority>0.8</priority></url>
<?php
$courses = db_fetch_all("SELECT slug,updated_at FROM courses WHERE status='active'");
foreach($courses as $c): ?>
<url><loc><?= url('course.php?slug='.$c['slug']) ?></loc><lastmod><?= date('Y-m-d',strtotime($c['updated_at']?:'now')) ?></lastmod><priority>0.8</priority></url>
<?php endforeach;
$posts = db_fetch_all("SELECT slug,published_at FROM blog_posts WHERE status='published'");
foreach($posts as $p): ?>
<url><loc><?= url('blog-detail.php?slug='.$p['slug']) ?></loc><lastmod><?= date('Y-m-d',strtotime($p['published_at']?:'now')) ?></lastmod><priority>0.6</priority></url>
<?php endforeach;
$pages = db_fetch_all("SELECT slug FROM pages WHERE status='active'");
foreach($pages as $pg): ?>
<url><loc><?= url('page.php?slug='.$pg['slug']) ?></loc><priority>0.5</priority></url>
<?php endforeach; ?>
</urlset>
