<?php
$cat = $_GET['category'];
	if($_SESSION['id'] == "") {
		include('login.php'); }
		else {
		
		$coins = $_SESSION['coins'];
		
echo "<div class=\"contentBoxTop\"></div>
			<div class=\"contentBox\"><div class=\"innerBox\">
<table border=\"0\">
<tr><th width=\"200\">Imagine</th><th width=\"200\">Nume</th><th width=\"200\">Pret</th><th width=\"200\">Cumpara</th></tr>";
	$db	= "account";
	mysql_connect($dbhost, $dbuser, $dbpw) OR
	die("ERROR: Connection failed. ".mysql_error());		
	mysql_select_db($db) OR
	die("ERROR: DB allready open. ".mysql_error());
		
	$section = "SELECT * from itemshop WHERE cat = '$cat'";
		$query = mysql_query($section);
	$nums = mysql_num_rows($query);
		if($nums > 0)
		{
		
			
				while($fetch = mysql_fetch_object($query)) {
echo "<tr><th width=\"200\"><img src=\"images/items/$fetch->img.gif\"></th><th width=\"200\">$fetch->itemname</th><th width=\"200\">$fetch->coins MD</th><th width=\"200\"><a href=\"shopbuy.php?id=$fetch->id\">Cumpara!</a></th></tr>";
}
}
if($nums <= 0)
		{
	echo "<center>Nu exista obiecte atribuite acestei categorii</center>";
}
echo "</table></center><br></div></div><div class=\"contentBoxBottom\"></div><br>";
}

?>

