<html>
<head>
<link rel="stylesheet" HREF="style.css" type="text/css">
</head>
<body>
<form action="index.php" method="post">
<b>Galleri:</b>
<hr>
<select name="show" style="border: 1px solid #000000; background-color: #FFFFFF; font-size:12" size="1">

<?
include "config.php";
$sql = "SELECT id FROM galleri_avis";
$query = mysql_query($sql);
$num = mysql_num_rows($query);
$average = $num/10;
$pages = ceil($average);
$page_number = 0;
while ($page_number < $pages)
	{
	$test = $pages-1;
	$page_number++;
	$show_number = $page_number*10-10;
	echo("<option value=\"".$show_number."\">".$page_number."</option>");
	}

?>
</select>
<input type="submit" value="Vælg" style="border: 1px solid #000000; background-color: #FFFFFF; font-size:12"><br>
<?
if (!$show)
{
$show = 0;
}
$sql = "SELECT id FROM galleri_avis";
$query = mysql_query($sql);
$number = mysql_num_rows($query);
echo("Billeder ialt <b>".$number."</b>.");
?><br>
<hr>
</form>
<?
$hent = mysql_query("SELECT * FROM galleri_avis ORDER BY id DESC LIMIT $show,10") or die(mysql_error());
while($vis = mysql_fetch_array($hent)) {
?>
<table border="0" cellspacing="1" width="421" height="68">
  <tr>
    <td width="82">
    <table border="0" cellspacing="1" width="98%" height="70">
      <tr>
        <td><img border="0" src="<?  print $vis[image]; ?>" width="75" height="75" style="border: 1px solid #000000;"></td>
      </tr>
    </table>
    </td>
    <td width="332">
    <table border="0" cellspacing="1" width="99%" height="76">
      <tr>
        <td><b><? echo $vis[navn]; ?></b></td>
      </tr>
      <tr>
        <td>
<A href="vis_galleri.php?id=<? echo $vis[id]; ?>" <a href="#" onclick="javascript:popupwindow('vis_galleri.php?id=<? echo $vis[id]; ?>','vindue','width=450,height=450,resizable=0,scrollbars=0')"><b><? echo $vis[beskrivelse]; ?></b></a>
      </tr>
    </table>
    </td>
  </tr>
</table>
 
<hr>
<?
}
?>

</body>

</html>