<?php
/**
XML GENERATOR
MADE BY IBRAHIM ARGUN
[url]www.melibo.de[/url]
*/
require_once("includes/globalinclude.php");
$i = 15;
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="windows-1252"?>' . "\n";
?>
<icons>
<?php
/*
* Define the uniform node function
*/
function GenerateNode($data){
$content = '';
$content .= "\t" . '<icon image="bilder/produkte/klein/'.$data['bildurl'].'" tooltip="'.$data['name'].'" link="'.$data['link'].'"></icon>' . "\n";
return $content;
} # end function
$sql = "SELECT a.cName, b.cPfad, a.cSeo, c.fVKNetto
FROM tartikel a
LEFT JOIN tartikelpict b on a.kArtikel=b.kArtikel
LEFT JOIN tpreise c on a.kArtikel=c.kArtikel
WHERE a.cTopArtikel = 'Y'
GROUP BY b.kArtikel
ORDER BY rand(), b.nNr ASC";
/*
* Execute the query
*/
$query = mysql_query($sql);
if ( mysql_num_rows($query) > 0 ){
/*
* Initialize the container
*/
$container = array();
/*
* Loop query result and populate container
*/
while( $result = mysql_fetch_array($query) ){
$mwst = $result['fVKNetto']*0.19;
$preis = $result['fVKNetto']+$mwst;
$preis = number_format($preis,2, ',', '.');
$container = array('name' => $result['cName'],
'link' => $result['cSeo'],
'bildurl' => $result['cPfad'],
'preis' => $preis
);
if($i>0){//lilmit start
echo generateNode($container);
$i--;
} //limit ende
} # end while
}
?>
</icons>