[insert_php] include_once ‘admin/required/variables.php’;
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 “

\n”;
echo “

Categories

\n”;

if ($elenco_categorie){
echo “

    “;
    foreach ($elenco_categorie as $key=>$value){
    $catclass = ($key == $default_category)? “class=’selected'” : “”;
    echo “

  • “.$value.”
  • \n”;
    }
    echo “

\n”;
}

echo “

\n”;[/insert_php]

[insert_php] echo ‘

‘;

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 “\"".$promo['titolo']."\"“;
echo “
\n”;
}

echo “

\n”;

echo “

“;
//echo ”

Start date of promotion: “.$data.”

\n”;
echo ”

Description:
“.$promo[‘descrizione’].”

\n”;
echo ”

List price: “.$listino.” €

\n”;
echo ”

Promotional price: “.$prezzo.” €

\n”;
echo ”

“.$_labels_prezzo[$promo[‘label’]].”

\n”;
echo “

\n”;

if ($nfoto > 1){
for ($i=1; $i<$nfoto; $i++){ echo "“;
}
}

echo “
\n”;
echo “

\n”;

}
echo “

\n”;
}
}
}else{
$idpromo = “idpromo_”.$key;
echo “

\n”;
echo “No promotion found for this category at the moment.\n”;
echo “

\n”;
}
echo “

\n”;[/insert_php]