queryAll("SELECT id,nome FROM categorias_$lang WHERE activo='1' ORDER BY ord"); $nmcats = count($mcats); for($i=0; $i<$nmcats; $i++) { $mcats[$i]['subcats'] = $DB->queryAll("SELECT id,nome FROM subcategorias_$lang WHERE id_categoria=".$mcats[$i]['id']." AND activo='1' ORDER BY ord"); $mcats[$i]['nsubcats'] = count($mcats[$i]['subcats']); for($j=0; $j<$mcats[$i]['nsubcats']; $j++) { $mcats[$i]['subcats'][$j]['items'] = $DB->queryAll("SELECT id,nome FROM items_$lang WHERE id_cat=".$mcats[$i]['subcats'][$j]['id']." AND activo='1' ORDER BY ord"); } } $destaques = $DB->queryAll("SELECT id,nome,txtdestaque FROM items_$lang WHERE activo='1' AND destaque='1' ORDER BY RAND() LIMIT 3"); for($i=0; $i<3; $i++) { $destaques[$i]['img'] = $DB->queryOne("SELECT img FROM items_img_$lang WHERE id_item=".$destaques[$i]['id']." ORDER BY ord LIMIT 1"); } require('header.php'); ?>
image
image