<?php
/**
 * XMLサイトマップ（検索エンジン向け）
 * 公開URL: このファイルへの絶対URLを robots.txt の Sitemap: に記載してください
 * ※ .xml をPHPで実行するにはサーバーで .htaccess 等の設定が必要な場合があります
 */
require_once __DIR__ . '/includes/config.php';
$base = rtrim(base_url(), '/');

$urls = [
  ['loc' => $base . '/index.php', 'priority' => '1.0', 'changefreq' => 'weekly'],
  ['loc' => $base . '/step.php', 'priority' => '0.8', 'changefreq' => 'monthly'],
  ['loc' => $base . '/faq.php', 'priority' => '0.8', 'changefreq' => 'monthly'],
  ['loc' => $base . '/salon/index.php', 'priority' => '0.9', 'changefreq' => 'monthly'],
  ['loc' => $base . '/salon/ogi.php', 'priority' => '0.8', 'changefreq' => 'monthly'],
  ['loc' => $base . '/salon/nabeshima.php', 'priority' => '0.8', 'changefreq' => 'monthly'],
  ['loc' => $base . '/voice/index.php', 'priority' => '0.9', 'changefreq' => 'weekly'],
  ['loc' => $base . '/voice/ogi.php', 'priority' => '0.8', 'changefreq' => 'weekly'],
  ['loc' => $base . '/voice/nabeshima.php', 'priority' => '0.8', 'changefreq' => 'weekly'],
];

$lastmod = date('Y-m-d');

header('Content-Type: application/xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach ($urls as $u): ?>
  <url>
    <loc><?php echo htmlspecialchars($u['loc'], ENT_XML1, 'UTF-8'); ?></loc>
    <lastmod><?php echo $lastmod; ?></lastmod>
    <changefreq><?php echo $u['changefreq']; ?></changefreq>
    <priority><?php echo $u['priority']; ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
