<?php
/**
XML GENERATOR
MADE BY IBRAHIM ARGUN
www.melibo.de
*/
require_once("includes/globalinclude.php");
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/middle/'.$data['bildurl'].'" 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.20;
$preis = $result['fVKNetto']+$mwst;
$preis = number_format($preis,2, ',', '.');
$container = array('name' => $result['cName'],
'link' => $result['cSeo'],
'bildurl' => $result['cPfad'],
'preis' => $preis
);
echo generateNode($container);
} # end while
}
?>
</icons>