<?php
header('Content-Type: application/xml; charset=utf-8');
$domain = 'https://innovataxidelhi.in';

$pages = [
    ['/', '1.0', 'daily'],
    ['/delhi-to-outstation-tour-innova-crysta-car/', '0.9', 'weekly'],
    ['/crysta-innova-car-rent/', '0.9', 'weekly'],
    ['/innova-crysta-car-hire-in-delhi/', '0.9', 'weekly'],
    ['/innova-crysta-car-rental-in-delhi/', '0.9', 'weekly'],
    ['/innova-car-on-hire-with-driver/', '0.9', 'weekly'],
    ['/contact-us/', '0.8', 'monthly'],
    ['/all-routes.php', '0.9', 'weekly'],
];

// Add all Innova route pages
if (file_exists(__DIR__ . '/data/routes.php')) {
    require_once __DIR__ . '/data/routes.php';
    foreach (getAllRoutes() as $r) {
        $pages[] = ['/' . $r['slug'] . '/', '0.8', 'weekly'];
    }
}

// Add all Tempo Traveller & Force Urbania route pages
if (file_exists(__DIR__ . '/data/vehicle-routes.php')) {
    require_once __DIR__ . '/data/vehicle-routes.php';
    foreach (getVehicleRoutes() as $r) {
        $pages[] = ['/' . $r['slug'] . '/', '0.8', 'weekly'];
    }
}

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<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 foreach ($pages as [$loc, $priority, $freq]): ?>
  <url>
    <loc><?php echo $domain . $loc ?></loc>
    <lastmod><?php echo date('Y-m-d') ?></lastmod>
    <changefreq><?php echo $freq ?></changefreq>
    <priority><?php echo $priority ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
