require_once("../database.php");
require_once("adminfuncties.php");
require_once("product_navigatie.php");
if(!empty($_GET[Start]))
{
$Start = $_GET[Start];
}
else
{
$Start = '0';
}
$ByPage = "10";
$q1 = "select oneshop_producten.*, oneshop_categories.*, devbg_subcategories.* from oneshop_producten
left join oneshop_categories on oneshop_producten.ItemCategory = oneshop_categories.CategoryID
left join devbg_subcategories on oneshop_producten.ItemSubcategory = devbg_subcategories.SubcategoryID
order by ItemName limit $Start,$ByPage";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "
Er zijn geen items aanwezig in de database...";
exit();
}
?>
Item nummer |
Item Naam |
Categorie / Sub-categorie |
Prijs |
$col = "white";
while($a1 = mysql_fetch_array($r1))
{
if($col == "white" )
{
$col = "#dddddd";
}
else
{
$col = "white";
}
$MyPrice = number_format($a1[ItemPrice], 2, ".", "");
echo "\n\t$a1[ItemID] | \n\t$a1[ItemName] | \n\t$a1[CategoryName]";
if(!empty($a1[SubcategoryName]))
{
echo " / $a1[SubcategoryName]";
}
echo " | \n\t$MyPrice | \n
\n\n";
}
echo "\n\n
\n\n";
$qnav = "select oneshop_producten.*, oneshop_categories.*, devbg_subcategories.* from oneshop_producten
left join oneshop_categories on oneshop_producten.ItemCategory = oneshop_categories.CategoryID
left join devbg_subcategories on oneshop_producten.ItemSubcategory = devbg_subcategories.SubcategoryID
order by ItemName ";
$rnav = mysql_query($qnav) or die(mysql_error());
$rows = mysql_num_rows($rnav);
echo "
";
echo " | ";
$pages = ceil($rows/$ByPage);
for($i = 0; $i <= ($pages); $i++)
{
$PageStart = $ByPage*$i;
$i2 = $i + 1;
if($PageStart == $Start)
{
$links[] = " $i2\n\t ";
}
elseif($PageStart < $rows)
{
$links[] = " $i2\n\t ";
}
}
$links2 = implode(" | ", $links);
echo $links2;
echo "| | ";
echo "
\n";
?>