come dicevo in JavaScript sono una frana, posto la parte di codice interessata:
Codice PHP:
<head>
........
<link href="css/template_css.css" rel="stylesheet" type="text/css"/>
<script language="javascript" type="text/javascript">
<!--
function popup(url, name, width, height)
{
settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=no,"+
"resizable=no,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}
//-->
</script>
</head>
<body>
$sql = "select * from tbl_prodotti where id_fam= " . $id_fam . "";
$prt_view_news = mysql_db_query( $nome_db, $sql, $db) or die(mysql_error());
// esecuzione prima query
$count = mysql_query("SELECT COUNT(id_fam) FROM tbl_prodotti where id_fam= " . $id_fam . "");
$res_count = mysql_fetch_row($count);
// numero totale di records
$tot_records = $res_count[0];
// risultati per pagina(secondo parametro di LIMIT)
$per_page = 4;
// numero totale di pagine
$tot_pages = ceil($tot_records / $per_page);
// pagina corrente
$current_page = (!$_GET['page']) ? 1 : (int)$_GET['page'];
// primo parametro di LIMIT
$primo = ($current_page - 1) * $per_page;
// esecuzione seconda query con LIMIT
$query_limit = mysql_query("SELECT * FROM tbl_prodotti where id_fam= " . $id_fam . " LIMIT $primo, $per_page");
while ($row = mysql_fetch_array( $query_limit ) )
{
echo "<table width=100% border=0 valign=top style=border-collapse:collapse bordercolor=#000000>";
echo "<tr>";
echo "<td rowspan=6 style=width=100px valign=top>";
echo "<table width=100 height=100 border=0 valign=top>";
echo "<tr>";
if ($row["foto_2"] != "")
{
if ($row["offerta"] == 'Y')
{
echo "<td valign=top><a href=\#\onClick=\popup('carica_foto.php?id_prod=" .$row["id_prod"] ."');\><img src=office/admin_office/img/" .$row["foto_2"] ." border=1></a>
<div align=center><font face=verdana style=font-size:11>[b]In Offerta[/b]</font></div></td></tr>";
}else{
echo "<td valign=top><a href=carica_foto.php?id_prod=" .$row["id_prod"] ."><img src=office/admin_office/img/" .$row["foto_2"] ." border=1></a></td></tr>";
}
}else{
if (($row["foto_2"] == "") && ($row["offerta"] == 'Y'))
{
echo "<td valign=top><img src=img/no_img.gif border=1><div align=center><font face=verdana style=font-size:11>[b]In Offerta[/b]</font></div></td></tr>";
}else{
if (($row["foto_2"] == "") && ($row["offerta"] == 'N'))
{
echo "<td valign=top><img src=img/no_img.gif border=1></td></tr>";
}
}
}
echo "</table>";
Grazie a tutti voi!!!!