<?php header("Content-type:text/xml; charset=utf-8");
//include_once($_SERVER['DOCUMENT_ROOT'].'/source/formprocessor.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/source/defaults.php');
include_once('source/functions.php');
include_once(root.'/.db/clients.php');

echo '<?xml version="1.0" encoding="utf-8"?>
<urlset 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"
         xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.nl;

// print the generic pages, uses the main menu for this 
$links = linkExtractor(file_get_contents(root.'/source/menu.php'));
foreach($links as $value) {
		if ($value[0] != '#' && $value[0] != 'javascript:;') echo '<url><loc>'.'http://www.fargomoorheadarea.com'.$value[0].'</loc></url>'.nl;
}
// print the client pages
foreach($clients as $value) { 
	if ($value['active'] && $value['localpage']){ echo '<url><loc>'.'http://www.fargomoorheadarea.com/clients/'.$value['uid'].'/index.php'.'</loc></url>'.nl; }
} 
echo '</urlset>';
?>
