<?php
/*======================================================================*\
|| #################################################################### ||
|| # eGamers of Tomorrow Battlefield 3 Leaderboard                    # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernt werden                      # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------Teil des Bf3 Leaderboards von EoT-----------------# ||
|| #                      http://eot-clan.net                         # ||
|| #################################################################### ||
\*======================================================================*/
require_once ('../../inc/config.php');
require_once ('../../language/'.$row['language'].'.php');
session_start();
echo $styleSettings;

$_GET = security::escape($_GET);
$_POST = security::escape($_POST);

if(isset($_SESSION["username"]))
   {
        if ($_SESSION["id"] == 1){
   	?>

        <table class="default" style="width:790px;" cellspacing="0" cellpadding="0">
          <td class="head" colspan="12"><?php echo LANG_ADMIN_ADMINS_INSERT; ?></td>
           <tr>
           	<td class="result" style="border-right:0px solid #303030; font-size:12px;">
               <form action="edit.php" name="createuser" method="post">
            		<?php echo LANG_ADMIN_ADMINS_INSERT_NAME; ?>:&nbsp;<input name="username" maxlength="50" size="15" style="height:11px;" value="" />&nbsp;&nbsp;<br /><br />
            		<?php echo LANG_ADMIN_ADMINS_INSERT_PW; ?>:&nbsp;<input type="password" name="password" maxlength="50" style="height:11px;" size="15" /><br /><br />
            		<?php echo LANG_ADMIN_ADMINS_INSERT_PW1; ?>:&nbsp;<input type="password" name="password2" maxlength="50" style="height:11px;" size="15" /><br /><br />
            	<input type="submit" style="margin-left:147px;" name="createuser" onClick="return confirm('<?php echo LANG_ADMIN_ADMINS_INSERT_WARN; ?>')" class="inputbutton" value="<?php echo LANG_ADMIN_ADMINS_INSERT_CREATE; ?>">
            </form>
           </td> 
          </tr>
         </table>  

<?php } ?>

		 		<table class="default" style="width:790px;" cellspacing="0" cellpadding="0">
             <td class="head" colspan="12"><?php echo LANG_ADMIN_ADMINS; ?></td>
           <tr>
            <th style="border-right:1px solid #303030; font-size:12px;"><?php echo LANG_ADMIN_PLAYERS_DBID; ?></th>
             <th style="border-right:1px solid #303030;font-size:12px;"><?php echo LANG_ADMIN_ADMINS_NAME; ?></th>
             <th style="border-right:1px solid #303030;font-size:12px;"><?php echo LANG_ADMIN_ADMINS_EDIT; ?></th>
              <?php if ($_SESSION["id"] == 1){ ?><th style="border-right:0px solid #303030;font-size:12px;"><?php echo LANG_ADMIN_ADMINS_DELETE; ?></th><?php } ?>
            </tr>
		
		
	<?php		
   $query = "SELECT id,username FROM ".DBPrefix."login ORDER BY id ASC";
    $result = mysql_query($query);
    $menge = mysql_num_rows($result);
	while($data = mysql_fetch_assoc($result)){		
			
				?>
         <tr width="20px">
						<td class="result" style="border-right:1px solid #303030; font-size:12px;"><?php echo $data['id']; ?></td>
						 <td class="result" style="border-right:1px solid #303030;font-size:12px;"><?php echo htmlspecialchars($data['username']); ?></td>	
            <td class="result" style="border-right:1px solid #303030;font-size:12px;">
            	<?php if ($_SESSION["id"] == $data['id'] OR $_SESSION["id"] == 1){ ?>
            	<form action="edit.php" name="edituser" method="post">
            		<b>User:</b>&nbsp;<input name="username" maxlength="50" size="15" style="height:11px;" value="<?php echo $data['username']; ?>" />&nbsp;&nbsp;
            		<b>PW:</b>&nbsp;<input type="text" name="password" maxlength="50" style="height:11px;" size="15" value="Password" onfocus="if (this.type=='text') { this.value=''; this.type='password'; }"/>
            		<input type="hidden" value="<?php echo $data['id']; ?>" name="id" />
            	<input type="submit" name="edituser" onClick="return confirm('<?php echo LANG_ADMIN_ADMINS_WARN; ?>')" class="inputbutton" value="<?php echo LANG_ADMIN_ADMINS_EDIT; ?>">
            </form>
             <?php }else{ echo LANG_ADMIN_ADMINS_EDIT_RECHTE; }?>
            <td class="result" style="border-right:0px solid #303030;font-size:12px;">
             <?php if ($_SESSION["id"] == 1){ ?>
            <form action="edit.php" name="deleteuser" method="post" >
	             <input type="hidden" value="<?php echo $data['id']; ?>" name="id" />
	             <input type="hidden" value="<?php echo $data['username']; ?>" name="username" />
              <input type="submit" name="deleteuser" onClick="return confirm('<?php echo LANG_ADMIN_PLAYERS_DELETE_CHECK.htmlspecialchars($data['username']).LANG_ADMIN_PLAYERS_DELETE_CHECK_2; ?>')" class="inputbutton" value="<?php echo LANG_ADMIN_ADMINS_DELETE; ?>">
           </form>
          </td>
      <?php } ?>
<?php
        } 
         ?></table> 
<?php }else{
	?> 
	<?php echo $styleSettings; ?>
<title>Login error!!</title>
  <table class="defaultUpdate" style="width:470px; margin-left: -250px;margin-top: -100px;position: absolute;left: 50%;top: 50%;" border="0" cellspacing="0" cellpadding="4"><td>
<?php echo LANG_LOGIN_SESSION_ERROR; ?>
     </td>
    </table>
<?php
}
