<?
session_start();
include($DOCUMENT_ROOT."/inc/dbconnect.inc");
$today = date(«Y-m-d H:i»);
print '<?xml version="1.0" encoding="windows-1251"?>';
?>
<!DOCTYPE yml_catalog SYSTEM shops.dtd>
<yml_catalog date="<?=$today?>">
<shop>
<name>Дивайс Ком?</name>
<company>Дивайс Ком?</company>
<url>http://www.devicecom.ru/</url>
<currencies>
<?
$curr="SELECT * FROM course ORDER BY id DESC;";
$prod=mysql_query($curr,$link);
$arr_prod=mysql_fetch_array($prod);
?>
</currencies>
<categories>
<?
$cat_list= array();
$ctg="SELECT * FROM meta WHERE yand=1";
$ctg=mysql_query($ctg,$link);
for($i=0;$i<mysql_num_rows($ctg);$i++)
{
}
?>
</categories>
<offers>
<?
$prod="SELECT product.name,product.code,product.price1,product.parent_id,product.img,meta.code,meta.img,product.yand FROM product, meta WHERE (";
for($r=0;$r<count($cat_list);$r++)
{
}
$prod=substr($prod,0,(strlen($prod)-4));
$prod.=") AND meta.yand=1 AND product.yand=1 AND product.parent_id=meta.code;";
$prod=mysql_query($prod,$link);
if(mysql_num_rows($prod)>0)
{
for($k=0;$k<mysql_num_rows($prod);$k++)
{
?>
$arr_prod['price1']=ereg_replace(",",".",$arr_prod['price1']);
$arr_prod['price1']=ereg_replace(" ",,$arr_prod['price1']);
print $arr_prod['price1'];
?></price>
<currencyId>USD</currencyId>
<categoryId><?=$arr_prod[3]?></categoryId>
<?
if($arr_prod[4]!=)
{
?><picture>http://www.devicecom.ru/img/upload/<?=$arr_prod[4]?></picture>
<?
}
elseif($arr_prod[4]== && $arr_prod[6]!=)
{
?><picture>http://www.devicecom.ru/img/upload/<?=$arr_prod[6]?></picture>
<?
}
?><name><?
$arr_prod[0]=ereg_replace("\"",""",$arr_prod[0]);
$arr_prod[0]=ereg_replace("&","&",$arr_prod[0]);
$arr_prod[0]=ereg_replace(">",">",$arr_prod[0]);
$arr_prod[0]=ereg_replace("<","<",$arr_prod[0]);
$arr_prod[0]=ereg_replace("\'","'",$arr_prod[0]);
<?
}
}
?>
</offers>
</shop>
</yml_catalog>