de opdracht moet vandaag klaar zijn
hier de code waar het om gaat
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><style type="text/css">
#container {
width: 800px;
border: 0px solid black;
margin: 0px;
margin-left: auto;
margin-right: auto;
padding: 10px;
}
#header {
padding: 10px;
margin-bottom: 0px;
background-image: url(images/header.jpg);
}
#main {
padding: 10px;
margin-bottom: 0px;
background-image: url(images/menu.jpg);
}
#inhoud {
padding: 10px;
background-color: white;
}
#footer {
padding: 10px;
background-image: url(images/menu.jpg);
}
</style>
<title>i2web.nl</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<META NAME="keywords" CONTENT="webdesign,design,scripting,">
<link href="i2web.css" rel="stylesheet" type="text/css">
</head>
<script>
function open_window(url) {
window.open(url,"MyWin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=450,height=250');
}
function ShowPic(url,title,x1,y1) {
window.open('image.php?i='+url+'&t='+title+'', 'MyWin', 'top=1,width=' + x1 + ', height=' + y1 + '');
}
</script>
<body>
<div id="container">
<div id="header" class="header">
<?php
include"inc/config.inc.php";
$select = mysql_query("SELECT * FROM algemeen") or die(mysql_error());
while($obj = mysql_fetch_object($select)){
echo "$obj->headertitel<br></a>";
?>
</div>
<div id="main" class="foo">Main menu » <? include"inc/menu.inc.php"; ?></div>
<div id="inhoud" class="foo">
<table width="75%" border="0">
<tr>
<td valign="top"> <br>
<table width="100%" border="0">
<tr>
<td width="18%"><table width="128" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="138"><img src="images/browse.gif" width="128" height="23"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<table width="112" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td>
<? require_once("categories.php"); ?>
</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><img src="images/newsleter.gif" width="124" height="17"></td>
</tr>
<tr>
<td><form method="post" action="mail.php" name=sb >
<br>
<table width="99" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="92"><input type=text name=nEmail size=10 value="email address">
</td>
<td width="213"><input type=submit name=smail value=Go!></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<td valign="top" width="82%"><?
require_once("inc/config.inc.php");
if(!empty($_GET[Start]))
{
$Start = $_GET[Start];
}
else
{
$Start = '0';
}
$ByPage = "5";
if(empty($_GET[SubcategoryID]))
{
$q1 = "select devbg_products.*, devbg_categories.*, devbg_subcategories.* from devbg_products
left join devbg_categories on devbg_products.ItemCategory = devbg_categories.CategoryID
left join devbg_subcategories on devbg_products.ItemSubcategory = devbg_subcategories.SubcategoryID
where devbg_products.ItemCategory = '$_GET[CategoryID]'
order by ItemName limit $Start, $ByPage";
$qnav = "select devbg_products.*, devbg_categories.*, devbg_subcategories.* from devbg_products
left join devbg_categories on devbg_products.ItemCategory = devbg_categories.CategoryID
left join devbg_subcategories on devbg_products.ItemSubcategory = devbg_subcategories.SubcategoryID
where devbg_products.ItemCategory = '$_GET[CategoryID]' ";
}
else
{
$q1 = "select devbg_products.*, devbg_categories.*, devbg_subcategories.* from devbg_products
left join devbg_categories on devbg_products.ItemCategory = devbg_categories.CategoryID
left join devbg_subcategories on devbg_products.ItemSubcategory = devbg_subcategories.SubcategoryID
where devbg_products.ItemCategory = '$_GET[CategoryID]' and
devbg_products.ItemSubcategory = '$_GET[SubcategoryID]'
order by ItemName limit $Start, $ByPage";
$qnav = "select devbg_products.*, devbg_categories.*, devbg_subcategories.* from devbg_products
left join devbg_categories on devbg_products.ItemCategory = devbg_categories.CategoryID
left join devbg_subcategories on devbg_products.ItemSubcategory = devbg_subcategories.SubcategoryID
where devbg_products.ItemCategory = '$_GET[CategoryID]' and
devbg_products.ItemSubcategory = '$_GET[SubcategoryID]' ";
}
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
$NoItems = "<center>There are no items at this category!</center>";
}
else
{
while($a1 = mysql_fetch_array($r1))
{
$MyPrice = number_format($a1[ItemPrice], 2, ".", "");
if(!empty($a1[ItemImage]))
{
$xy = getimagesize("items_images/$a1[ItemImage]");
$x = $xy[0];
$y = $xy[1];
$NewItemName = str_replace("'", "", $a1[ItemName]);
$DisplayImage = "<a href=\"javascript:ShowPic('items_images/$a1[ItemImage]', '$NewItemName', '$x', '$y');\"><img src=\"items_images/$a1[ItemImage]\" width=100 alt=\"$a1[ItemName]\" border=0 style=\"border-color:black\"></a>";
}
else
{
$DisplayImage = " ";
}
$DisplayCategory .= "
<table align=center width=300 border=0 rules=rows cellspacing=0 bordercolor=black>
<tr>
<td valign=top width=140>$DisplayImage</td>
<td width=160 valign=top>
<a class=\"ItemTitle\" href=\"ViewItem.php?ItemID=$a1[ItemID]\">$a1[ItemName]</a><BR>
<br>
<font color=black face=verdana size=1><b>Category: </b></font><a class=\"CategoryClass\" href=\"ShowCategory.php?CategoryID=$a1[ItemCategory]\">$a1[CategoryName]</a>";
if(!empty($a1[SubcategoryID]))
{
$DisplayCategory .= ", <a class=\"SubcategoryClass\" href=\"ShowCategory.php?CategoryID=$a1[ItemCategory]&SubcategoryID=$a1[ItemSubcategory]\">$a1[SubcategoryName]</a>";
}
$DisplayCategory .= "
<br>
<font color=red face=verdana size=2><b>Price: $$MyPrice</b></font>
<br><br>
<form method=post action=bestel.php style=\"margin:0\">
<input type=hidden name=ItemID value=\"$a1[ItemID]\">
<input type=hidden name=ItemName value=\"$a1[ItemName]\">
<input type=hidden name=ItemShipping value=\"$a1[ItemShipping]\">
<input type=hidden name=ItemPrice value=\"$MyPrice\">
<input type=submit name=s1 value=\"Bestel\" class=sub>
</form>
</td>
</tr>
</table><br><hr size=1 color=E3E3E3>";
}
//build the "next" - "prev" navigatioin
$rnav = mysql_query($qnav) or die(mysql_error());
$rows = mysql_num_rows($rnav);
if($rows > $ByPage)
{
$NextPrev = "<br><table align=center width=600>";
$NextPrev .= "<td align=center><font face=verdana size=2> | ";
$pages = ceil($rows/$ByPage);
for($i = 0; $i <= ($pages); $i++)
{
$PageStart = $ByPage*$i;
$i2 = $i + 1;
if($PageStart == $Start)
{
$links[] = " <span class=DNav>$i2</span>\n\t ";
}
elseif($PageStart < $rows)
{
$links[] = " <a class=Nav href=ShowCategory.php?Start=$PageStart&ByPage=$ByPage&CategoryID=$_GET[CategoryID]&SubcategoryID=$_GET[SubcategoryID]>$i2</a>\n\t ";
}
}
$links2 = implode(" | ", $links);
$NextPrev .= $links2;
$NextPrev .= "| </td>";
$NextPrev .= "</table><br>\n";
}
}
if(isset($NoItems))
{
echo $NoItems;
}
else
{
require_once("templates/ShowCategoryTemplate.php");
}
?> </td>
</tr>
</table>
<br>
<br>
<br>
</td>
</tr>
</table>
</div>
<div id="footer" class="foo">
<?php include_once"copyright.php"; ?>
<a href="http://www.webmasterstart.nl/link_in.php?id=3161"> Webmasterstart.nl
-Dé start voor webmasters!</a> </div>
</div>
</body>
</html>
<? } ?>