<?php

require_once('config.php');
	$link = mysql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD);
	mysql_select_db(DB_DATABASE, $link);

if($_GET['action'] == "notif"){  
	header ("content-type: text/xml");

	echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
	echo "\n<response>\n";
	
	$req ="SELECT p.product_id, name, image FROM " . DB_PREFIX . "product p, " . DB_PREFIX . "product_description pd WHERE p.product_id = pd.product_id AND p.product_id = '".$_GET['idProduct']."';";
	//echo $req;
	
	$result = mysql_query($req);

	if($result){
		$res = mysql_fetch_array($result);
			print("<id>".$res[0]);
			print("</id>\n");
			
			
			
			
			print("<name>".iconv("windows-1251", "UTF-8", $res['name']));
			print("</name>\n");
			
			$res['image'] = str_replace(".jpg", "-200x200.jpg", $res['image']);
			$res['image'] = str_replace(".png", "-200x200.png", $res['image']);
			
			print("<image>".$res['image']);	
			print("</image>\n");
	}
	
	echo '</response>';
}
?>