<?php
/*======================================================================*\
|| #################################################################### ||
|| # EoT-Clan BC2 Server Stats                                        # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernt werden                      # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # -----------------BC2 Server Stats is a free Software-------------# ||
|| #                      http://eot-clan.net                         # ||
|| #################################################################### ||
\*======================================================================*/
require_once ('inc/config.php');
include_once ('lang/language.php');
include_once ('lang/'.$lang_file);
include_once ('gameserver/BC2Conn.php');
include_once ('inc/rankname.php');

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

    $iS = count($aServerips);
 
   if(isset($_GET['serverID']) && !empty($_GET['serverID']) && $_GET['serverID'] != '' && $_GET['serverID'] <= $iS) {
      $sID = $_GET['serverID']; 
  }else{
      $sID = 1;
}
	
    $sIP = $aServerips[$sID-1]['ip'];
    $sQPORT = $aServerips[$sID-1]['qport'];

$BC2Conn = new BC2Conn($sIP,$sQPORT);
if (!$BC2Conn->isConnected()) {
    include ("error/error_server.html");
    exit;
  }else{
    include ("gameserver/arserver.php");
?>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
   <head>
   	     <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	       <script type="text/javascript" src="js/jquery.tablesorter.js"></script>
		    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
		   <title>Server Viewer BC2</title>
		 <link rel="stylesheet" type="text/css" href="css/style.css" />  
   <div class="body_ministats">
			<table class="default_m" style="margin-top:12px;width:795px;" cellspacing="0" cellpadding="0">
					<td class="head" colspan="2">
					<?php echo server_info; ?>: <?php echo htmlspecialchars($ServerName) ?>
					</td>
				</tr>
			</table>
			<div style="float:left;">
		<table class="default_m" style="float: left; width: 190px; height: 210px; margin-left: 8px;margin-top:5px;" cellspacing="0" cellpadding="0">
		  <tr>
		    <td class="head"><?php echo server_info; ?>
		  </td>
	 </tr>
		 <tr>			
      <td class="result">
      	 <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_status; ?>:</span><span class="online" style="text-align:left;float:left;font-size:11px;"> Online </font></span><br />
          <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_version; ?>:<?php echo  $sVersion ?></span><br />
          <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;">Gameversion:<?php echo  $gameversion ?></span><br />
           <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_ip; ?>:<?php echo  $BC2Conn->getServerIP() ?></span><br />
            <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_player; ?>:</span><span class="sonstige" style="text-align:left;float:left;font-size:11px;"> <?php echo $aServerSettings[2];  ?>/<?php echo $aServerSettings[3];  ?></font></span><br />
           <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_modus; ?>: <?php echo $Gamemod;  ?></span><br />
          <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_map; ?>: <?php echo $Mapname; ?></span><br />
         <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_round; ?>: <?php echo $aServerSettings[6]; ?>/<?php echo $aServerSettings[7]; ?></span><br />
       <?php if ($BC2Conn->getVersionID() >= '617877'){ ?>
         <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_server_runtime; ?><?php echo $serveruptime; ?></span><br />
         <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_map_runtime; ?><?php echo $Mapruntime; ?></span><br />
         <span style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo server_setting; ?></span><span style="margin-left:7px;float:left;">
         	<img src="img/<?php echo $passwort; ?>.png" border="0" title="<?php echo $passwortt ?>" alt="PW"/>
         	<img src="img/<?php echo $ranked; ?>.png" border="0" title="<?php echo $rankedt ?>" alt="Ranked"/>
         	<img src="img/<?php echo $punkbuster; ?>.png" border="0" title="<?php echo $punkbustert ?>" alt="PB" />
         	<img src="img/<?php echo $Hardcore; ?>.png" border="0" title="<?php echo $Hardcoret ?>" alt="Hardcore" />
         </span><br />
       <?php } ?>
       </td>
		  </tr>
    </table>
  </div>
<div style="float:right;margin-right:8px;">
       <table class="default_m" cellspacing="0" cellpadding="0" style="float:left;width:595px;height: 210px;margin-left:8px;margin-top:5px;">
         <td class="head" colspan="5"><?php echo server_map_img; ?></td>
          <tr> 
	         <td class="result"><img src="img/mapsbig/<?php echo $Map ?>.jpg" border="0" /></td>
       </tr>
    </table>
  </div>
    
    
  <?php
  
       if ($BC2Conn->getCurrentPlaymode() == 'SQDM'){
         include ("gameserver/sqdm.php");
      }else{
         include ("gameserver/cq_ru.php");
    }
	}
    include_once ("inc/footerm.php");
			?>
			
	  <br /> 
	 </div>
	</body>
</html>

    <script type="text/javascript">
 $(document).ready(function() { 
    $("table").tablesorter({ 
        headers: { 
            0: { 
                sorter: false 
            },
            6: { 
                sorter: false 
            }
        } 
    }); 
});
</script>