include "am/header.php"; include "am/headerSuper.php"; if(!isset($_GET['P']) || $_GET['P'] == "") { header("Location: elenco_prodotti.php"); exit(); } $_GET['P'] = (int)$_GET['P']; switch($_SESSION['lang']) { case "en": $field = "categorie.id AS idCat, categorie.nome_en AS nomeCat, categorie.no_sotto, prodotti.id AS idProd, prodotti.id_sotto AS idSotto, prodotti.nome_en AS nomeProd, prodotti.descr_en AS descrProd"; $fieldSub = "id AS idSot, nome_en AS nomeSot"; break; case "es": $field = "categorie.id AS idCat, categorie.nome_es AS nomeCat, categorie.no_sotto, prodotti.id AS idProd, prodotti.id_sotto AS idSotto, prodotti.nome_es AS nomeProd, prodotti.descr_es AS descrProd"; $fieldSub = "id AS idSot, nome_es AS nomeSot"; break; case "de": $field = "categorie.id AS idCat, categorie.nome_de AS nomeCat, categorie.no_sotto, prodotti.id AS idProd, prodotti.id_sotto AS idSotto, prodotti.nome_de AS nomeProd, prodotti.descr_de AS descrProd"; $fieldSub = "id AS idSot, nome_de AS nomeSot"; break; default: $field = "categorie.id AS idCat, categorie.nome AS nomeCat, categorie.no_sotto, prodotti.id AS idProd, prodotti.id_sotto AS idSotto, prodotti.nome AS nomeProd, prodotti.descr AS descrProd"; $fieldSub = "id AS idSot, nome AS nomeSot"; break; } $sth = $dbh->prepare("SELECT $field FROM categorie, prodotti WHERE prodotti.id_cat=categorie.id AND prodotti.id=$_GET[P]"); $sth->execute(); $prod = $sth->fetch(PDO::FETCH_ASSOC); $sth = $dbh->prepare("SELECT $fieldSub FROM sottocategorie WHERE id=$prod[idSotto]"); $sth->execute(); $sotto = $sth->fetch(PDO::FETCH_ASSOC); ?>
include "inc/head.php" ?>