echo "
";
$result = mysql_query("SELECT titolo_".$lang." as titolo, hafigli, contatore, descrizione_".$lang." as descrizione FROM categorie WHERE contatore = ".end($id_categorie)." AND visibile_".$lang." = 1");
$myrow = mysql_fetch_array($result);
$titolo=$myrow['titolo'];
$descrizione=$myrow['descrizione'];
//echo "
".$myrow['hafigli']."";
if($myrow['hafigli']==0){
echo $arrayTesti[52][$lang]."
".strtoupper($titolo)."
";
$result2 = mysql_query("SELECT articoli.codice, articoli.ID, articoli.immagine0, articoli.descrizione_breve_".$lang." as descrizione_breve, articoli.titolo_".$lang." as titolo, articoli.prezzo".$langPrezzo." as prezzo,articoli_to_categorie.articoli_to_categorie_catId FROM articoli,articoli_to_categorie WHERE articoli.ID = articoli_to_categorie.articoli_to_categorie_artId AND articoli_to_categorie.articoli_to_categorie_catId = ".$myrow['contatore']." AND articoli.visibile_".$lang." = 1 ORDER BY ordinamento ASC");
///////////////////////////////////////
$total_rows_articoli = mysql_num_rows($result2);
if($total_rows_articoli==0){
//mysql_free_result($result);
//echo "non ci sono articoli e devo mostrare descrizione";
echo "
".str_replace("UserFiles","/admin/UserFiles",$descrizione)."
";
}
/////////////////////////////
while ($myrow2 = mysql_fetch_array($result2))
{
$resOfferta = mysql_query("SELECT * FROM artid_to_catid_offerta WHERE artId = ".$myrow2['ID']);
$numRow = mysql_num_rows($resOfferta);
$stylePrezzo="";
if($numRow>0){
$stylePrezzo="font-size:11px;color:red;font-weight:bold";
}
$rowOfferta=mysql_fetch_array($resOfferta);
$campoDb="old_price_".$lang;
$prezzo_old=$rowOfferta[$campoDb];
echo "
";
echo "
 |
".$myrow2['descrizione_breve']." | |
";
echo "
";
}
}else{
$result2 = mysql_query("SELECT titolo_".$lang." as titolo, contatore FROM categorie WHERE genitore = '".$myrow['contatore']."' AND visibile_".$lang." = 1 ORDER BY titolo ASC");
echo "
".$arrayTesti[52][$lang].":
".strtoupper($titolo)." |
|
";
while ($myrow2 = mysql_fetch_array($result2)){
echo " ";
}
echo " |
";
echo "";
////////////****** ARTICOLI IN EVIDENZA ****////
////*******VERIFICO SE NELLA CATEGORIA ESISTONO PRODOTTI IN EVIDENZA O OFFERTA
$resCheckOfferta=mysql_query("SELECT * FROM articoli, artid_to_catid_offerta WHERE artid_to_catid_offerta.artId = articoli.ID AND artid_to_catid_offerta.catid = ".$id_categorie[0]." AND articoli.visibile_".$lang." = 1");
$articoliInOfferta=mysql_num_rows($resCheckOfferta);
$resCheckEvidenza=mysql_query("SELECT * FROM articoli, artid_to_catid_evidenza WHERE artid_to_catid_evidenza.artId = articoli.ID AND artid_to_catid_evidenza.catid = ".$id_categorie[0]." AND articoli.visibile_".$lang." = 1");
$articoliInEvidenza=mysql_num_rows($resCheckEvidenza);
if($articoliInEvidenza+$articoliInOfferta>0){
?>

if($articoliInOfferta>0){
?>
$res=mysql_query("SELECT *,articoli.prezzo".$langPrezzo." as prezzo, artid_to_catid_offerta.old_price_".$lang." as old_price,titolo_".$lang." as titolo FROM articoli, artid_to_catid_offerta WHERE artid_to_catid_offerta.artId = articoli.ID AND artid_to_catid_offerta.catid = ".$id_categorie[0]." AND articoli.visibile_".$lang." = 1 ORDER BY RAND() LIMIT 0,20");
?>
while($rowEv=mysql_fetch_array($res)){
$resCat=mysql_query("SELECT * FROM articoli_to_categorie WHERE articoli_to_categorie_artId = ".$rowEv['ID']." LIMIT 0,1");
$rowCat=mysql_fetch_array($resCat);
$categoria=$rowCat['articoli_to_categorie_catId'];
$url="/atlante/".$lang."/".recuperaCatTree($categoria)."/product_".$rowEv['ID'].".htm";
?>
|  | € €
|
}
?>
} //end artcoliofferta > 0
if($articoliInEvidenza>0){
?>
$res=mysql_query("SELECT *,articoli.prezzo".$langPrezzo." as prezzo,titolo_".$lang." as titolo FROM articoli, artid_to_catid_evidenza WHERE artid_to_catid_evidenza.artId = articoli.ID AND artid_to_catid_evidenza.catid = ".$id_categorie[0]." AND articoli.visibile_".$lang." = 1 ORDER BY RAND() LIMIT 0,20");
while($rowEv=mysql_fetch_array($res)){
$resCat=mysql_query("SELECT * FROM articoli_to_categorie WHERE articoli_to_categorie_artId = ".$rowEv['ID']." LIMIT 0,1");
$rowCat=mysql_fetch_array($resCat);
$categoria=$rowCat['articoli_to_categorie_catId'];
$url="/atlante/".$lang."/".recuperaCatTree($categoria)."/product_".$rowEv['ID'].".htm";
?>
|  | € |
}
?>
}
?>
}
////////////****** ARTICOLI IN EVIDENZA END ****////
echo " |
";
}
?>