<?php
require_once('config/db.php');

header("Content-Type: application/xml; charset=utf-8");

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <url>
        <loc>https://jalankeluar.id/</loc>
        <priority>1.0</priority>
    </url>

    <url>
        <loc>https://jalankeluar.id/about.php</loc>
        <priority>0.8</priority>
    </url>

    <url>
        <loc>https://jalankeluar.id/chat.php</loc>
        <priority>0.9</priority>
    </url>

    <url>
        <loc>https://jalankeluar.id/search.php</loc>
        <priority>0.7</priority>
    </url>

<?php
$result = $conn->query("SELECT slug FROM problems");

while($row = $result->fetch_assoc()):
?>
    <url>
        <loc>https://jalankeluar.id/problem.php?slug=<?= htmlspecialchars($row['slug']); ?></loc>
        <priority>0.8</priority>
    </url>
<?php endwhile; ?>

</urlset>