<?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);
$EoT = new eGamersofTomorrow;

if(isset($_SESSION["username"]))
   {


  

   


 ?>
 
<div style="border-bottom:1px solid #303030;height:30px;"> 
<form action="update.php" method="post" ><div style="width:250px;position: absolute; margin-top: 5px;text-align:left;"><?php echo LANG_ADMIN_SETTINGS_PLAYERS_BATTLEREPORTS; ?></div>
  <select name="battlereports" style="font-size:11px;width:156px;">
   <?php echo $EoT->errorReport($row['battlereports']); ?>
  </select>  
 <input type="submit" onClick="return confirm('<?php echo LANG_ADMIN_SETTINGS_PLAYERS_UPDATE_BATTLEREPORTS_WARN; ?>')" class="inputbutton" value="<?php echo LANG_ADMIN_GENERAL_EDIT; ?>">
</form></div>

<?php 
    if ($row['battlereports'] == 1){
        $sSql = "SELECT COUNT(ReportID) AS count FROM ".DBPrefix."battlereportsDetails";
        $result = mysql_query($sSql);
        $data = mysql_fetch_assoc($result);
   
        $sql = "SHOW TABLE STATUS FROM `".$db."` LIKE '".DBPrefix."battlereportsDetails'";
        $Rresult = mysql_query($sql);
        $size = mysql_fetch_assoc($Rresult);

       ?>
       
       <div style="border-bottom:1px solid #303030;height:30px;"> 
      <form action="update.php" method="post" ><div style="width:650px;position: absolute; margin-top: 5px;text-align:left;"><b>Max.</b>
          <input style="color:<?php echo $row['vip_color'];?>;text-align: center;background:transparent;border:1px solid <?php echo $style['table_border_color']; ?>; width:30px;" name="max_Reports" value="<?php echo $row['max_Reports']; ?>"/> <?php echo LANG_ADMIN_SETTINGS_REPORTS_MAX_R; ?>
          <input type="submit" onClick="return confirm('<?php echo LANG_STYLE_INDEX_GENERAL_WARN; ?>')" class="inputbutton" value="<?php echo LANG_STYLE_SEND; ?>">
         </form></div>
        </div>
         
         
         <div style="border-bottom:1px solid #303030;height:30px;"> 
         	<div style="width:350px;position: absolute; margin-top: 5px;text-align:left;"><?php echo LANG_ADMIN_SETTINGS_REPORTS_ENTRYS; ?> <span class="DIVtext"><?php echo $data['count']; ?></span></div>
         </div>

         <div style="border-bottom:1px solid #303030;height:30px;"> 
         	<div style="width:350px;position: absolute; margin-top: 5px;text-align:left;"><?php echo LANG_ADMIN_SETTINGS_REPORTS_MB; ?> <span class="DIVtext"><?php echo format_size($size['Data_length']); ?></span></div>
         </div>

         <div style="border-bottom:1px solid #303030;height:30px;"> 
         	<div style="width:350px;position: absolute; margin-top: 5px;text-align:left;"><?php echo LANG_ADMIN_SETTINGS_REPORTS_MAX_MB; ?> <span class="DIVtext"><?php echo format_size($size['Max_data_length']); ?></span></div>
         </div>

              
      <?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
}

function format_size($size) {
	
if($size >= 1125899906842624) { return round(($size / 1125899906842624), 2) . "PB"; }
elseif($size >= 1099511627776) { return round(($size / 1099511627776), 2) . "TB"; }
elseif($size >= 1073741824) { return round(($size / 1073741824), 2) . "GB"; }
elseif($size >= 1048576) { return round(($size / 1048576), 2) . "MB"; }
elseif($size >= 1024) { return round(($size / 1024), 2) . " KB"; }
else { return $size . " Byte"; }

}

