<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><link rel="stylesheet" type="text/css" href="style.css"><body style="padding: 0 0;">
<?php
$pagecat = htmlEntities($_GET["cat"], ENT_QUOTES);
?>
<div class="box2 ap">
<center>
<div id="container"><ul id="tabnav">
<?php
if ($pagecat == "premium"){?>
	<li><a href="?cat=premium" class="active">Premium</a></li>
	<li><a href="?cat=characters">Characters</a></li>
	<li><a href="?cat=weapons">Weapons</a></li>
	<li><a href="?cat=itempacks">Itempacks</a></li>
	<li><a href="?cat=cfamas">Country Famas</a></li>
<?
$l_data = "prem";
}elseif ($pagecat == "characters"){?>
	<li><a href="?cat=premium">Premium</a></li>
	<li><a href="?cat=characters" class="active">Characters</a></li>
	<li><a href="?cat=weapons">Weapons</a></li>
	<li><a href="?cat=itempacks">Itempacks</a></li>
	<li><a href="?cat=cfamas">Country Famas</a></li>
<?
$l_data = "chars";
}elseif ($pagecat == "weapons"){?>
	<li><a href="?cat=premium">Premium</a></li>
	<li><a href="?cat=characters">Characters</a></li>
	<li><a href="?cat=weapons" class="active">Weapons</a></li>
	<li><a href="?cat=itempacks">Itempacks</a></li>
	<li><a href="?cat=cfamas">Country Famas</a></li>
<?
$l_data = "weapons";
}elseif ($pagecat == "itempacks"){?>
	<li><a href="?cat=premium">Premium</a></li>
	<li><a href="?cat=characters">Characters</a></li>
	<li><a href="?cat=weapons">Weapons</a></li>
	<li><a href="?cat=itempacks" class="active">Itempacks</a></li>
	<li><a href="?cat=cfamas">Country Famas</a></li>
<?
$l_data = "packs";
}elseif ($pagecat == "cfamas"){?>
	<li><a href="?cat=premium">Premium</a></li>
	<li><a href="?cat=characters">Characters</a></li>
	<li><a href="?cat=weapons">Weapons</a></li>
	<li><a href="?cat=itempacks">Itempacks</a></li>
	<li><a href="?cat=cfamas" class="active">Country Famas</a></li>
<?
$l_data = "countryfamas";
}else{
?>
	<li><a href="?cat=premium" class="active">Premium</a></li>
	<li><a href="?cat=characters">Characters</a></li>
	<li><a href="?cat=weapons">Weapons</a></li>
	<li><a href="?cat=itempacks">Itempacks</a></li>
	<li><a href="?cat=cfamas">Country Famas</a></li>
<?
$l_data = "prem";
}
?>
</ul>

<center><?php
try {
    	$dbhandle = new PDO("sqlite:wr-s.sqlite");
    	$sql = "SELECT id, iname, price, pic, desc FROM Items WHERE gruppe='$l_data' Order by iname ASC";
	$result = $dbhandle->query($sql);
	$rowarray = $result->fetchall(PDO::FETCH_ASSOC);
	echo "<table style='font-size:12;font-family:verdana'>";
	echo "<thead><tr>";
	echo "</tr></thead>";

	foreach($rowarray as $row)
	{
    		echo "<tr>";
    		echo "<td><form action='buy.php' method='post'><input type='hidden' name='item' value='$row[Id]'><input type='submit' value='BUY IT' style='Background-color: #6EC8FF; font-size: 16; font-weight: bold'/></form><span style='color:red;font-size: 12'>$row[price] NX</span></td>";
    		echo "<td><img src='img/$row[pic]' width='180px' height='100px'></td>";
    		echo "<td>Contains: <p>$row[desc]</p></td>";
    		echo "</tr>";
	}
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

echo "</table>";

?></center></div></td>
</body></html>