<?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 ('lang/language.php');
include_once ('lang/'.$lang_file);

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

if(isset($_GET['name']) && !empty($_GET['name']) && $_GET['name'] != '') {
	 $name = $_GET['name']; 
 }else{
	include ("error/error_players.html");
   exit;
}

	$query = "SELECT 
	           a.*, 
	           b.*, 
	           b.Kills / CASE WHEN b.Deaths = 0 THEN ( 1 ) ELSE b.Deaths END AS bfbcsKD,
	           c.*,
	           d.*,
	           e.*,
	           c.playerKills / CASE WHEN c.playerDeaths = 0 THEN ( 1 ) ELSE c.playerDeaths END AS KD
	          FROM 
	           tbl_playerdata a
            Left JOIN 
             tbl_bfbcs b ON a.PlayerID = b.bfbcsID
            Left JOIN 
             tbl_playerstats c ON a.PlayerID = c.StatsID
            Left JOIN
             tbl_weaponstats d ON a.PlayerID = d.WeaponStatsID
            Left JOIN 
             tbl_stars e ON a.PlayerID = e.stars_id
            WHERE 
             a.SoldierName = '{$name}'"; 
       
       
	$result = db_query($query);
	$entrys = mysql_num_rows($result);
	if ($entrys == 0){
		include ("error/error_players2.html");
		exit;
	}
 $data = mysql_fetch_assoc($result);
?>
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
				<head>
					<title>Spielerstats--<?php echo htmlspecialchars($data['SoldierName']) ?></title>
	         <link rel="stylesheet" type="text/css" href="css/fancybox.css" media="screen">
	        <link rel="stylesheet" type="text/css" href="css/style.css" /> 
	      </head>
	       <body>
	          <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	           <script type="text/javascript" src="js/jquery.fancybox-1.3.1.js"></script>
	           <script type="text/javascript" src="js/jquery.tablesorter.js"></script>
	          <script type="text/javascript" src="js/wz_tooltip.js"></script>
	       </body> 
		<div class="body_leaderboard_viewer">
		<?php if ($Banner == 1){ ?>
			<a href="statistics.php" target="_blank"><img src="img/banner/logo.jpg" style="margin-top:8px" border="0" /></a>
		<?php } ?>
		
		<table class="default_h" cellspacing="0" cellpadding="0" style="margin-top:12px;">
     <td class="head" colspan="2" cellspacing="0"><a href="index.php" target="_self"><span style="float:left;margin-left:5px;"><?php echo lang_index_startseite; ?></span></a>
     	<a href="ministats.php?name=<?php echo urlencode($data['SoldierName']); ?>&lang=english">
				<img src="lang/img/en.png" width="16" border="0" alt="Language" style="margin-left:5px;float:left;">
					</a>
				   <a href="ministats.php?name=<?php echo urlencode($data['SoldierName']); ?>&lang=german">
				<img src="lang/img/de.png" width="16" border="0" alt="Language" style="margin-left:5px;float:left;">
					</a>
     	<?php echo lang_stats_mini_stats; ?> <?php echo htmlspecialchars($data['SoldierName']); ?></td>
      <tr>
    
<?php
define('INCLUDE_ME', true);
		include_once ('inc/weapons_array.php');
		include_once ('inc/weapons_S.php');	
	     include_once('templates/statsT.php'); 
	     if ($awards == 1){ include_once('templates/lastaward.php'); }
	     include_once('templates/insiginias.php');
	     include_once('templates/gadgets.php');
	     include_once('templates/vehicles.php');
	     include_once('templates/weapons.php');
	     include_once ("inc/footer.php");
	   ?>
	    <br />
     </div>
    <br />
   <br />

	