include("connect.php");
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Type: text/xml; charset=cp-1250');
echo '';
echo "\n";
echo "\n";
echo "$link\n";
echo "".date("Y-m-d")."\n";
echo "1.0\n";
echo "\n";
/*kategorie*/
$vysledek = MySQLi_Query($db,"SELECT * FROM pracovni.micro_site where not typ in (0,1,4) and web='56' order by typ asc,pozice asc");
while ($z=mysqli_fetch_assoc($vysledek)) {
echo "\n";
echo "$link/{$z["url"]}\n";
echo "".date("Y-m-d")."\n";
echo "0.5\n";
echo "\n";
}
/*kolekce*/
$fil = MySQLi_Query($db,"select DISTINCT kolekce from zbozi where kolekce<>'0' and zakazat<>'on' and vyrobce='Hot Diamonds' order by kolekce desc");
while ($kol_zb = mysqli_fetch_assoc($fil)) {
$kolekce = mysqli_fetch_assoc(MySQLi_Query($db,"select * from pracovni.kolekce where id = '".$kol_zb["kolekce"]."'"));
if ($kolekce["url"] and $kolekce["url"]<>"emozioni_ht"){
echo "\n";
echo "$link/kolekce-{$kolekce["url"]}\n";
echo "".date("Y-m-d")."\n";
echo "0.9\n";
echo "\n";
}
}
/*produkty*/
$podminka="z.zakazat<>'on'";
$vysledek = MySQLi_Query($db,"select z.*,r.kod,r.cena1,min(id_ref) as 'ref',count(r.id_zbozi) as pocet,min(r.cena2) as 'cenaod',
sum(r.sklad) as 'sklad_sum',r.id_zbozi,r.id_ref,min(r.cena2) as 'min',min(r.cena3) as 'cena3od', min(r.exp_pozn) as 'min_exp'
FROM zbozi z,reference r where r.id_zbozi=z.id and r.cena2<>'0' and !(r.doprodej='1' and r.sklad='0')
and $podminka and z.vyrobce ='Hot Diamonds'
GROUP BY z.id ");
while ( $produkt=mysqli_fetch_assoc($vysledek)) {
$ref = mysqli_num_rows(mysqli_query($db,"SELECT * FROM reference where id_zbozi ='{$produkt["id"]}' and !(doprodej='1' and sklad='0')"));
echo "\n";
echo "$link/{$produkt["url"]}.html";
if ($ref>1) echo "?i={$produkt["kod"]}";
echo "\n";
echo "".date("Y-m-d")."\n";
echo "0.8\n";
echo "\n";
}
echo "";
/*
$x='';
$fp=fopen("sitemap.xml","w");
fwrite($fp,$x);
fwrite($fp,"\n");
fwrite($fp,"\n");
fwrite($fp,"$link\n");
fwrite($fp,"".date("Y-m-d")."\n");
fwrite($fp,"1.0\n");
fwrite($fp,"\n");
$vysledek = MySQLi_Query($db,"SELECT * FROM pracovni.micro_site where not url in ('homepage','mapa-webu','chyba') and web='$web' order by pozice");
while ($z=MySQL_Fetch_Array($vysledek)) {
fwrite($fp,"\n");
fwrite($fp,"$link/{$z["url"]}.html\n");
fwrite($fp,"".date("Y-m-d")."\n");
fwrite($fp,"0.5\n");
fwrite($fp,"\n");
}
fwrite($fp,"");
*/
?>