include_once "myconnect.php";
function main()
{
/////////////getting null char
include "myutente.php";
$config=mysql_fetch_array(mysql_query("select * from astevirtuali_configurazione"));
$null_char[0]=$config["null_char"];
//////////////////////////////controllo utente eshop /////////
$rsu=mysql_fetch_array(mysql_query("select eshop from astevirtuali_utenti where id=".$uid));
if($rsu["eshop"]=="")
{
//header("Location: ". "eshop.php?uid=161");
//die();
}
///////////////////////////////////session/////////
session_start();
if (!isset($_SESSION['cart'])) {
$_SESSION['cart'] = array();
setcookie("cart",time()+777600);
setcookie('cart'.'pez',time()+777600);
setcookie('cart'.'not',time()+777600);
setcookie('cart'.'pag',time()+777600);
setcookie('cart'.'sco',time()+777600);
setcookie('cart'.'dove',time()+777600);
setcookie('cart'.'myg',time()+777600);
}
//-----------------------------------------///
if (($_GET['azzera']==1)) {
unset ($_SESSION['cart']);
header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
exit();
}
if (($_GET['empty']==1)) {
$_SESSION['cart'.'pez'][$_GET['pz']] = "0";
echo '';
}
if (isset($_GET['modif'])) {
// Empty the $_SESSION['cart'] array
$_SESSION['cart'.'pez'][$_GET['pz']] = $_GET['qt'];
echo '';
}
if (isset($_GET['nota'])) {
$_SESSION['cart'.'not'][$_GET['pz']] =$_REQUEST['note'];
echo '';
}
if ($_REQUEST["brend"]<=0) {$cid=$_REQUEST["cid"];}
if ($_REQUEST["brend"]>=0) {$_SESSION['cart'.'brend']=$_REQUEST["brend"];}
if ($_SESSION['cart'.'brend']>0) { $_REQUEST["brend"]=$_SESSION['cart'.'brend'];}
$_SESSION['cart'.'brend']=$_REQUEST["brend"];
if($cid>=1)
{
//$_SESSION['cart'.'brend']="";
if($cid<=10){$cid="45";} //deve essere 743
$scelta=1;
}
elseif ( isset( $_REQUEST["cid"] ) && $_REQUEST["cid"]!="" )
{
$cid=$_REQUEST["cid"];
$scelta=3;
$_SESSION["u_categ"]=$cid ;
// header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
}
elseif($_SESSION['u_categ']>=1)
{
$cid=$_SESSION['u_categ'];
$scelta=2;
}
else
{
$cid=45; // 743
$scelta=4;
$_SESSION["u_categ"]=0 ;
//header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
}
////////////////////////////////FINE ///categoria cid /////////
$_SESSION["visita"][$uid] =$cid; // sta visitando
/////////////////////////////////////////////////////////////////////////////////
if(!isset($_REQUEST["type"]))
{
$type=1;
}
else
{
$type=$_REQUEST["type"];
}
$strpass="";
if ( isset($_REQUEST["keyword"] ) )
{
$strpass=$strpass . "&keyword=" . $_REQUEST["keyword"];
}
if ( isset($_REQUEST["radio"] ) )
{
$strpass=$strpass . "&radio=" . $_REQUEST["radio"];
}
$strpass=$strpass . "&cid=" . $cid;
$strpass=$strpass . "&uid=" . $uid;
$strpass=$strpass . "&type=" . $type;
$strpass1=$strpass;
$rs_query=mysql_query("Select * from astevirtuali_categorie where id=" . $cid );
if ($rs=mysql_fetch_array($rs_query))
{
$catname=$rs["cat_name"];
$category=$rs["id"];
$cid=$rs["id"];
$descrizione=$rs["cat_desc"];
$collegamento=$rs["collegamento"];
$foto1=$rs["cat_foto1"];
$foto2=$rs["cat_foto2"];
}
else
{
$catname="";
$category=0;
$cid=0;
}
$catpath="";
$rs_query=mysql_query("Select * from astevirtuali_categorie where id=" . $category );
while ($rs=mysql_fetch_array($rs_query))
{
$catpath ="> " .$rs["cat_name"]."" . $catpath;
$rs_query=mysql_query("Select * from astevirtuali_categorie where id=" . $rs["pid"] );
}
if ($_REQUEST["brend"]>0)
{
$recperpage=70 ; // righe per pagina
}
else
{
$recperpage=150 ; // righe per pagina
}
//$sql="select *,DATE_FORMAT(date_submitted,'%d-%b-%Y %r') as postedon,DATE_FORMAT(DATE_ADD(date_submitted,INTERVAL auction_period DAY),'%d-%b-%Y %r') as endson,UNIX_TIMESTAMP(DATE_ADD(date_submitted,INTERVAL auction_period DAY)) as expiry from astevirtuali_prodotti where approved='yes' and aucid in (1,3,5,6,7,10,20,25,30)";
$sql="select * from astevirtuali_prodotti where approved='yes' ";
if (($type==1) || ($type==9))
{
$date1=date(time());
//$sql.=" and UNIX_TIMESTAMP(DATE_ADD(date_submitted,INTERVAL auction_period DAY)) > $date1 and status='open' and uid=" . $uid;
//$date1=date(time());
//$sql.=" and status='open' and uid=" . $uid;
}
////// leggi pure ditta dalu(12) SEMPRE e se in RICERCA TUTTE /////////////////////////////////////////
$sql.=" and status in ('open')"; //,'concluaucid in sa vend','Venduto'
$sql.=" and uid in (1,3,5,6,7,8,10,11,12,14,20,21,25,27,28,30,31,36,37,38,45,175)";
//if ($_REQUEST["radio"]==29)
// { $sql.=" and location in (29,33) ";}
//if ($_REQUEST["radio"]==30)
// { $sql.=" and location in (30,33) ";}
//$sql.=" and uid=9 "; // solo 9 per garden sicily
//if (($_REQUEST["radio"]>=1) || ($cid>10))
// { $sql.=" and uid in (175,31,28,27,11,12,14,9,37)";} // 7 è ditta per orologi da fare a parte !
//else
// { $sql.=" and uid in (175,31,28,27,11,12,14,9,37) and gallery_featured='yes'";} // gallery_featured = in evidenza !
///
if ( isset($_REQUEST["keyword"] ) && $_REQUEST["keyword"]!="" && isset($_REQUEST["radio"] ) && $_REQUEST["radio"]==1)
{
$sql=$sql." and ( product_name like '%".str_replace("'","''",$_REQUEST["keyword"])."%' or codice like'%".str_replace("'","''",$_REQUEST["keyword"])."%' or id like'%".str_replace("'","''",$_REQUEST["keyword"])."%' )";
}
if ( isset($_REQUEST["keyword"] ) && $_REQUEST["keyword"]!="" && isset($_REQUEST["radio"] ) && $_REQUEST["radio"]==2)
{
$sql=$sql." and ( product_name like '%".str_replace("'","''",$_REQUEST["keyword"])."%')";
}
if ($_REQUEST["brend"]>0)
{
$sql=$sql." and bold=". $_REQUEST["brend"] . " ";
}
if ( isset($_REQUEST["keyword"] ) && $_REQUEST["keyword"]!="" && isset($_REQUEST["radio"] ) && $_REQUEST["radio"]==3)
{
$sql=$sql." and ( product_name like '%".str_replace("'","''",$_REQUEST["keyword"])."%' or product_desc like '%".str_replace("'","''",$_REQUEST["keyword"]). "%')";
}
if ( isset($_REQUEST["keyword"] ) && $_REQUEST["keyword"]!="" && isset($_REQUEST["radio"] ) && $_REQUEST["radio"]==4)
{
$sql=$sql." and ( raffina3='".str_replace("'","''",$_REQUEST["keyword"])."') ";
}
// --- eliminato il 20 ott 2017 ---
//if ( isset($_REQUEST["keyword"] ) && $_REQUEST["keyword"]!="" && isset($_REQUEST["radio"] ) && $_REQUEST["radio"]==3)
//{
//$sql0=mysql_query("select id from astevirtuali_utenti where (username like '%".str_replace("'","''",$_REQUEST["keyword"])."%' or fname like '%".str_replace("'","''",$_REQUEST["keyword"])."%' or lname like '%".str_replace("'","''",$_REQUEST["keyword"])."%' or c_name like'%".str_replace("'","''",$_REQUEST["keyword"])."%')");
//$u_list="-1";
//while($rs_t1=mysql_fetch_array($sql0))
//{
//$u_list.=",".$rs_t1["id"];
//}
//$sql=$sql." and uid in (".$u_list.")";
//}
// --- fine eliminato il 20 ott
$clist=$cid;
// --- inizio 2 eliminato il 20 ott
$rst1_query=mysql_query("Select * from astevirtuali_categorie where pid=" . $cid );
while ( $rst1=mysql_fetch_array($rst1_query) )
{
$clist.="," . $rst1["id"];
$rst1_query=mysql_query("Select * from astevirtuali_categorie where pid IN (" . $clist . ") and id not in ( ". $clist . ")") ;
}
// --- fine 2 eliminato il 20 ott
$sql.=" and cid in (" . $clist . ") " ;
//$sql.= " order by endson desc" ;
if($type==9)
{
$sql.= " order by featured desc" ; // , date_submitted desc
}
else
{
$sql.= " order by pezzi desc" ; // , in ordine pezzi
}
//$sql.= " order by featured desc, aucid, date_submitted desc" ;
$rs_query=mysql_query($sql);
///////////////////////////////////PAGINATION /////////
if($pg>=1)
{$scelta=1;}
elseif($_REQUEST['pg']>=1)
{
$pg=$_REQUEST["pg"];
$scelta=3;
$_SESSION["u_pagina"]=$pg ;
//header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
$pag=$_SESSION['u_pagina'];
}
elseif($_SESSION['u_pagina']>=1)
{
$pg=$_SESSION['u_pagina'];
$pag=$_SESSION['u_pagina'];
$scelta=2;
}
else
{
$pg=1;
$scelta=4;
$_SESSION["u_pagina"]=1 ;
//header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
$pag=$_SESSION['u_pagina'];
}
////////////////////////////////FINE ///PAGINATION /////////
$rcount=mysql_num_rows($rs_query);
if ($rcount==0 )
{
$pages=0;
}
else
{
$pages=floor($rcount / $recperpage);
if (($rcount%$recperpage) > 0 )
{
$pages=$pages+1;
}
}
$jmpcnt=1;
while ( $jmpcnt<=($pg-1)*$recperpage && $row = mysql_fetch_array($rs_query) )
{
$jmpcnt = $jmpcnt + 1;
}
$label=1;
$featured_label=1;
?>
////////////////////////////////FINE ///categoria cid /////////
$_SESSION["visita"][$uid] =$cid; // sta visitando
$_SESSION["pagina"]="galleria"; // sta visitando
///////////////////////////////////////////////////////////////
?>
";
}
else
{
?>
|
Clicca Sulle Foto per i Dettagli o per Ordinare
+
$cnt=0;
$num=0;
$row=0;
$cur_id=mysql_fetch_array(mysql_query("select cur_id from astevirtuali_configurazione"));
$cur=mysql_fetch_array(mysql_query("select * from astevirtuali_valuta where id=".$cur_id["cur_id"]));
$rs0=mysql_fetch_array($rs_query);
while ( ($rs0) && ($cnt<$recperpage) )
{
$image=mysql_fetch_array(mysql_query("select * from astevirtuali_immagini where pid=".$rs0["id"]." order by id"));
if($image)
{
$num++;
// if($num%3==1) su cellulare riga a riga
// { su cellulare riga a riga
$row++;
?>
// } su cellulare riga a riga
// ------ registra ultima pagina precedente vista su questo prodotto: --------
$rt_d=mysql_fetch_array(mysql_query("select * from astevirtuali_prodotti_dati where id=".$rs0["id"]));
?>
$rs_t0=mysql_fetch_array(mysql_query("select url,formato from astevirtuali_immagini where pid=".$rs0["id"]." group by pid"));
if($rs_t0)
{
?>
$titolo=$rs0["product_name"];
$largo=230;
$alto=160;
?>
switch($rs_t0["formato"])
{
case 1: $largo=145;$alto=120; $largo2=230;$alto2=230; $largo0=72;$alto0=60; break;
case 2: $largo=120;$alto=150; $largo2=230;$alto2=300; $largo0=60;$alto0=72;break;
case 3: $largo=130;$alto=130; $largo2=230;$alto2=230; $largo0=60;$alto0=60;break;
}
?>
&uid= echo $uid;?>" class="biglink">
//controlla se eok funziona (usato di riserva):
if( file_exists("public/". $rs_t0["url"]))
{
$linkeok="public/";?>
}
else
{
$linkeok="public/"; // ex: $linkeok="https://www.eok.it/public/"; FIN QUANTO EOK STACCATO
}
?>
" alt=" echo $rs0["product_name"];?>" title=" echo $rs0["product_name"];?>" width=220 border="0">
} ?> |
$descr8=str_replace('/', '',$rs0["product_desc"]);
$descr7=str_replace('(', ' ',$descr8);
$descr6=str_replace(')', ' ',$descr7);
$descr5=str_replace('"', ' ',$descr6);
$descr4=str_replace("'", ' ',$descr5);
$descr3=str_replace(" ", '\n',$descr4);
$descr2=str_replace("<", ' ',$descr3);
$descr=str_replace(">", ' ',$descr2);
?>
&uid= echo $uid;?>" class="biglink">
SKU: echo $rs0["id"];?>
|
}
?>
if (($rs0["pezzi"]>0) && ($rs0["sconto_mom"]>=1))
{?> echo $rs0["min_bid"];?> } ?>
if (($rs0["pezzi"]>0) && ($rs0["sconto_mom"]<1))
{?> echo $rs0["min_bid"];?> } ?>
if(($rs0["max_price"]>0) && ($rs0["max_price"]>$rs0["min_bid"]))
{ ?> (Listino: echo $rs0["max_price"] ?> ) }
?>
if ($rs0["soddisfatti"]==3)
{?> }
if ($rs0["soddisfatti"]==3.5)
{?> }
if ($rs0["soddisfatti"]==4)
{?> }
if ($rs0["soddisfatti"]==4.5)
{?> }
if ($rs0["soddisfatti"]==5)
{?> }
if ($rs0["soddisfatti"]==5.5)
{?> }
if ($rs0["tempi"]=="1 gg.")
{?> }
?>
if($rs0["sconto_mom"]>=1)
{
$sconto=$rs0["min_bid"]*$rs0["sconto_mom"]/100;
$scontato=$rs0["min_bid"]-$sconto;
?>
Offerta €.
echo number_format($scontato, 2, ',', ' ') ?>
}
else
{
$scontato=$rs0["min_bid"];
}
$imponibile=$scontato/1.21;
$imponibile=number_format($imponibile, 2, ',', ' '); // solo 2 decimali
?>
|
echo $rt_d["raffina2"]." "; ?>
$ditta=$rs0["bold"];
if($ditta>=1)
{?>
: echo $rt_d["raffina3"]; ?>
}
else
{?> echo $ditta; ?> echo $rt_d["raffina3"]; ?> }
?>
|
echo substr($titolo, 0,58);
?>
|
echo $rt_d["raffina0"] . " " . $rt_d["raffina11"] . " " . $rt_d["raffina1"];?>
echo $rt_d["raffina4"];?> echo $rt_d["raffina12"];?>
echo $rt_d["raffina41"];?> echo $rt_d["raffina5"];?>
|
|
|
|
|
// if ($cnt === 25) { break 3 ;} //pausa
$cnt=$cnt+1; }
$rs0=mysql_fetch_array($rs_query);
if(!($rs0)||($cnt>=$recperpage))
{
$blankpad=(($row*2)-$num)%2;
while( ($blankpad>0) )
{
?>
$blankpad--;}
}
// if($num%3==0) su cellulare non attivo ma riga a riga
//{ su cellulare riga a riga
?>
//} su cellulare riga a riga
}//while
$cnt=0;
?>
}// else
?> |
// echo "L:" . $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; ?>
|
if ($pages>1)
{
?>
|
|
|
}
?>
|
if ($_REQUEST["brend"]<1)
{
?>
include_once "brend_mobile.php"; ?>
}
else
{
?>
$marchio=$_REQUEST["brend"];
include_once "notizie-brend_mobile.php";
?>
}
?>
}// end main
?>
include "tools-ph-galleria.php";
?>