Example #1
0
 public function deletePlayer($id)
 {
     Flight::auth()->check(20);
     $player = Flight::players()->getPlayerWithId($id);
     $team_id = $player->team;
     $player->delete();
     Flight::redirect('/team/' . $team_id);
 }
Example #2
0
if (count($absences) > 0) {
    ?>
    <h4>Absences</h4>
    <table class="table">
      <tr><th>Reason</th><th>Name</th><th width="20px">Delete</th></tr>
      <?php 
    foreach ($absences as $absence) {
        ?>
        <?php 
        $players[] = $absence->player;
        ?>
        <tr><td><?php 
        echo $absence->getIcon();
        ?>
</td><td><?php 
        $player = Flight::players()->getPlayerWithId($absence->player);
        echo $player->forename . " " . $player->surname;
        ?>
</td><td style="text-align:center"><a href="<?php 
        FLight::link('/deleteAbsence/' . $absence->id);
        ?>
"><i class="fa fa-trash-o"></i></a></td></tr>
      <?php 
    }
    ?>
    </table>
  <?php 
} else {
    ?>
    <h4>No Absences for this Event</h4>
  <?php