<?php
require_once('config.php');
$link = mysql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD);
mysql_select_db(DB_DATABASE, $link);
mysql_query("SET NAMES 'utf8'", $link);
mysql_query("SET CHARACTER SET utf8", $link);
mysql_query("SET CHARACTER_SET_CONNECTION=utf8", $link);
if($_GET['action'] == "notif"){
header ("content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
echo "\n<response>\n";
$idProduct=(int)$_GET['idProduct'];
$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 = '".$idProduct."';";
//echo $req;
$result = mysql_query($req);
if($result){
$res = mysql_fetch_array($result);
print("<id>".$res[0]);
print("</id>\n");
print("<name>".iconv("UTF-8", "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>';
}
?>