<?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                            # ||
|| #################################################################### ||
\*======================================================================*/
if(!defined('DIRECTACCESS')){
echo 'You cannot access this file directly!';
die;
}

$ribbon_all = 0;
for ($i = 1; $i <= 45; ++$i){
	$sRibbon = "r{$i}_count";
	$ribbon_all += $data[$sRibbon];
}


if ($data['rounds'] == 0){
$dRibbons = 0;
} else {
$dRibbons = number_format($ribbon_all/$data['rounds'], 2, ',', '.');
}

$aRibbons = array("r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","r13","r14",
"r15","r16","r17","r18","r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29","r30",
"r31","r32","r33","r34","r35","r36","r37","r38","r39","r40","r41","r42","r43","r44","r45");
$i = 0;
$iall = 0;
foreach ($aRibbons as $ribbons){
	if($data[$ribbons.'_count'] > 0){
		++$i;
	}
	$ribbons;
	++$iall;
}

?>
     <ul id="m_rtabs" class="shadetabs" style="margin-top:10px;">
        <li><a href="#" rel="#default" class="selected">Ribbons</a></li> 
        <li><a href="module/medals.php?name=<?php echo rawurlencode($data['soldiername']); ?>" rel="classcontainer">Medals</a></li>
      </ul>

       <div id="m_rcontainer" style="width:814px; margin-top:-17px; padding: 7px">
      <table class="default" cellspacing="0" cellpadding="5">
  <td class="head" colspan="10" cellspacing="0"> <?php echo $ribbon_all; ?> Ribbons / &oslash; <?php echo $dRibbons.LANG_RIBBONS_PR; ?>&nbsp;&nbsp;<?php echo $i.LANG_RIBBONS_1.$iall; ?> Ribbons <?php echo LANG_RIBBONS_2; ?>
	 </td>
	  <tr>
<?php


$i=0;
foreach ($aRibbons as $ribbons){
	$i++;
   if($data[$ribbons.'_count'] > 0){
	   $Ribbonsimg = '<img src=./img/ribbons/'.$ribbons.'.png width="90px"/>';
  }else{
	   $Ribbonsimg = '<img src=./img/ribbons/transparent/'.$ribbons.'.png width="90px"/>';
 }
 
 
$Ribbonsconstante = 'LANG_RIBBONS_TEXT_'.$ribbons.'';
  if ($data[''.$ribbons.'_count'] > 0){
  	  $date =  LANG_RIBBONS_COUNT.$EoT->unix_to_time($data[''.$ribbons.'_date']); 
  }else{
  	  $date = "";
 }
 
 $tooltip = '<img src="./img/ribbons/'.$ribbons.'.png" /><br />'.constant($Ribbonsconstante).'<br />'.$date;
 
 if ($data[$ribbons.'_count'] <= 1){
  	$count = '';
  }else{
  	$count = '<div style="position:absolute;margin-left:45px;margin-top:-13px;background-color:#000;width:45px;opacity:0.80;filter: alpha(opacity=80);-moz-opacity: 0.8;">'.$data[$ribbons.'_count'].'x</div>';
  }
 
 ?>
    <td class="result" width="90px">
    	 <a class="tooltip" href="#"><?php echo $Ribbonsimg; ?>
    	 	<span style="margin-top:25px;margin-left:-85px;z-index:1000;">
    	 	 <?php echo $tooltip; ?>
    	  </span>
    	 </a><?php echo $count; ?>
	  </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>
 </table>
</div>

<script type="text/javascript">
var countries=new ddajaxtabs("m_rtabs", "m_rcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
