<?php
/*======================================================================*\
|| #################################################################### ||
|| # EoT-Clan BF3 Leaderboard                                         # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernet werden                     # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # -----------------BF3 Leaderboard is a free Software--------------# ||
|| #                   http://eot-clan.net                            # ||
|| #################################################################### ||
\*======================================================================*/
require_once ('../inc/config.php');
require_once ('../language/'.$row['language'].'.php');

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

require_once ('../inc/details.query.php');
 
echo $styleSettings;




$medals_all = 0;
$iI = 0;
for ($i = 1; $i <= 50; ++$i){
	$sMedals = "m{$i}_count";
	$medals_all += $data[$sMedals];
	if($data["m{$i}_count"] > 0){
		++$iI;
	}
}




$aMedals = array("m1","m2","m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","m13","m14",
"m15","m16","m17","m18","m19","m20","m21","m22","m23","m24","m25","m26","m27","m28","m29","m30",
"m31","m32","m33","m34","m35","m36","m37","m38","m39","m40","m41","m42","m43","m44","m45","m46","m47","m48","m49","m50");

$rMedals = array(
"m1" => "<img src=".$domain."/img/ribbons/r1.png width='50px'/><br />".LANG_RIBBONS_TEXT_r1,
"m2" => "<img src=".$domain."/img/ribbons/r2.png width='50px'/><br />".LANG_RIBBONS_TEXT_r2,
"m3" => "<img src=".$domain."/img/ribbons/r3.png width='50px'/><br />".LANG_RIBBONS_TEXT_r3,
"m4" => "<img src=".$domain."/img/ribbons/r4.png width='50px'/><br />".LANG_RIBBONS_TEXT_r4,
"m5" => "<img src=".$domain."/img/ribbons/r5.png width='50px'/><br />".LANG_RIBBONS_TEXT_r5,
"m6" => "<img src=".$domain."/img/ribbons/r6.png width='50px'/><br />".LANG_RIBBONS_TEXT_r6,
"m7" => "<img src=".$domain."/img/ribbons/r7.png width='50px'/><br />".LANG_RIBBONS_TEXT_r7,
"m8" => "<img src=".$domain."/img/ribbons/r8.png width='50px'/><br />".LANG_RIBBONS_TEXT_r8,
"m9" => "<img src=".$domain."/img/ribbons/r10.png width='50px'/><br />".LANG_RIBBONS_TEXT_r10,
"m10" => "<img src=".$domain."/img/ribbons/r11.png width='50px'/><br />".LANG_RIBBONS_TEXT_r11,
"m11" => "<img src=".$domain."/img/ribbons/r12.png width='50px'/><br />".LANG_RIBBONS_TEXT_r12,
"m12" => "<img src=".$domain."/img/ribbons/r13.png width='50px'/><br />".LANG_RIBBONS_TEXT_r13,
"m13" => "<img src=".$domain."/img/ribbons/r14.png width='50px'/><br />".LANG_RIBBONS_TEXT_r14,
"m14" => "<img src=".$domain."/img/ribbons/r15.png width='50px'/><br />".LANG_RIBBONS_TEXT_r15,
"m15" => "<img src=".$domain."/img/ribbons/r16.png width='50px'/><br />".LANG_RIBBONS_TEXT_r16,
"m16" => "<img src=".$domain."/img/ribbons/r17.png width='50px'/><br />".LANG_RIBBONS_TEXT_r17,
"m17" => "<img src=".$domain."/img/ribbons/r18.png width='50px'/><br />".LANG_RIBBONS_TEXT_r18,
"m18" => "<img src=".$domain."/img/ribbons/r19.png width='50px'/><br />".LANG_RIBBONS_TEXT_r19,
"m19" => "<img src=".$domain."/img/ribbons/r20.png width='50px'/><br />".LANG_RIBBONS_TEXT_r20,
"m20" => "<img src=".$domain."/img/ribbons/r24.png width='50px'/><br />".LANG_RIBBONS_TEXT_r24,
"m21" => "<img src=".$domain."/img/ribbons/r25.png width='50px'/><br />".LANG_RIBBONS_TEXT_r25,
"m22" => "<img src=".$domain."/img/ribbons/r27.png width='50px'/><br />".LANG_RIBBONS_TEXT_r27,
"m23" => "<img src=".$domain."/img/ribbons/r26.png width='50px'/><br />".LANG_RIBBONS_TEXT_r26,
"m24" => "<img src=".$domain."/img/ribbons/r28.png width='50px'/><br />".LANG_RIBBONS_TEXT_r28,
"m25" => "<img src=".$domain."/img/ribbons/r29.png width='50px'/><br />".LANG_RIBBONS_TEXT_r29,
"m26" => "<img src=".$domain."/img/ribbons/r30.png width='50px'/><br />".LANG_RIBBONS_TEXT_r30,
"m27" => "<img src=".$domain."/img/ribbons/r31.png width='50px'/><br />".LANG_RIBBONS_TEXT_r31,
"m28" => "<img src=".$domain."/img/ribbons/r32.png width='50px'/><br />".LANG_RIBBONS_TEXT_r32,
"m29" => "<img src=".$domain."/img/ribbons/r33.png width='50px'/><br />".LANG_RIBBONS_TEXT_r33,
"m30" => "<img src=".$domain."/img/ribbons/r34.png width='50px'/><br />".LANG_RIBBONS_TEXT_r34,
"m31" => "<img src=".$domain."/img/ribbons/r40.png width='50px'/><br />".LANG_RIBBONS_TEXT_r40,
"m32" => "<img src=".$domain."/img/ribbons/r41.png width='50px'/><br />".LANG_RIBBONS_TEXT_r41,
"m33" => "<img src=".$domain."/img/ribbons/r42.png width='50px'/><br />".LANG_RIBBONS_TEXT_r42,
"m34" => "<img src=".$domain."/img/ribbons/r43.png width='50px'/><br />".LANG_RIBBONS_TEXT_r43,
"m35" => "<img src=".$domain."/img/ribbons/r44.png width='50px'/><br />".LANG_RIBBONS_TEXT_r44,
"m36" => "<img src=".$domain."/img/ribbons/r45.png width='50px'/><br />".LANG_RIBBONS_TEXT_r45);


?>
<title>Meldals</title>
<table class="default" cellspacing="0" cellpadding="5">
 <thead>
  <td class="head" colspan="10" cellspacing="0"> <?php echo $medals_all; ?> Medals / <?php echo $iI.LANG_RIBBONS_1.count($aMedals); ?> Medals <?php echo LANG_RIBBONS_2; ?></td>
	  <tr> 
<?php
$i = 0;
foreach ($aMedals as $medals){
	$i++;
	$EoT = new eGamersofTomorrow;
   if($data[$medals.'_count'] > 0){
	   $Medalsimg = '<img src='.$domain.'/img/medals/'.$medals.'.png width="50px"/>';
  }else{
	   $Medalsimg = '<img src='.$domain.'/img/medals/transparent/'.$medals.'.png width="50px"/>';
 }
 

 
$Medalsconstante = 'LANG_MEDALS_TEXT_'.$medals.'';
 
 if ($medals == "m50" OR $medals == "m49" OR $medals == "m48" OR $medals == "m47" OR $medals == "m46" OR $medals == "m45" OR $medals == "m44" OR $medals == "m43" OR $medals == "m42" OR $medals == "m41"){
    $needed = $EoT->time_H_M($data[''.$medals.'_curr']).'/'.$EoT->time_h($data[''.$medals.'_needed']);
  }else{
  	$needed = $data[''.$medals.'_curr'].'/'.$data[''.$medals.'_needed'];
  }
 
if ($data[''.$medals.'_count'] > 0){  
 	$date = LANG_MEDALS_DATE.$EoT->unix_to_time($data[''.$medals.'_date']);
 	$needed = '<div class=DIVtext>'.$needed.' Medal: '.($data[''.$medals.'_count']+1).'</div>'; 
 	}else{
 	$date = "";
 	$needed = '<div class=DIVtext>'.$needed.'</div>';
}
 
$tooltip = '<img src="'.$domain.'/img/medals/'.$medals.'.png" /><br />'.constant($Medalsconstante).'<br />'.$date.$needed;

  if ($data[$medals.'_count'] <= 1){
  	$count = '';
  }else{
  	$count = '<div style="position:absolute;margin-left:45px;margin-top:-13px;background-color:#000;width:35px;opacity:0.70;filter: alpha(opacity=70);-moz-opacity: 0.7;">'.$data[$medals.'_count'].'x</div>';
  }
	?>
<td class="result" width="90px">
	<a class="tooltip" href="#"><?php echo $Medalsimg; ?>
		<span style="margin-top:25px;margin-left:-85px;"><?php echo $tooltip; ?>
			<?php 
			   if ($i <=36){
			   	echo "<hr>"; 
			   	echo $rMedals[$medals]; 
			   } ?></span>
	</a><br /><?php echo $count; ?>
	 <?php 
	if ($data[$medals.'_count'] >= 1){
		$progress = (round($data[''.$medals.'_curr'])-($data[''.$medals.'_needed']/($data[$medals.'_count']+1))*$data[$medals.'_count'])*100/($data[''.$medals.'_needed']/($data[$medals.'_count']+1));
	}else{
	 	$progress = round($data[''.$medals.'_curr']) * 100 / $data[''.$medals.'_needed'];
	}
	 	?> <div class="progress_small">
	 		  <div class="progress_size_small" style="width:<?php echo $progress; ?>%">&nbsp;</div>
	 		 </div>
	 	</td> 

 	<?php    
      if ($i % 8 == 0) echo'<tr />';

 }
 ?>
   <td class="result" width="90px"></td>
   <td class="result" width="90px"></td>
   <td class="result" width="90px"></td>
   <td class="result" width="90px"></td>
   <td class="result" width="90px"></td>
   <td class="result" width="90px"></td>
 </table>

