<?php
	$nebeneinander = 2;
	$counter = 0;
	$active_page = !empty($_GET['page']) ? $_GET['page'] : 1;
?>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="34%"><div id="s1">
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
<?php
	if ($_SESSION['user_eingeloggt'])
				{
				
				$get_money = mysql_query("SELECT gamecash FROM global_users WHERE gameuser = '".$_SESSION['username']."' LIMIT 1");
				$row_money = mysql_fetch_array($get_money);
				$aktmoney = $row_money['gamecash'];
				
				$redate = explode(" ",$_SESSION['since']);
				
				$formatted_cash = number_format($aktmoney, 0, '.', '.' );
?>
		<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><strong>Logged in as <?php echo $_SESSION['username']; ?></td>
        </tr>
		</table>
		</strong><hr width="80%" size="1" />
		<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr class="login">
          <td width="40%">Cash:</td>
          <td width="60%" align="right"><img src="gfx/content/g-pip12px.png" width="10" height="10" /> <?php echo $formatted_cash; ?></td>
        </tr>
        <tr class="login">
          <td>User since:</td>
          <td align="right"><?php echo $redate[0]." ".$redate[1]." ".$redate[2]; ?></td>
        </tr>
		</table>
		</strong><hr width="80%" size="1" />
		<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
<?php 
		if($_SESSION['level'] > 7)
			{
?>
			<tr>
			<td>&nbsp;</td>
			<td align="right"><a href="./admin/">AdminPanel</a></td>  
			</tr>
<?php			
			}
?>	
        <tr>
		<td><a href="index.php?show=editprofile">Edit Profile</a></td>
         <td align="right"><a href="action.php?action=logout&site=<?php echo $_GET['show']; ?>">Logout</a></td>  
        </tr>
      </table><br><br>
<?php
				} else {
?>
      <form id="form1" name="form1" method="post" action="action.php?action=login&site=<?php echo $_GET['show']; ?>">
        <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td class="login">Username:</td>
          </tr>
          <tr>
            <td><label>
              <input name="loginname" type="text" class="input" id="username" size="35" />
            </label></td>
          </tr>
          <tr>
            <td class="login">Password:</td>
          </tr>
          <tr>
            <td><input name="loginpass" type="password" class="input" id="password" size="35" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				<td>&nbsp;&nbsp;
              <input type='submit' name='login' value='' class='login_bgImage' />
              </form> &nbsp;&nbsp;&nbsp;</td>
			<td>
			  <form id="form2" name="form2" method="post" action="index.php?show=forgotPW">
			  <input type='submit' name='login' value='' class='getpw_bgImage' /></form></td>
			</tr>
		</table></td>
          </tr>
        </table>
      <br>
<?php
				}
include('serverstatus.php');
?>
    </div></td>
    <td width="66%" align="left" valign="top">


	<table width="515" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="368" align="left" valign="top" background="gfx/content/edit_profile_bg.png">
        
        <div id="edit_profile">
<?php
				echo $_SESSION['sessionerror'];
				unset($_SESSION['sessionerror']);
?>
          <form name="form2" method="post" action="action.php?action=requestpassword">
            <table width="80%" border="0" align="center" cellpadding="0" cellspacing="3">
              <tr>
                <td align="center"><strong>Request Password<br>
                </strong>
                  <hr size="1">
                  <strong>                  </strong></td>
              </tr>
              <tr>
                <td align="center">Enter a Valid Emailadress:</td>
              </tr>
              <tr>
                <td align="center"><input name="requestmail" type="text" class="input" id="requestmail" size="35"></td>
                </tr>
              <tr>
                <td align="center"><input name="button" type="submit" class="input" id="button" value="Request Password"></td>
              </tr>
            </table>
          </form>


        </div>
        
        </td>
      </tr>
    </table>
	
	</td>
  </tr>
</table>