<?php
/*
 * Created on 22.03.2010 at 12:01:16
 *
 * Encoding: UTF-8
 *
 * Author: Alexey "greek" Samoylov
 * A.Samoylov@program-ace.com.ua
 *
 * Copyright by Program Ace <http://program-ace.com>
 * All right reserved
 */

//header("Content-type: application/xhtml+xml");

echo '<?xml version="1.0"?>
<designs>' . "\n";

include 'func.php';

$qry = 'select c.*, ct.name as cname from card as c left join category as ct on (ct.category_ = c.category_)';
$res = mysql_query($qry) or die(mysql_error());
//$list = array();
while (($row=mysql_fetch_assoc($res))!==false) {
    echo '<design>
        <id>' . $row['card_'] . '</id>
    	<name>Design' . $row['card_'] . '</name>
		<productId>'.$row['ProductId'].'</productId>
		<productType>'.$row['ProductType'].'</productType>		
    	<thumbnail>' . $image_url . 'images/thumbnail/' . $row['filename'] . '</thumbnail>
    	<imagePath>' . $image_url . 'images/full/' . $row['filename'] . '</imagePath>
        <category id="' . $row['category_'] . '">' . htmlentities($row['cname'], ENT_QUOTES, 'UTF-8' ) . '</category>
	</design>' . "\n";
/*
    $list[] = {
    	'name' =>  'Design' . $row['card_'],
        'thumbnail' =>  $image_url . 'images/thumbnail/' . $row['filename'],
        'imagePath' =>  $image_url . 'images/full/' . $row['filename'],
        'categoryName' =>  $row['cname'],
        'categoryId' =>  $row['cname']
    };
    */
}
echo '</designs>';
?>
