<?php if (count($rows) > 0) { ?> <table class="table table-hover"> <thead> <tr> <!-- <th>ID</th> --> <th>Prénom</th> <th>Nom</th> </tr> </thead> <tbody> <?php foreach ($rows as $row) { echo '<tr class="clickable" data-href="' . Routing::getUrlFor(array('module' => $module_code, 'action' => 'detail', 'id' => $row['id'])) . '"> <!-- <td class="text-right">' . $row['id'] . '</td> --> <td>' . $row['first_name'] . '</td> <td>' . $row['last_name'] . '</td> </tr>' . "\n"; } ?> </tbody> </table> <?php } else { ?> <p class="message text-info bg-info">Aucun joueur</p> <?php }
include_once 'model/SetType.php'; include_once 'model/Player.php'; // retrieve set types $raw_set_types = ModelSetType::get(array('order_by' => 'name')); $set_types = array('' => 'Choisir...'); foreach ($raw_set_types as $row) { $set_types[$row['id']] = $row['name']; } // retrieve players $raw_players = ModelPlayer::get(array('order_by' => 'first_name, last_name')); $players = array('' => 'Aucun'); foreach ($raw_players as $row) { $players[$row['id']] = $row['first_name'] . ' ' . $row['last_name']; } $form_url = Routing::getUrlFor(array('module' => $g_current_module, 'action' => $g_current_action)); ?> <h2>Ajouter un set</h2> <form id="form_add_set" class="form-horizontal" action="<?php echo htmlspecialchars($form_url); ?> " method="post" onsubmit="return checkDistinctPlayers(this);"> <div class="form-group"> <label for="id_set_type" class="col-sm-2 control-label">Type de set</label> <div class="col-sm-10"> <?php Helper::buildSelect(array('name' => 'id_set_type', 'options' => $set_types)); ?> </div>
</tr> </thead> <tbody> <?php foreach ($rankings as $ranking) { $class_grayed = ""; if ($ranking['player_nb_sets'] < MIN_SETS_FOR_BEING_RANKED) { $class_grayed = "grayed"; } ?> <tr class="clickable <?php echo $class_grayed; ?> " data-href="<?php echo Routing::getUrlFor(array('module' => 'ranking', 'action' => $ranking['category_abbreviation'])); ?> "> <td><?php echo $ranking['category_name']; ?> </td> <td class="center"><?php echo $ranking['player_fair_rank'] . " / " . $ranking['total_players']; ?> </td> <td class="right"><?php echo sprintf("%.1f", $ranking['player_score']); ?> pts</td> <td class="right"><?php
} ?> </ul> </div><!--/.nav-collapse --> </div> </nav> <div id="content" class="container"> <ul class="nav nav-pills"> <?php foreach ($g_actions as $action_code => $action) { if ($action_code != $g_current_action && isset($action['hidden']) && $action['hidden']) { continue; } // skip if ($action_code == $g_current_action) { echo '<li class="active"><a href="' . $url . '">' . $action['name'] . '</a></li>' . "\n"; } else { $url = Routing::getUrlFor(array('module' => $g_current_module, 'action' => $action_code)); echo '<li><a href="' . $url . '">' . $action['name'] . '</a></li>' . "\n"; } } ?> </ul> <?php foreach ($messages as $message) { echo '<p class="message text-' . $message['type'] . ' bg-' . $message['type'] . '">' . $message['text'] . '</p>' . "\n"; }