<table class="default_h" cellspacing="0" cellpadding="2">
   <td class="head" colspan="7" ><?php echo lang_insig_title; ?></td>
    <tbody>
 <?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                         # ||
|| #################################################################### ||
\*======================================================================*/
    if (!defined('INCLUDE_ME')){ 
die('access not allowed'); 
}    
$knife = $data['KNV-1_kills'];
$c4 = $data['DTN-4_kills'];
$grenade = $data['HG-2_kills'];      
$aInsig = array(
"smg" => "$g_smgkills",
"assault" => "$g_assaultkills",
"recon" => "$g_reconkills",
"medic" => "$g_medickills",
"pistol" => "$g_pistolkills",
"shotgun" => "$g_shotgunkills",
"time1" => "$data[playerPlaytime]",
"time2" => "$data[playerPlaytime]",
"time3" => "$data[playerPlaytime]",
"head2" => "$data[playerHeadshots]",
"knife2" => "$knife",
"grenade2" => "$grenade",
"vietnam" => "$g_vietnamkills",
"light" => "$g_vlightkills",
"heavy" => "$g_vheavykills",
"air" => "$g_vairkills",
"kills" => "$data[playerKills]",
"flame" => "$data[FLAMETHROWER_kills]",
"water" => "$g_vwaterkills",
"stat" => "$g_vstatkills",
"grenade" => "$grenade",
"head" => "$data[playerHeadshots]",
"knife" => "$knife",
"c4" => "$c4"
);


$i = 0;
$ii = 0;
$iii = 0;
foreach ($aInsig as $key => $ins){

	if ($key == 'smg' or $key == 'assault' or $key == 'recon' or $key == 'medic' or $key == 'shotgun' or $key == 'heavy' or $key == 'air' or $key == 'flame' or $key == 'head'){
		$needed = 500;
		$plus = '(+5000)';
 }elseif ($key == 'grenade2' or $key == 'knife2'){
		$needed = 500;
		$plus = '(+10000)';
 }elseif ($key == 'head2'){
		$needed = 1500;
		$plus = '(+10000)';
 }elseif ($key == 'light' or $key == 'water' or $key == 'stat'){
	  $needed = 200;
		$plus = '(+10000)';
 }elseif ($key == 'pistol' or $key == 'grenade' or $key == 'knife' or $key == 'c4'){
		$needed = 200;
		$plus = '(+5000)';
 }elseif ($key == 'vietnam'){
		$needed = 1500;
		$plus = '(+5000)';
 }elseif ($key == 'kills'){
		$needed = 10000;
		$plus = '(+10000)';
 }elseif ($key == 'time1'){
		$needed = 86400;
		$plus = '(+5000)';
 }elseif ($key == 'time2'){
		$needed = 172800;
		$plus = '(+5000)';
 }elseif ($key == 'time3'){
		$needed = 432000;
		$plus = '(+10000)';
}

$progress = ($ins * 100 / $needed);
$progressp = number_format($progress, 2, ',', '.');
	
if ($ins >= $needed){
	if ($data[$key.'_time'] == 0){
		 $awarded_time = '-----';
		}else{
	   $awarded_time = date("d-m-Y H:i:s",$data[$key.'_time']);
	 }
	
	$tooltip = "<img src=img/insignias/{$key}.png width=150px border=0 /><br />".constant($key.'_text')."<br />".insignia_awarded."<br />".$awarded_time."<br />";
	$img = "<img src=img/insignias/{$key}.png width=80px border=0 />	";
}else{
	if ($key == 'time1' or $key == 'time2' or $key == 'time3'){
		$needed = sprintf("%02dh",$needed/60/60);
	  $ins = sprintf("%02dh",$ins/60/60);
	}
	$tooltip = "<img src=img/insignias/{$key}.png width=150px border=0 /><br />".constant($key.'_text')."<br /><span class=sonstige>{$ins}/{$needed}</span><br />{$plus}<br /><center><div class=progress_weapon><div class=progress_size_weapon style=width:{$progress}% title={$progressp}%>&nbsp;</div></div></center><br />";
	$img = "<img class=inactive src=img/insignias/{$key}.png width=80px border=0 /><br />
	         <center><div class=progress_weapon style=height:7px;width:70px;>
      		    <div class=progress_size_weapon style=width:{$progress}%;max-width:69px;height:5px;  title={$progressp}%>&nbsp;</div>
				 </div>";
 }
	
	?>
	 <td class="result"><a onmouseover="Tip('<?php echo $tooltip; ?>',TITLE, '<?php echo constant('insignia_title_'.$key); ?>', WIDTH, 150, CENTERMOUSE, true, OFFSETX, 0, OFFSETY, 30, TEXTALIGN, 'center', OPACITY, 90)" onmouseout="UnTip() "><?php echo $img; ?></a></td>
	 	<?php
	 	if(++$i == 6)echo'<tr />';
	 	if(++$ii == 12)echo'<tr />';
	 	if(++$iii == 18)echo'<tr />';
}
?>
    </tbody>
   </table>

	