<?php
/*======================================================================*\
|| #################################################################### ||
|| # EoT-Clan BC2 Leaderboard                                         # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernet werden                     # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # -----------------BC2 Leaderboard is a free Software--------------# ||
|| #                   http://eot-clan.net                            # ||
|| #################################################################### ||
\*======================================================================*/
if(!defined('DIRECTACCESS')){
echo 'You cannot access this file directly!';
die;
}

$premium = explode(',',$data['expansion']);
$prem = "";
if (is_array($premium)){
if (in_array('1024',$premium)){
	$prem = '<img src="img/premium.png" border="0" /><br />';
 }
}



?>
<div style="width:830px;height:380px;">
<div style="float:left;">
	<table class="default" style="float: left; width: 201px; height: 366px; margin-left: 8px;" cellspacing="0" cellpadding="0">
		<tr>
			<td class="head" colspan="5" style="height:20px;">
				<?php echo $EoT->nameTrimchars($data['soldiername']); ?>
			</td>
		<tr>
			<td class="result">
				   <?php echo $prem; ?>
					<img src="img/rank/big/P0<?php echo $data['rank']; ?>.png"/>
				<br />
				<span style="font-weight: bold;"><?php echo $EoT->rankname($data['rank']); ?><br/>Level (<?php echo $data['rank']; ?>)</span>
				<br /><br />
				<span class="text" style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;width:190px;">
				<?php echo LANG_GENERAL_PLAYTIME.'<b>'.$EoT->time_complete($data['playtime']).'</b>'; ?>
				</span>				
	<br /><br />
				<span class="text" style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;width:190px;">
				<?php echo LANG_GENERAL_INSERT_BF3STATS.$EoT->unix_to_time($data['date_insert_bf3s']); ?>
				</span>
	<br /><br />
				<span class="text" style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;width:190px;">
				<?php echo LANG_GENERAL_UPDATE_BF3STATS.$EoT->unix_to_time($data['date_update_bf3s']); ?>
				</span>
  <br /><br />
				<span class="text" style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;width:190px;">
				<?php echo LANG_GENERAL_CHECK_BF3STATS.$EoT->unix_to_time($data['date_check_bf3s']); ?>
				</span>
      <br />
      <br />
       <a href="<?php echo $data['battlelogurl'] ?>" target=_blank"><img src="img/battlelog-s.png" style="margin-top:8px;"/></a><a href="<?php echo $data['bf3statsurl'] ?>" target=_blank"><img src="img/pstats.png" style="margin-top:8px;margin-left:20px;"/></a>
			</td>
		</table>
	</div>
			 
			
<?php

  $alRibbon = array(
    "r1" => $data['r1_date'],
    "r2" => $data['r2_date'],
    "r3" => $data['r3_date'],
    "r4"  => $data['r4_date'],
    "r5"  => $data['r5_date'],
    "r6" => $data['r6_date'],
    "r7" => $data['r7_date'],
    "r8" => $data['r8_date'],
    "r9" => $data['r9_date'],
    "r10" => $data['r10_date'],
    "r11" => $data['r11_date'],
    "r12" => $data['r12_date'],
    "r13" => $data['r13_date'],
    "r14" => $data['r14_date'],
    "r15" => $data['r15_date'],
    "r16" => $data['r16_date'],
    "r17" => $data['r17_date'],
    "r18" => $data['r18_date'],
    "r19" => $data['r19_date'],
    "r20" => $data['r20_date'],
    "r21" => $data['r21_date'],
    "r22" => $data['r22_date'],
    "r23" => $data['r23_date'],
    "r24" => $data['r24_date'],
    "r25" => $data['r25_date'],
    "r26" => $data['r26_date'],
    "r27" => $data['r27_date'],
    "r28" => $data['r28_date'],
    "r29" => $data['r29_date'],
    "r30" => $data['r30_date'],
    "r31" => $data['r31_date'],
    "r32" => $data['r32_date'],
    "r33" => $data['r33_date'],
    "r34" => $data['r34_date'],
    "r35" => $data['r35_date'],
    "r36" => $data['r36_date'],
    "r37" => $data['r37_date'],
    "r38" => $data['r38_date'],
    "r39" => $data['r39_date'],
    "r40" => $data['r40_date'],
    "r41" => $data['r41_date'],
    "r42" => $data['r42_date'],
    "r43" => $data['r43_date'],
    "r44" => $data['r44_date'],
    "r45" => $data['r45_date']);
      
         arsort($alRibbon);
         $ribbons = array_keys($alRibbon);

      
      if ($data[$ribbons[0].'_date'] > 0){
         $Ribbonsconstante = 'LANG_RIBBONS_TEXT_'.$ribbons[0].'';
         $tooltip = '<img src=./img/ribbons/'.$ribbons[0].'.png /><br />'.constant($Ribbonsconstante).'<br />';
         $ribbonsDate = $EoT->unix_to_time($data[$ribbons[0].'_date']);
         $ribbonsIMG = '<img src=./img/ribbons/'.$ribbons[0].'.png width=90px />';
        }else{
          $tooltip = '<img src=./img/ribbons/transparent/r1.png /><br />'.LANG_RIBBONS_TEXT_NO_RIBBON.'<br />';
          $ribbonsDate = "";
          $ribbonsIMG = '<img src=./img/ribbons/transparent/r1.png width=90px />';
      }
      
      
      
      $alMedals = array(
    "m1" => $data['m1_date'],
    "m2" => $data['m2_date'],
    "m3" => $data['m3_date'],
    "m4"  => $data['m4_date'],
    "m5"  => $data['m5_date'],
    "m6" => $data['m6_date'],
    "m7" => $data['m7_date'],
    "m8" => $data['m8_date'],
    "m9" => $data['m9_date'],
    "m10" => $data['m10_date'],
    "m11" => $data['m11_date'],
    "m12" => $data['m12_date'],
    "m13" => $data['m13_date'],
    "m14" => $data['m14_date'],
    "m15" => $data['m15_date'],
    "m16" => $data['m16_date'],
    "m17" => $data['m17_date'],
    "m18" => $data['m18_date'],
    "m19" => $data['m19_date'],
    "m20" => $data['m20_date'],
    "m21" => $data['m21_date'],
    "m22" => $data['m22_date'],
    "m23" => $data['m23_date'],
    "m24" => $data['m24_date'],
    "m25" => $data['m25_date'],
    "m26" => $data['m26_date'],
    "m27" => $data['m27_date'],
    "m28" => $data['m28_date'],
    "m29" => $data['m29_date'],
    "m30" => $data['m30_date'],
    "m31" => $data['m31_date'],
    "m32" => $data['m32_date'],
    "m33" => $data['m33_date'],
    "m34" => $data['m34_date'],
    "m35" => $data['m35_date'],
    "m36" => $data['m36_date'],
    "m37" => $data['m37_date'],
    "m38" => $data['m38_date'],
    "m39" => $data['m39_date'],
    "m40" => $data['m40_date'],
    "m41" => $data['m41_date'],
    "m42" => $data['m42_date'],
    "m43" => $data['m43_date'],
    "m44" => $data['m44_date'],
    "m45" => $data['m45_date'],
    "m46" => $data['m46_date'],
    "m47" => $data['m47_date'],
    "m48" => $data['m48_date'],
    "m49" => $data['m49_date'],
    "m50" => $data['m50_date'],
    );
      
         arsort($alMedals);
         $medals = array_keys($alMedals);
      
      
       if ($data[$medals[0].'_date'] > 0){
         $Medalsconstante = 'LANG_MEDALS_TEXT_'.$medals[0].'';
         $tooltipM = '<img src=./img/medals/'.$medals[0].'.png /><br />'.constant($Medalsconstante).'<br />';
         $medalsDate = $EoT->unix_to_time($data[$medals[0].'_date']);
         $medalsIMG = '<img src=./img/medals/'.$medals[0].'.png width=90px />';
        }else{
          $tooltipM = '<img src=./img/medals/transparent/m1.png /><br />'.LANG_MEDALS_NO_MEDAL.'<br />';
          $medalsDate = "";
          $medalsIMG = '<img src=./img/medals/transparent/m1.png width=90px />';
      }
      
      
      $Fweapons = array_keys($aWeapons);
      
       if ($data[$Fweapons[0].'_kills'] < 100){
	  		$Star = '';
	  	}else{
	  	   $Star = '<div>
	  	             <img src="img/stars/stars_back.png" />
	  	             <div style="margin-left:'.marginStarsFav($data[$Fweapons[0].'_count']).'px;margin-top:-15px;position:absolute;font-size:11px">'.$data[$Fweapons[0].'_count'].'</div>
	  	            </div>
	  	  	      ';
	  }
      
      
       $WeaponsIMG = '<img src=./img/weapons/'.$Fweapons[0].'.png width=170px />';
       $WeaponsConstante = 'LANG_WEAPONS_'.$Fweapons[0].'';
       $tooltipW = '<b>'.constant($WeaponsConstante).'</b><br /><img src=./img/weapons/'.$Fweapons[0].'.png width=240px /><br /><div style=float:left;><b>'.LANG_WEAPONS_KILLS.'</b>:'.$EoT->points($data[$Fweapons[0].'_kills']).'</div><div style=float:left;margin-left:10px;><b>'.LANG_WEAPONS_TIME.'</b>:'.$EoT->time_complete($data[$Fweapons[0].'_time']).'</div><br /><div style=float:left;><b>'.LANG_WEAPONS_SHOTS.'</b>:'.$EoT->points($data[$Fweapons[0].'_shots']).'</div><div style=float:left;margin-left:10px;><b>'.LANG_WEAPONS_HITS.'</b>:'.$EoT->points($data[$Fweapons[0].'_hits']).'</div><br /><div style=float:left;><b>'.LANG_WEAPONS_HEADSHOTS.'</b>:'.$EoT->points($data[$Fweapons[0].'_headshots']).'</div>';
       
       
       $FavClass = $EoT->favclass($data['assault'],$data['recon'],$data['support'],$data['engineer']);
       $Favconstante = 'LANG_GENERAL_CLASS_'.strtoupper($FavClass);
       $TooltipFav = '<b>'.constant($Favconstante).'</b><br />'.LANG_GENERAL_POINTS.$EoT->points($data[$FavClass]).'<br />'.LANG_GENERAL_PLAYTIME.$EoT->time_complete($data[$FavClass.'_us']+$data[$FavClass.'_ru']);
 
 
       $FVehicles = array_keys($aVehicles);
 
 
       $VehiclesIMG = '<img src=./img/vehicles/'.$FVehicles[0].'.png width="170px" />';
       $VehiclesConstante = 'LANG_VEHICLES_'.$FVehicles[0].'';
       $tooltipV = '<b>'.constant($VehiclesConstante).'</b><br /><img src=./img/vehicles/'.$FVehicles[0].'.png width=240px /><br /><div style=float:left;><b>'.LANG_VEHICLES_KILLS.'</b>:'.$EoT->points($data[$FVehicles[0].'_kills']).'</div><div style=margin-left:10px;><b>'.LANG_VEHICLES_TIME.'</b>:'.$EoT->time_complete($data[$FVehicles[0].'_time']).'</div>';
 ?>			 
			  <div style="float:left;">
   <table class="default" style="width: 340px; height: 366px; margin-left: 9px;" cellspacing="0" cellpadding="0">
		<tr>
			<td class="head" style="height:20px;">
				<?php echo LANG_GENERAL_FAVORIT; ?>
			</td>
		</tr>
		<tr>
			<td class="result">
        <div style="margin-left:5px;margin-top:5px;position:absolute;"><?php echo LANG_GENERAL_LAST_RIBBON; ?><br />
        	<a onmouseover="Tip('<?php echo $tooltip; ?>',WIDTH, 200, TEXTALIGN, 'center', OFFSETY, -110)" onmouseout="UnTip()"><?php echo $ribbonsIMG; ?></a>	
         <br /><b><?php echo  $ribbonsDate; ?></b></div>
       
       <div style="margin-left:210px;margin-top:220px;position:absolute;"><?php echo LANG_GENERAL_LAST_MEDAL; ?><br />
         <a onmouseover="Tip('<?php echo $tooltipM; ?>',WIDTH, 200, TEXTALIGN, 'center', OFFSETY, 10)" onmouseout="UnTip()"><?php echo $medalsIMG; ?></a>
        <br /><b><?php echo  $medalsDate; ?></b></div>
        	
        	<div style="margin-left:160px;margin-top:5px;position:absolute;"><?php echo LANG_WEAPONS_FAV; ?><br />
        		<div style="float:left;margin-left:10px;position:absolute;margin-top:5px;"><?php echo $Star; ?></div>
        		<a onmouseover="Tip('<?php echo $tooltipW; ?>',WIDTH, 250, TEXTALIGN, 'center', OFFSETY, -240)" onmouseout="UnTip()"><?php echo $WeaponsIMG; ?></a>
        </div>
        
        <div style="margin-left:168px;margin-top:105px;position:absolute;"><?php echo LANG_VEHICLES_FAV; ?><br />
        	<a onmouseover="Tip('<?php echo $tooltipV; ?>',WIDTH, 250, TEXTALIGN, 'center', OFFSETY, -230)" onmouseout="UnTip()"><?php echo $VehiclesIMG; ?></a>
        </div>
        
        		
		       <a onmouseover="Tip('<?php echo $TooltipFav; ?>',WIDTH, 150, OFFSETY, 30)" onmouseout="UnTip()">
					<img src="img/fav/class/<?php echo $EoT->favclass($data['assault'],$data['recon'],$data['support'],$data['engineer']); ?>.png" style="float:left;margin-top:60px;width:250px;"/>
				   </a>

			</td>
		</tr>
	</table>
</div>

<div style="float:right;">
   <table class="default" style="width: 255px; height: 366px; margin-right: 8px;" cellspacing="0" cellpadding="0">
		<tr>
			<td class="head" style="height:20px;">
				<?php echo LANG_GENERAL_CLASSES; ?>
			</td>
		</tr>
		<tr>
			<td class="result">
				<img src="img/flags/big/us.png" title="us" alt="us" /><br /><hr>
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_TEAM_CLASSES; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo LANG_GENERAL_TEAM_US; ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_PLAYTIME; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['time_us']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_ASSAULT; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['assault_us']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_RECON; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['recon_us']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_SUPPORT; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['support_us']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_ENGINEER; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['engineer_us']); ?></span><br />
				<img src="img/flags/big/ru.png" title="ru" alt="ru" /><br /><hr>
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_TEAM_CLASSES; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo LANG_GENERAL_TEAM_RU; ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_PLAYTIME; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['time_ru']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_ASSAULT; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['assault_ru']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_RECON; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['recon_ru']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_SUPPORT; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['support_ru']); ?></span><br />
				<span  style="text-align:left; font-size:11px; line-height:11px; float:left; margin-left:5px;"><?php echo LANG_GENERAL_CLASS_ENGINEER; ?></span>
				<span  style="text-align:right; font-size:11px; line-height:11px; float:right; margin-right:5px;"><?php echo $EoT->time_complete($data['engineer_ru']); ?></span><br />
		  <hr>
		  <div style=width:250px;height:12px;>
		  	<b>Veteran (<?php $vet = explode(',',$data['veteran']); echo count($vet)-1;
		    echo ')</b>';
		    $i=0;
		        foreach ($vet as $v){
		        	++$i;
		        	  if ($v == 2 && $prem != ""){
		        	    $v = "prem";
		            }
		        ?>
		          <img style="<?php echo imargin($i); ?>margin-top:25px;" src="<?php echo $domain; ?>/img/veteran/<?php echo $v; ?>.png" />
		  	   <?php
		  	    }
		  	 ?>
		  	</div>
		</tr>
	</table>
</div>
</div>
			  
			  
	
<?php
function imargin($loop){
	if ($loop == 1){
	  $i = "float:left;margin-left:5px;";
	}elseif ($loop == 2){
		$i = "float:left;position:absolute;margin-left:-162px;";
  }elseif ($loop == 3){
		$i = "float:left;position:absolute;margin-left:-147px;";
	}elseif ($loop == 4){
		$i = "float:left;position:absolute;margin-left:-132px;";
	}elseif ($loop == 5){
		$i = "float:left;position:absolute;margin-left:-119px;";
  }elseif ($loop == 6){
		$i = "float:left;position:absolute;margin-left:-102px;";
	}elseif ($loop == 7){
		$i = "float:left;position:absolute;margin-left:-87px;";
	}elseif ($loop == 8){
		$i = "float:left;position:absolute;margin-left:-72px;";
	}elseif ($loop == 9){
    $i = "float:left;position:absolute;margin-left:-57px;";
	}elseif ($loop == 10){
	  $i = "float:left;position:absolute;margin-left:-42px;";
  }
  return $i;
}


 function marginStarsFav($count){
	if ($count >= 10 && $count <= 99){
		$return = 28;
	}else if ($count >= 100){
		$return = 25;
	}else{
		$return = 32;
	}
	
	return $return;
} 