session_start();
ob_start();
include("./include/autologin.php");
$sqlads="SELECT * FROM `homepage` WHERE `type`='hottopic' ORDER BY `id` ASC";
$queryads=mysql_query($sqlads);
$countads=1;
while($rowads=mysql_fetch_array($queryads)){
$adsimage[$countads]=$rowads["image"];
$adslink[$countads]=$rowads["link"];
$adstext[$countads]=$rowads["title"];
$countads++;
}
$sqlbanner="SELECT * FROM `gallery` WHERE `landid`=1 AND `groupid`=0 ORDER BY `rank` ASC";
$querybanner=mysql_query($sqlbanner)or die(mysql_error());
$cntbanner=1;
while($rowbanner=mysql_fetch_array($querybanner)){
$idphotobanner[$cntbanner]=$rowbanner["id"];
$thisidbanner=$idphotobanner[$cntbanner];
$sqlbannerprod="SELECT * FROM `banner_products` WHERE `bannerid`='$thisidbanner'";
$querybannerprod=mysql_query($sqlbannerprod);
$cntbannerprod=1;
while($rowbannerprod=mysql_fetch_array($querybannerprod)){
$prodlink[$cntbanner][$cntbannerprod]=$rowbannerprod["prodlink"];
$prodtop[$cntbanner][$cntbannerprod]=$rowbannerprod["top"];
$prodleft[$cntbanner][$cntbannerprod]=$rowbannerprod["left"];
$cntbannerprod++;
}
$nbprodofbanner[$cntbanner]=$cntbannerprod-1;
$photobanner[$cntbanner]=$rowbanner["image"];
$titlebanner[$cntbanner]=$rowbanner["title"];
$cntbanner++;
}
$brandlandid=3;
$sql="SELECT * FROM `depgroups` WHERE `landid`='$brandlandid' AND `appearhome`=1";
$query=mysql_query($sql)or die(mysql_error());
$cntbarnd=1;
while($row=mysql_fetch_array($query)){
$brandid[$cntbarnd]=$row["id"];
$brandimg[$cntbarnd]=$row["image"];
$brandurl[$cntbarnd]=$row["pathurl"];
$cntbarnd++;
}
$categorylandid=7;
$sql="SELECT * FROM `depsubsubgroups` WHERE `landid`='$categorylandid' AND `appearhome`=1";
$query=mysql_query($sql);
$cntcateg=1;
while($rowcat=mysql_fetch_array($query)){
$categoryid[$cntcateg]=$rowcat["id"];
$thiscatid=$categoryid[$cntcateg];
//if($thiscatid==359) {
$categorygroupid=$rowcat["groupid"];
$sqlgrp="SELECT * FROM `depgroups` WHERE `landid`='$categorylandid' AND `id`='$categorygroupid'";
$querygrp=mysql_query($sqlgrp);
$rowgrp=mysql_fetch_array($querygrp);
$categorygroupurl[$cntcateg]=$rowgrp["pathurl"];
$subcategorygroupid=$rowcat["subgroupid"];
$sqlsubgrp="SELECT * FROM `depsubgroups` WHERE `landid`='$categorylandid' AND `id`='$subcategorygroupid'";
$querysubgrp=mysql_query($sqlsubgrp);
$rowsubgrp=mysql_fetch_array($querysubgrp);
$subcategorygroupurl[$cntcateg]=$rowsubgrp["pathurl"];
$categorytitle[$cntcateg]=$rowcat["title"];
$productcategorypathurl[$cntcateg]=$rowcat["pathurl"];
$link[$cntcateg]="http://www.duneseshopping.com/Category/".$categorygroupurl[$cntcateg]."/".$subcategorygroupurl[$cntcateg]."/".$productcategorypathurl[$cntcateg];
$sqlnumart=mysql_query("SELECT COUNT(*) FROM `departicles` WHERE `landid`='$categorylandid' AND `subsubgroupid`='$thiscatid'");
$resultnumart=mysql_fetch_array($sqlnumart);
$totaldeparticles=$resultnumart[0];
if($totaldeparticles>0){
$sql1="SELECT * FROM `departicles` WHERE `landid`='$categorylandid' AND `subsubgroupid`='$thiscatid' ORDER BY `id` DESC limit 0,5";
$query1=mysql_query($sql1);
$cntprod=1;
while($rowprod=mysql_fetch_array($query1)){
$productid[$cntcateg][$cntprod]=$rowprod["id"];
$prodname[$cntcateg][$cntprod]=$rowprod["title"];
$prodsalary[$cntcateg][$cntprod]=$rowprod["sale_price"];
$prodoldprice[$cntcateg][$cntprod]=$rowprod["oldprice"];
$new[$cntcateg][$cntprod]=$rowprod["new"];
$prodpathurl[$cntcateg][$cntprod]=$rowprod["pathurl"];
$thisid=$productid[$cntcateg][$cntprod];
$sqlimage="SELECT * FROM gallery WHERE `landid`='$categorylandid' AND `subsubgroupid`='$thiscatid' AND `articleid`='$thisid' ORDER BY `rank` ASC Limit 0,2";
$queryimage=mysql_query($sqlimage);
$nbrowimage=mysql_num_rows($queryimage);
if($nbrowimage>0){
$kimage=1;
while($rowimage=mysql_fetch_array($queryimage)){
$prodimg[$cntcateg][$cntprod][$kimage]=$rowimage["image"];
$kimage++;
}
}
$cntprod++;
}
$nbprodofcat[$cntcateg]=$cntprod;
$cntcateg++;
}
//}
}
// get last five products
$sqllast5prod="SELECT * FROM `departicles` WHERE `landid`=7 ORDER BY `id` DESC LIMIT 0,5";
$querylast5prod=mysql_query($sqllast5prod);
$cnt5last=1;
while($rowlast5prod=mysql_fetch_array($querylast5prod)){
$idlast5prod[$cnt5last]=$rowlast5prod["id"];
$titlelast5prod[$cnt5last]=$rowlast5prod["title"];
$pathurllast5prod[$cnt5last]=$rowlast5prod["pathurl"];
$pricelast5prod[$cnt5last]=$rowlast5prod["sale_price"];
$pricelast5prodold[$cnt5last]=$rowlast5prod["oldprice"];
$thisid=$idlast5prod[$cnt5last];
$sqlimage="SELECT * FROM gallery WHERE `landid`=7 AND `articleid`='$thisid' ORDER BY `rank` ASC Limit 0,2";
$queryimage=mysql_query($sqlimage);
$nbrowimage=mysql_num_rows($queryimage);
if($nbrowimage>0){
$kimage=1;
while($rowimage=mysql_fetch_array($queryimage)){
$imagelast5prod[$cnt5last][$kimage]=$rowimage["image"];
$kimage++;
}
}
$cnt5last++;
}
// get top selling five products
$sqllast5prod="SELECT * FROM `departicles` WHERE `landid`=7 ORDER BY `selled_qty` DESC LIMIT 0,5";
$querylast5prod=mysql_query($sqllast5prod);
$cntlastselling=1;
while($rowlast5prod=mysql_fetch_array($querylast5prod)){
$idlast5selling[$cntlastselling]=$rowlast5prod["id"];
$titlelast5selling[$cntlastselling]=$rowlast5prod["title"];
$pathurllast5selling[$cntlastselling]=$rowlast5prod["pathurl"];
//$imagelast5selling[$cntlastselling]=$rowlast5prod["image"];
$pricelast5selling[$cntlastselling]=$rowlast5prod["sale_price"];
$pricelast5sellingold[$cntlastselling]=$rowlast5prod["oldprice"];
$thisid=$idlast5selling[$cntlastselling];
$sqlimage="SELECT * FROM gallery WHERE `landid`=7 AND `articleid`='$thisid' ORDER BY `rank` ASC Limit 0,2";
$queryimage=mysql_query($sqlimage);
$nbrowimage=mysql_num_rows($queryimage);
if($nbrowimage>0){
$kimage=1;
while($rowimage=mysql_fetch_array($queryimage)){
$imagelast5selling[$cntlastselling][$kimage]=$rowimage["image"];
$kimage++;
}
}
$cntlastselling++;
}
// get meta
$sqlmeta="SELECT * FROM `meta` WHERE `landid`='1'";
$querymeta=mysql_query($sqlmeta);
$rowmeta=mysql_fetch_array($querymeta);
$metadesc=$rowmeta["description"];
$metakeyword=$rowmeta["keywords"];
$displaymenu=1;
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
if($iPod OR $iPhone OR $iPad) $overflow="scroll";
else $overflow="hidden";
?>