<?

require 'inc/settings.php';
require 'inc/check.php';

if (!session_id()){
	session_start();
	$_SESSION['user'];
	$_SESSION['id'];
}

if ( $username_session ) {

mysql_select_db ( 'account' );

$username_session = $_SESSION['user'];
$id_session = $_SESSION['id'];

$usersql = mysql_query("SELECT * FROM account WHERE login = '".$username_session."' AND id = '".$id_session."' LIMIT 1");
$myrow = mysql_fetch_assoc($usersql);

$gold = $myrow['monete'];



header("Content-Type: text/html; charset=ISO-8859-1");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//IT" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Item Shop</title>
<link rel="shortcut icon" href="http://www.toplight2.at/homepage/itemshop/icon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/jScrollPane.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.badBrowser.js"></script>
</head>
<body class="twoColFixLtHdr it">
<div id="container">
<div id="header">
<div class="boxCoins">
<div class="values">
<div class="coinsDesc">Münzen zur Verfügung: <span class="coinsValue"><?php echo $gold ?></span><img src="img/mini.png" class="coinsDescImg" width="17" height="17"></div>
</div>
<a href="index.php?page=kaufe" class="purchaseButton" title="Jetzt neue Münzen aufladen">Jetzt neue Münzen aufladen</a>
</div>
<ul id="breadcrumb">
<li>Willkommen <?php echo $username_session;?></li>
<li>/ <a href="index.php?page=Logout" title="Logout">Logout</a></li>
</ul>
 </div>
<div id="sidebar1">
<div id="search">
<form name="searchForm" action="#" method="post" id="searchForm">
<input name="searchString" value="im Aufbau" id="searchInput" class="type" maxlength="100" type="text">
<input value="" class="send" type="submit">
</form>
</div>
<br class="clearfloat">
<ul id="mainMenu">
<li><a class='active' href='index.php?page=start'>Start</a></li>
<?
mysql_select_db ( 'shop' );

$query = mysql_query ( "SELECT * FROM categorie WHERE nome NOT LIKE 'Start' ORDER BY id DESC" );

while ( $check = mysql_fetch_array ( $query ) ) {
$ids = $check['id'];
$nume = $check['nome'];
$id_categoria = $check['id_cate'];
echo "<li><a href='index.php?page=Kategorie&id=$id&cat=$id_categoria'>$nume</a></li>";

}
?>
</ul>
<br class="clearfloat">
</div>
<?
$get_id = escape ( $_GET['cat'] );
$titolo = mysql_query ( "SELECT * FROM categorie WHERE id_cate='$get_id'" );

if ( $titas = mysql_fetch_array ( $titolo ) ) {

$s_t = $titas ['nome'];

} else {
$s_t = "Item-Shop";
}
?>
<div id="mainContent">
<div class="headline">
<h1><div class="float-left"><?=$s_t?></div></h1>
</div>
<div class="dynContent">
<div class="scroll-pane" id="pane">
<?
$a = $_GET['page'];

if ( isset ( $_GET['page'] ) ) {

if ( file_exists ( "page/$a.php" ) ) {

include ( "page/$a.php" );

} else {

echo "<meta http-equiv='refresh' content='1; URL=index.php?page=Kategorie&id=1&cat=start'>";

}

}

if ( !isset ( $_GET['page'] ) ) {

echo "<meta http-equiv='refresh' content='1; URL=index.php?page=start'>";

}



}
?>