<?
header('Content-type: text/xml');
echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>";
echo "<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>";
echo "<channel>";

echo "<title>jobnk.Ru/education - ��������, �������� � ����� ��������� �������������� � ������������ � ����������� �������.</title>";
echo "<link>http://www.jobnk.ru</link>";
echo "<description>jobnk.Ru</description>";
$stop_compress=true;
require($_SERVER["DOCUMENT_ROOT"]."/engine/setup.php");



$time_start=time()-3600*24*10;

	$result=mysql_query("SELECT a.*, DATE_FORMAT(a.`date_start`,'%d.%m.%Y') AS `date_start_f`, b.`name` AS `employer_name`, b.`id` AS `employer_id` FROM `".$table_education."` a, `".$table_employer."` b WHERE a.`employer_id`=b.`id` AND b.`status`=3 AND a.`status`=1 AND a.`date_stop`>'".date("Y-m-d")."'");
		while ($row=mysql_fetch_array($result)) {
			$id=$row['id'];
			$date=$row['time'];
			$title=$row['name'];
			$pretext=$row['description'];
			
			
			$pretext=str_replace("'","&apos;",$pretext);
			$pretext=str_replace('"','&quot;',$pretext);
			$pretext=str_replace("&","&amp;",$pretext);
			$pretext=str_replace(">","&gt;",$pretext);
			$pretext=str_replace("<","&lt;",$pretext);

			echo "<item>";
			echo "<guid isPermaLink='true'>http://www.jobnk.ru/education/".$id."/</guid>";
			echo "<author>andrey@doronchenko.ru</author>";
			echo "<pubDate>".date("r",$date)."</pubDate>";
			echo "<link>www.jobnk.ru/education/".$id."</link>";
			echo "<description>".stripslashes($pretext)."</description>";
			echo "<title>".stripslashes($title)." / ������� � ������������.</title>";
			echo "</item>";
		}


echo "</channel>";
echo "</rss>";

?>