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

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
       <title>BF3 LB / Skill/Kills</title>
       <?php echo $styleSettings; ?>
       <div class="body_bfLB" style="width:<?php echo $style['IndexDivWidth']; ?>px;">   
	           <?php echo $Banner; ?>
        <ul id="statstabs" class="shadetabs" style="margin-top:10px;margin-bottom:-10px;">
        <li><a href="../index.php">Leaderboard</a></li>
        <li><a href="class.php"><?php echo LANG_CLANSTATS_TAB_KITS; ?></a></li>
        <li><a href="skill.php" class="selected"><?php echo LANG_CLANSTATS_TAB_SKILL; ?></a></li>
        <li><a href="teamplay.php" >Teamplay</a></li>
        <li><a href="vehicles.php"><?php echo LANG_CLANSTATS_TAB_VEHICLES; ?></a></li>
        <li><a href="weaponstats.php"><?php echo LANG_CLANSTATS_TAB_WEAPONS; ?></a></li>
        <li><a href="ribbonsstats.php">Ribbons</a></li>
        <li><a href="medalsstats.php">Medals</a></li>
        <li><a href="events.php"> Events</a></li>
        <li><a href="serverHistory.php">S.History</a></li>
      </ul>
				<table class="default" style="width:<?php echo $style['IndexTableWidth']; ?>px;">
        <td class="head" colspan="13" cellspacing="0"><?php echo LANG_CLANSTATS_TITLE; ?></td>
        <tr>
        	<td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/skill.png" title="Skill" alt="skill" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>;"><?php echo LANG_CLANSTATS_POINTS_SKILL; ?></td>	
        	<?php
        	$qry = "SELECT soldiername,elo FROM ".DBPrefix."generalStats ORDER by elo DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	        <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points(round($data['elo'])); ?></div></td>
	         <?php
           }
?>
         </tr>
        <tr>
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/spm.png" title="Score per Minute" alt="spm" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_PPM; ?></td>
        	<?php
        	$qry = "SELECT soldiername,points / playtime AS pps FROM ".DBPrefix."generalStats ORDER by pps DESC LIMIT 5 ";
            $result = mysql_query($qry);
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$PPM = ($data['pps']*60);
            	$PPM = round($PPM);
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'. number_format($PPM, 0, ',', '.'); ?></div></td>
	         <?php
           }
?>
          </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/accuracy.png" title="Accuracy" alt="accuracy" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_ACCURACY; ?></td>
        	<?php
        	$qry = "SELECT soldiername,hits * 100 / shots AS accuracy FROM ".DBPrefix."generalStats ORDER by accuracy DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	        <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.number_format($data['accuracy'], 2, ',', '.'); ?>%</div></td>
	         <?php
           }
?>
      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/headshots.png" title="Headshots" alt="headshots" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_HEADSHOTS; ?></td>
        	<?php
        	$qry = "SELECT soldiername,headshots FROM ".DBPrefix."generalStats ORDER by headshots DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	        <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['headshots']); ?></div></td>
	         <?php
           }
?>
      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/longest_hs.png" title="Longest Headshot" alt="longest hs" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_L_HEADSHOTS; ?></td>
        	<?php
        	$qry = "SELECT soldiername,longesths FROM ".DBPrefix."generalStats ORDER by longesths DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.number_format($data['longesths'], 2, ',', '.'); ?>m</div></td>
	         <?php
           }
?>

      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/knife.png" title="Knife" alt="knife" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_KNIFE; ?></td>
        	<?php
        	$qry = "SELECT soldiername,wasK_kills FROM ".DBPrefix."generalStats JOIN ".DBPrefix."weapons ON stats_pid=pid ORDER by wasK_kills DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	        <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['wasK_kills']); ?></div></td>
	         <?php
           }
?>


      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/killstreak.png" title="Killstreak" alt="killstreak" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_KILLSTREAK; ?></td>
        	<?php
        	$qry = "SELECT soldiername,killstreakbonus FROM ".DBPrefix."generalStats ORDER by killstreakbonus DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['killstreakbonus']); ?></div></td>
	         <?php
           }
?>


      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/MVP.png" title="MVP" alt="mvp" width="40px"/></td>
        	<td class="result" width="20px"style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_MVP; ?></td>
        	<?php
        	$qry = "SELECT a.stats_pid,a.r16_count,b.soldiername FROM ".DBPrefix."ribbons a
        	          Left JOIN 
                      ".DBPrefix."generalStats b  ON a.stats_pid = b.pid
        	          ORDER by r16_count DESC LIMIT 5 ";  $result = mysql_query($qry);
        	          $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['r16_count']); ?></div></td>
	         <?php
           }
?>

      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/WL.png" title="WL" alt="wl" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_WL; ?></td>
        	<?php
        	$qry = "SELECT soldiername,wins,losses, wins / CASE WHEN losses = 0 THEN ( 1 ) ELSE losses END AS WL FROM ".DBPrefix."generalStats ORDER by WL DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->kd($data['wins'],$data['losses']); ?></div></td>
	         <?php
           }
?>

      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/ace.png" title="ACE" alt="ace" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_ACE; ?></td>
        	<?php
        	$qry = "SELECT a.stats_pid,a.r19_count,b.soldiername FROM ".DBPrefix."ribbons a
        	          Left JOIN 
                      ".DBPrefix."generalStats b  ON a.stats_pid = b.pid
        	          ORDER by r19_count DESC LIMIT 5 ";  $result = mysql_query($qry);
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['r19_count']); ?></div></td>
	         <?php
           }
?>

      </tr>
         <tr> 
           <td class="result" width="60px" height="70px"><img src="<?php echo $domain;?>/img/fav/big/nemesis.png" title="Nemesis" alt="nemesis" width="40px"/></td>
        	<td class="result" width="20px" style="border-right:<?php echo $style['result_border']; ?>"><?php echo LANG_CLANSTATS_POINTS_NEMESIS; ?></td>
        	<?php
        	$qry = "SELECT a.stats_pid,a.r14_count,b.soldiername FROM ".DBPrefix."ribbons a
        	          Left JOIN 
                      ".DBPrefix."generalStats b  ON a.stats_pid = b.pid
        	          ORDER by r14_count DESC LIMIT 5 ";
            $result = mysql_query($qry);
            $i = 0;
            while(($data = mysql_fetch_assoc($result)) !== FALSE ) {
            	$i++;
	         ?> 
	         <td class="result" width="100px" style="font-size:11px;"><a href="../stats.php?name=<?php echo rawurlencode($data['soldiername']); ?>" target="_self"><b><?php echo $EoT->nameTrimchars($data['soldiername']); ?></b></a><br /><br /><?php echo '<div class="text" style="width:'.$textwidth.'px">'.$EoT->points($data['r14_count']); ?></div></td>
	         <?php
           }
?>




      </td> 
		  </tr>
	</table>
	
	<?php  include_once '../inc/footer.php';
	       echo '</div>';


