|
";
function paginazione($page,$page_tot,$var_url){
// Visualizzo la PAGINAZIONE
echo " ";
if ($page>0) {
echo "«";
} else { echo " "; }
echo " | ";
$j=0;
while ($j<$page_tot AND $page_tot>1) {
echo " ";
if ($j==$page) { echo""; echo$j+1; echo""; }
else { echo "" .($j+1). ""; }
$j++;
if( ($j%15==0) && ($j<=($page_tot-1)) ) echo" ";
}
echo " | ";
if ($page<$page_tot-1) { echo " »"; }
else { echo " "; }
echo " |
";
// Visualizzo la PAGINAZIONE
}
//QUERY X LE PAGINE (sql_query serve nel caso vengono fatte delle where)
$result=mysql_query("SELECT cartella_foto_evento FROM foto_eventi" .$sql_query, $conn) or die(mysql_error($conn));
//CALCOLO PAGINE
$paginazione=25;
if (!isset($page)) {$page=0; }
if (!isset($page_tot)) {
$record_totali=mysql_num_rows($result);
$page_tot=(int)($record_totali/$paginazione) ;
if (mysql_num_rows($result)%$paginazione!=0) {$page_tot++; }
}
//echo"Records totali: $record_totali";
//QUERY GENERALE
$result= mysql_query("SELECT * FROM foto_eventi ORDER BY cartella_foto_evento DESC LIMIT " .($page*$paginazione). ", $paginazione",$conn);
paginazione($page,$page_tot,"&record_totali=$record_totali");
//INIZIO E DEFINIZIONE TABELLA DEI DATI DA VISUALIZZARE
echo"0) { echo "titolo_foto_evento | ";}
else { echo "La tabella è vuota | "; }
*/
//CREAZIONE DELLE COLONNE DELLA TABELLA COL WHILE
while ($riga = mysql_fetch_array($result)) {
$titolo_foto_evento=stripslashes($riga['titolo_foto_evento']); $id_evento=stripslashes($riga['id_evento']); $cartella_foto_evento=stripslashes($riga['cartella_foto_evento']);
echo"";
echo "$titolo_foto_evento | ";
// echo "$id_evento | ";
// echo "$cartella_foto_evento | ";
// echo " |";
// echo " |";
// echo " | ";
echo" ";
}
//CHIUSURA DELLA TABELLA
echo" ";
//paginazione($page,$page_tot,"&record_totali=$record_totali");
echo"
|  |