<?if($_GET['auto']!=1) echo file_get_contents (BASE_URL."sitemap.xml"); else {

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">';

echo "
<url>  
<loc>".BASE_URL."</loc>  
<lastmod>".date("Y-m-d",time())."</lastmod>  
<priority>1.00</priority>
</url>
";


		$ppp = $global -> QueryAll("SELECT * FROM product");
		foreach ($ppp as $tam) {
echo "
<url>  
<loc>".BASE_URL.$tam[pr_alias].".html</loc>  
<lastmod>".explode(" ",$tam[pr_date])[0]."</lastmod>  
<priority>0.9</priority>
</url>
";
	}

echo "
<url>  
<loc>".BASE_URL."lien-he/</loc>  
<lastmod>".date("Y-m-d",time())."</lastmod>  
<priority>0.9</priority>
</url>
";

echo "
<url>  
<loc>".BASE_URL."danh-muc/tin-tuc/</loc>  
<lastmod>".date("Y-m-d",time())."</lastmod>  
<priority>0.9</priority>
</url>
";


		$ppp = $global -> QueryAll("SELECT * FROM news");
		foreach ($ppp as $tam) {
echo "
<url>  
<loc>".BASE_URL."tin-tuc/".$tam[news_alias].".html</loc>  
<lastmod>".explode(" ",$tam[pr_date])[0]."</lastmod>  
<priority>0.8</priority>
</url>
";
	}

echo "</urlset>";
}?>