Example #1
0
<?php

include 'bootstrap.php';
Database::open();
$sets = ModelSet::get(array('order_by' => 'creation_datetime'));
Database::close();
foreach ($sets as $set) {
    echo "ModelSet::add(array(\r\n      'creation_datetime' => '" . $set['creation_datetime'] . "',\r\n      'id_set_type' => " . $set['id_set_type'] . ",\r\n      'id_player_1_win' => " . $set['id_player_1_win'] . ",\r\n      'id_player_2_win' => " . ($set['id_player_2_win'] === NULL ? "'NULL'" : $set['id_player_2_win']) . ",\r\n      'id_player_1_lose' => " . $set['id_player_1_lose'] . ",\r\n      'id_player_2_lose' => " . ($set['id_player_2_lose'] === NULL ? "'NULL'" : $set['id_player_2_lose']) . "\r\n    ));";
    echo "\n";
}
Example #2
0
<?php

include_once 'model/Set.php';
include_once 'model/SetType.php';
$rows = ModelSet::get(array('order_by' => 'creation_datetime desc', 'limit' => 50));
?>

<h2>Liste des sets</h2>

<?php 
if (count($rows) > 0) {
    ?>
  <table class="table table-hover table-bordered">
  <thead>
  <tr>
    <!-- <th>N°</th> -->
    <th>Joué le</th>
    <th>Type</th>
    
    <th colspan="3">Gagnant 1</th>
    <th colspan="3">Gagnant 2</th>
    <th colspan="3">Perdant 1</th>
    <th colspan="3">Perdant 2</th>
    
    <!--
    <th>Nb sets initial G1</th>
    <th>Nb sets initial G2</th>
    <th>Nb sets initial P1</th>
    <th>Nb sets initial P2</th>
    -->
  </tr>