<?php
// Generar sitemap.xml dinámicamente
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;

$urlset = $dom->createElement('urlset');
$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$dom->appendChild($urlset);

// Añadir URLs al sitemap
$urls = ['https://cisj.com.ar/', 'https://cisj.com.ar/cisj/', 'https://cisj.com.ar/cisj/lab-idioma.php'];
foreach ($urls as $url) {
    $urlElement = $dom->createElement('url');
    
    $loc = $dom->createElement('loc', $url);
    $urlElement->appendChild($loc);

    $lastmod = $dom->createElement('lastmod', date('Y-m-d'));
    $urlElement->appendChild($lastmod);

    $changefreq = $dom->createElement('changefreq', 'weekly');
    $urlElement->appendChild($changefreq);

    $priority = $dom->createElement('priority', '0.8');
    $urlElement->appendChild($priority);

    $urlset->appendChild($urlElement);
}

$dom->save('sitemap.xml');
?>
