<?php header('Content-type: application/rss+xml ', 'encoding : utf-8');?>
<?php
include("./settings.php");
include("./functions.php");

$entreprise = mysqli_fetch_object(mysqli_query($conn, "SELECT * FROM entreprises WHERE host='".$_SERVER['HTTP_HOST']."'"));

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<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\">

<url>
  <loc>https://".$entreprise->host."/</loc>
  <priority>1.00</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/l-entreprise.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/entretenir.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/depanner.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/remplacer.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/contact.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/mentions-legales.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/cgu.php</loc>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://".$entreprise->host."/protection-vie-privee.php</loc>
  <priority>0.80</priority>
</url>";
$result_pages_sup = mysqli_query($conn, "SELECT * FROM autres_activites WHERE id_entreprise='".$entreprise->id."'");
while($enr_pages_sup = mysqli_fetch_object($result_pages_sup))
	{
	echo "
<url>
  <loc>https://".$entreprise->host.rewrite_page_sup($enr_pages_sup->id)."</loc>
  <priority>0.80</priority>
</url>";
	}

echo "

</urlset>";
?>