<table class="default_h" cellspacing="0" cellpadding="2">
   <td class="head" colspan="8" ><?php echo lang_last_awards; ?></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'); 
}
  $sSql = "
  SELECT 
      a.SoldierName, 
      a.PlayerID,
      a.ClanTag,
      b.stars_id, 
      b.last_count,
      b.last_weapon,
      b.last_time, 
      c.StatsID, 
      c.LastSeenOnServer
  FROM tbl_playerdata a
      Left JOIN tbl_stars b ON a.PlayerID = b.stars_id
      Left JOIN tbl_playerstats c ON a.PlayerID = c.StatsID
  WHERE 
     TO_DAYS(c.LastSeenOnServer)+7 > TO_DAYS(NOW())
  ORDER BY 
				b.last_time DESC LIMIT 14"; 
 $result = db_query($sSql);
 
 $i= 0;
while($row = mysql_fetch_assoc($result)) {
if ($row['last_time'] > 0){
  		if (in_array($row['last_weapon'],$aStarWeapons) or in_array($row['last_weapon'],$aGadgets)){
  			if ($row['last_count'] == 1){
  			$star = '<img src="img/stars/s_bron_big.png" border="0" width="60px"/>';
  			$text = lang_awards_bron;
  		}elseif($row['last_count'] == 2){
  			$star = '<img src="img/stars/s_silv_big.png" border="0" width="60px"/>';
  			$text = lang_awards_silv;
  	  }elseif($row['last_count'] >= 3 && $row['last_count'] <=11){
  	  	$star = '<img src="img/stars/s_gold_big.png" border="0" width="60px"/>';
  	  	$text = ''.lang_awards_gold.'('.($row['last_count']-2).')';
  	  }elseif($row['last_count'] > 11){
  	  	$star = '<img src="img/stars/s_plat_big.png" border="0" width="60px"/>';
  	  	$text = lang_awards_plat;
  	}	
  	$title = $aWeaponsName[$row['last_weapon']];
  	$img = '<img src=img/weapons/'.$row['last_weapon'].'.png border=0 width=150px />';
  	
  }else{
  	    $star = '<img src="img/insignias/'.$row['last_weapon'].'.png" border="0" width="80px" height="60px"/>';
  	    $title = constant('insignia_title_'.$row['last_weapon']);
  	    $img = '<img src=img/insignias/'.$row['last_weapon'].'.png border=0 width=150px />';
  	    $text = constant($row['last_weapon'].'_text');
  }
  
  $tooltip = $img.'<br />'.$text.'<br />'.insignia_awarded.'<br />'.date("d-m-Y H:i:s",$row['last_time']);
  if (in_array($row['ClanTag'], $ClanTag) && $ClanTag != ''){
  $soldier = '<span class="sonstige">'.htmlspecialchars($row['SoldierName']).'</span>';
}else{
  $soldier = htmlspecialchars($row['SoldierName']);
}
  ?>
 <td class="result" width="110px"><a onmouseover="Tip('<?php echo $tooltip; ?>',TITLE, '<?php echo $title; ?>', WIDTH, 150, CENTERMOUSE, true, OFFSETX, 0, OFFSETY, 30, TEXTALIGN, 'center', OPACITY, 96)" onmouseout="UnTip() "><?php echo $star; ?></a><br /><a href="ministats.php?name=<?php echo urlencode($row['SoldierName']); ?>"><?php echo $soldier; ?></a></td>
	<?php
  
  	
  		if(++$i == 7)echo'<tr />';
  	}
 }



	
?>
    </tbody>
   </table>

	