<?php 
$sumfingIncl=true;
include '../config.thing.php';
$set = get_adm_opts();
include 'translate.php';
echo '<h3>'. _("Leaderboard").'</h3>';

$results = get_leaderboard($set->leaders_amount);

?>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

<table class="table table-striped table-bordered">
  <thead>
    <tr>
      <th><?php echo _("#");?></th>
      <th><?php echo _("Name");?></th>
      <th><?php echo _("Tickets");?></th>
    </tr>
  </thead>
  <tbody>
  <?php 
  $i=1;
  foreach($results as $user) {
	  if(isset($set->lboard_link))
	  $username = '<a href="https://facebook.com/'.$user['fb_id'].'" target="_blank">'.$user['name'].'</a>';
	  else
	  $username = $user['name'];
	  echo "<tr>";
	  
	  	echo "<td>" . $i . "</td><td>" . $username . "</td><td>" . $user['total_tickets']. "</td>";
	  
	  echo "</tr>";
	  $i++;
  }
  ?>

  </tbody>
</table>
