'' && $_GET['from']<>'0')
{
$fromricerca=$_GET['from'];
$fromricercaurl=$_GET['from'].'/';
}
if($_GET[locale]<>'' && $_GET[locale]<>'locale')
{
$localericerca=$_GET[locale];
$localericercaurl=$_GET[locale].'/';
}
if($_GET[testo]<>'' && $_GET[testo]<>'testo')
{
$testoricerca=$_GET[testo];
$testoricercaurl=$_GET[testo].'/';
}
if($_POST['from']<>'')
{
$fromricerca=$_POST['from'];
$fromricercaurl=$_POST['from'].'/';
}
if($_POST['locale']<>''&& $_POST['locale']<>'locale')
{
$localericerca=$_POST[locale];
$localericercaurl=$_POST[locale].'/';
}
if($_POST['testo']<>'' && $_POST['testo']<>'testo')
{
$testoricerca=$_POST[testo];
$testoricercaurl=$_POST[testo].'/';
}
if($fromricerca=='1' && $localericerca<>'' && $localericerca<>'locale/')
{
$and=" and nw.locale=$localericerca ";
}
if($fromricerca=='1' && addslashes($testoricerca)<>'' && addslashes($testoricerca)<>'testo/')
{
$and2=" and (nw.titolo like '%".addslashes($testoricerca)."%' OR nw.breve like '%".addslashes($testoricerca)."%') ";
}
$_SESSION['url_pagina']='http://www.evogt.it/lista_anteprima.php?pag='.$pag.'&from='.$fromricerca.'&testo='.$testoricerca.'&locale='.$localericerca;
$sql_count_tot = "SELECT count(*) numero from cms_news nw, cms_ristoranti rs where rs.id = nw.locale and nw.tipo_news_motorizz in ('A') and nw.stato='V' ";
$sql_result_count_tot=mysql_query($sql_count_tot.$and.$and2, $connection) or die(mysql_error());
$ValoriRigaCountTot = mysql_fetch_array($sql_result_count_tot);
$all_rows=$ValoriRigaCountTot[numero];
$all_pages = ceil($all_rows / $x_pag);
$first = ($pag - 1) * $x_pag;
//QUERY LISTA_NEWS
$sql_news_count = "select count(*) numero "
."from cms_news nw, cms_ristoranti rs "
."where rs.id = nw.locale "
."and nw.tipo_news_motorizz in ('A') "
."and nw.stato='V' ";
$sql_result_count_filt=mysql_query($sql_news_count.$and.$and2, $connection) or die(mysql_error());
$ValoriRigaCountFilt = mysql_fetch_array($sql_result_count_filt);
$nr=$ValoriRigaCountFilt[numero];
$sql_news ="select nw.id, "
."rs.nome, "
."rs.id id_marca, "
."nw.locale, "
."nw.titolo, "
."nw.descr descrizione, "
."date_format(nw.inizio,'%e %b') inizio, "
."nw.inizioe, "
."nw.finee, "
."nw.breve, "
."nw.userid_post, "
."nw.userid_mod, "
."nw.motorizz, "
."nw.tipo_news_motorizz, "
."nw.magazine, "
."nw.portale, "
."nw.tipo_news, "
."nw.description, "
."nw.keyword, "
."ut.ragione_sociale "
."from cms_news nw, cms_ristoranti rs, utenti ut "
."where rs.id = nw.locale "
."and nw.tipo_news_motorizz in ('A') "
."and nw.stato='V' "
."and ut.id=nw.userid_post ";
$orderby=" order by nw.inizio desc ";
$limit=" LIMIT $first, $x_pag ";
$sql_result_news=mysql_query($sql_news.$and.$and2.$orderby.$limit, $connection) or die(mysql_error());
//QUERY VISTA_NEWS
?>
Anteprime | GTevoluzione.it