<!doctype html>
<html>
<head>
	<title>Profile page</title>
<!-- CSS are placed here -->
	<?php echo HTML::style('css/bootstrap.css'); ?>
        <?php echo HTML::style('css/bootstrap-responsive.css'); ?>
        <?php echo HTML::script('js/jquery-1.11.0.min.js'); ?>
        <?php echo HTML::script('js/bootstrap.min.js'); ?>
        <?php echo HTML::script('js/highcharts.js'); ?>
        <?php echo HTML::script('js/modal.js?v2'); ?>	
	<?php echo $__env->make('header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</head>
<body>
	<!-- Scripts are placed here -->
	<h3>Team <?php echo $name; ?></h3>
	<br/>
	<div id="modal-graph" class="modal fade" tabindex="-1" role="dialog"  aria-hidden="true" style="width:75%">
          <div class="modal-dialog" style="width:100%">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-labelled-by="modal-graph" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              </div>
              <div id="modal-body">
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </div>
            </div>
          </div>
        </div>
	
	<table class="table table-hover table-condensed">
         <thead>
           <tr><td>Naam</td><td>Gemiddelde</td><td>Hoogste game</td><td>Handicap</td></tr>
        </thead>
        <tbody>
	<?php foreach ($players as $man): ?>
		<?php if ($man->max > 45): ?>
          	<tr>
	            <td><a data-username="<?php echo $man->screenname; ?>" data-userid="<?php echo $man->id; ?>" data-year="<?php echo $year; ?>" data-toggle="modal" data-target="#modal-graph" class="btn btn-primary"><?php echo $man->screenname; ?></a></td><td><?php echo number_format($man->average,2); ?></td><td><?php echo $man->max; ?></td><td><?php echo $man->handicap($year); ?></td>
         	</tr>
		<?php endif; ?>
        <?php endforeach; ?>
	</tbody>
	</table>
	
	<h3> Laatste teamresultaten </h3>
	<table class="table table-hover table-condensed">
	 <thead>
	  <tr><td>Datum</td><td>Tegenstander</td><td>Punten</td></tr>
	 </thead>
	<tbody>
	<?php foreach ($last5 as $game): ?>
	<tr>
	<td><?php echo $game->date; ?></td><td><a href="/teams/<?php echo $game->competitor_team_id; ?>"><?php echo $game->competitor_name; ?></a></td><td><?php echo $game->score; ?></td>
	</tr>
	<?php endforeach; ?>
	</tbody>
	</table>
</body>
</html>

