<?php

echo "<?xml version=\"1.0\" encoding=\"Windows-1251\" ?><rss version=\"2.0\">";

include "../../onestyle_db.php";
include "../../index_0.php";

echo "<channel>
<title>Наши проекты</title>
<link>http://www.onestyle.com.ua</link>
<description>Последняя двадцатка наших проектов</description>
<lastBuildDate>" . date("r") . "</lastBuildDate>
<ttl>124</ttl>";

onestyle_pconnect() or die("no connect");

$result = mysql_query("select jobid, name, desk, directionid from obd_0 ORDER BY jobid desc limit 20") or print('ОШИБКА');
$num_result = mysql_num_rows($result);

for ($i=0; $i<$num_result; $i++){
$row = mysql_fetch_array($result);

echo "<item>
<title>" . stripslashes($row['name']) . "</title>

<link>http://www.onestyle.com.ua/project.php?u=" . $row['jobid'] . "</link>

<description><![CDATA[" . stripslashes($row['desk']) . "]]></description>

<category>" . $odirection[$row['directionid']][0] . "</category>
<pubDate>не определено</pubDate>
</item>";

}

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