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"); } } $subcat = $DB->queryRow("SELECT nome,texto,id_categoria FROM subcategorias_$lang WHERE id=$id_subcat AND activo='1'"); $cat_nome = $DB->queryOne("SELECT nome FROM categorias_$lang WHERE id=".$subcat['id_categoria']); $subcat_nome = $subcat['nome']; $items = $DB->queryAll("SELECT id,nome,(select img from items_img_$lang where id_item=i.id ORDER BY ord LIMIT 1) AS img FROM items_$lang i WHERE id_cat=$id_subcat AND activo='1' ORDER BY ord LIMIT 4"); $nitems = count($items); require('header.php'); ?>
image
image
image