";
$res = $db->esegui("SELECT * FROM ".$_CONFIG['table_banner']." WHERE id='2'");
$sponsor = $db->FetchArray($res);
echo $sponsor['codice'];
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
if (isset($_POST['cerca']))
{
$sql = "SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore FROM ".$_CONFIG['db_news']." WHERE titolo LIKE '%".$_POST['q']."%' OR contenuto LIKE '%".$_POST['q']."%' ORDER BY id DESC";
}
else
{
if (isset($_GET['g']) && isset($_GET['m']) && isset($_GET['y']))
$sql = "SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore FROM ".$_CONFIG['db_news']." WHERE date_format(data, '%d')=".$_GET['g']." AND date_format(data, '%m')=".$_GET['m']." AND date_format(data, '%Y')=".$_GET['y']." ORDER BY id DESC";
else
$sql = "SELECT titolo, id, date_format(data, '%d') as giorno,
date_format(data, '%m') as mese, date_format(data, '%y') as anno,
date_format(data, '%H') as ora, date_format(data, '%i') as minuti,
date_format(data, '%s') as secondi, contenuto, autore FROM ".$_CONFIG['db_news']." WHERE date_format(data, '%m')=$mese_view AND date_format(data, '%Y')=$anno_view ORDER BY id DESC";
}
//echo $sql;
$result = $db->esegui($sql);
echo "