include_once ‘admin/required/functions.php’;
include_once ‘admin/required/DBconnect.php’;
$elenco_categorie = cc_mysql_key_value (“id”, “nome_categoria”, CCDB_NAME.”.categorie”, “ORDER BY id”);
$default_category = 1;
echo “
echo “
Categories
\n”;
if ($elenco_categorie){
echo “
- “;
- “.$value.”
foreach ($elenco_categorie as $key=>$value){
$catclass = ($key == $default_category)? “class=’selected'” : “”;
echo “
\n”;
}
echo “
\n”;
}
echo “
\n”;[/insert_php]
if ($elenco_categorie){
$gallery=0;
foreach ($elenco_categorie as $key=>$value){
$elenco_promo = cc_select_all (CCDB_NAME.”.promo”, “WHERE categoria='”.$key.”‘ ORDER BY ts DESC”);
if ($elenco_promo){
$idpromo = “idpromo_”.$key;
echo “
foreach ($elenco_promo as $promo){
$gallery++;
$data = cc_date_us2eu ($promo[‘data’]);
$elenco_foto = cc_get_col_value (“attachment”, CCDB_NAME.”.attachments”, “WHERE promo = ‘”.$promo[‘id’].”‘ ORDER BY ordine”);
$nfoto = count($elenco_foto);
$listino = number_format($promo[‘listino’], 0, “,”, “.”);
$prezzo = number_format($promo[‘prezzo’], 0, “,”, “.”);
$titolo = ucfirst(strtolower($promo[‘titolo’]));
echo “
echo “
“.$titolo.”
\n”;
echo “
if (file_exists(PATH_ATTACHMENTS.$elenco_foto[0])){
$filepath = “/web/htdocs/www.fiorinarredamenti.com/home/”.PATH_ATTACHMENTS.$elenco_foto[0];
echo ““;
echo ““;
echo “\n”;
}
echo “
\n”;
echo “
//echo ”
\n”;
echo ”
“.$promo[‘descrizione’].”
\n”;
echo ”
\n”;
echo ”
\n”;
echo ”
\n”;
echo “
\n”;
if ($nfoto > 1){
for ($i=1; $i<$nfoto; $i++){
echo "“;
}
}
echo “
\n”;
echo “
\n”;
}
echo “
\n”;
}
}
}else{
$idpromo = “idpromo_”.$key;
echo “
echo “No promotion found for this category at the moment.\n”;
echo “
\n”;
}
echo “
\n”;[/insert_php]