<!--
/*======================================================================*\
|| #################################################################### ||
|| # 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                         # ||
|| #################################################################### ||
\*======================================================================*/
-->
<table class="default_h" id="vehicles" cellspacing="0" cellpadding="2">
     <thead>
       <td class="head" colspan="7" ><?php echo lang_stats_mini_vehicles; ?></td>
     <tr>
     	   <th width="120px"><?php echo lang_details_pic; ?></th>
			     <th width="120px"><?php echo lang_details_stars; ?></th>
			      <th><?php echo lang_details_progress; ?></th>
				   <th width="100px"><?php echo lang_kills; ?></th>
				     <th width="100px"><?php echo lang_deaths; ?></th>
				    <th width="100px"><?php echo lang_stats_head; ?></th>
				   <th width="115px"><?php echo lang_stats_headpro; ?></th>
			</tr>
       </thead> 
        <tbody> 
        	<?php
if (!defined('INCLUDE_ME')){ 
die('access not allowed'); 
}
foreach($aVehicles  as $vehicles){
$avehicles =  $data[$vehicles.'_kills'];
$vehicles_array[$vehicles] = $avehicles;
}
arsort($vehicles_array);

$allkills = 0;
foreach ($vehicles_array as $kills){
$allkills += $kills;
}

	foreach ($vehicles_array as $key => $vehicles){
			if($data[$key.'_kills'] > 0){
 
	if ($data[$key.'_kills'] > 0){
			$hpro = number_format($data[$key.'_hs']*100/$data[$key.'_kills'], 2, '.', '.').'&#37;';
		}else{
			$hpro = '0.00&#37;';
		}
		
		
		include('inc/stars_weapon.php');
		
$tooltip = '<img src=img/weapons/'.$key.'.png border=0 width=300px><p class=sonstige style=text-align:left;margin-left:5px;>'.$needB.$needS.$needG.$needP.'</p></span></a>';

if ($allkills > 0){
      	$prozent = number_format($data[$key.'_kills']*100/$allkills, 2, '.', '.');
      	$progress = $data[$key.'_kills']*100/$allkills;
      }else{
      	$prozent = 0;
      	$progress = 0;
      }
   ?>
     <tr class="hov">	
      	<td class="result"><a onmouseover="Tip('<?php echo $tooltip; ?>',TITLE, '<?php echo $aWeaponsName[$key]; ?>', WIDTH, 300, CENTERMOUSE, true, OFFSETX, 0, OFFSETY, 30, TEXTALIGN, 'center', OPACITY, 97)" onmouseout="UnTip() "><img src="img/weapons/<?php echo $key; ?>.png" width="70px" border="0" /><br /><?php echo $aWeaponsName[$key]; ?></a></td>
        	<td class="result"><?php echo $bron.$silv.$count.$gold.$plat; ?></td>
        	<td class="result">
        	<div class="progress_weapon">
      		<div class="progress_size_weapon" style="width:<?php echo $progress; ?>%;" title="<?php echo $prozent; ?>%">&nbsp;</div>
							</div></td>
        	  <td class="result"><?php echo number_format($data[$key.'_kills'], 0, ',', ' '); ?></td>
        	  <td class="result"><?php echo number_format($data[$key.'_deaths'], 0, ',', ' '); ?></td>
        	 <td class="result"><?php echo number_format($data[$key.'_hs'], 0, ',', ' '); ?></td>
        	<td class="result"><?php echo $hpro; ?></td>
        <tr>
   <?php
   
      }      
   }	
        	
        	
        	
   ?>
      </table>
 </tbody>
 <script type="text/javascript">
     $(document).ready(function() { 
    	jQuery.tablesorter.addParser({
  id: "commaDigit",
  is: function(s, table) {
    var c = table.config;
    return $.tablesorter.isDigit(s.replace(/[,. ]/g, ""), c);
  },
  format: function(s) {
    return $.tablesorter.formatFloat(s.replace(/[,. ]/g, ""));
  },
  type: "numeric"
});
    $("#vehicles").tablesorter({ 
        headers: { 
            0: {   
                sorter: false 
            }
        } 
     
    }); 
});
 </script>  	