<?php
include('data.php');
header ('Content-type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$data=mysql_db_query($dbweb,'SELECT * FROM sitemaps WHERE id_website="'.$_SESSION['WD_id'].'"',$web_link);
if(mysql_num_rows($data)==0){
  $data=mysql_db_query($dbweb,'SELECT * FROM text_codes,text_codes_websites WHERE text_codes.id_code=text_codes_websites.id_code AND code_name LIKE "page_%" AND id_website="'.$_SESSION['WD_id'].'"',$web_link);
  while($page=mysql_fetch_array($data)){
    $pg=substr($page['code_name'],5);
	echo '
	<url>
	<loc>'.$url_intranet.'content/'.$pg.'/</loc>
	</url>
	';
  }
  echo '<url>
  <loc>'.$url_intranet.'application/contact/</loc>
  </url>';
}else{
  
}
echo '</urlset>';
?>