示例#1
0
function loterie_info_top()
{
    $loteries = new loteries();
    $id_loterie = $loteries->get_last_id_loterie();
    $loterie = new loterie($id_loterie);
    $loterie_participant = new loterie_participant($_SESSION['AuthTroll'], $id_loterie);
    $lien = "<a href='/loteries/loterie.php'>loterie</a>";
    $text = "";
    if (!$loterie_participant->can_participe($id_loterie)) {
        $text .= "<font color='red'>Vous n'avez pas r&eacute;gl&eacute; vos dettes de loterie.<br>";
        //$text .= "<font color='red'>Vous n'avez pas r&eacute;gl&eacute; vos dettes de loterie num&eacute;ro $id_loterie.<br>";
    } elseif (!$loterie_participant->is_participant() && $loterie->get_etat() == 'en_cours') {
        $text .= "<font color='red'>Vous n'&ecirc;tes pas encore inscrit pour la {$lien} num&eacute;ro {$id_loterie}.<br>";
    } elseif ($loterie_participant->is_participant() && $loterie->get_etat() == 'en_cours') {
        $text .= "Vous participez &agrave; la {$lien} num&eacute;ro {$id_loterie}.<br>";
    }
    if ($loterie->get_etat() == 'ouvert') {
        $text .= "Nouvelle  [{$lien}] en pr&eacute;paration, ouverture dans peu de temps.";
    } elseif ($loterie->get_etat() == 'clos') {
        $text .= "<font color='red'>La {$lien} num&eacute;ro {$id_loterie} est cl&ocirc;tur&eacute;e. Le gagnant est : ";
        $troll = new troll($loterie->get_id_gagnant());
        $text .= $troll->get_nom_troll() . " (" . $loterie->get_id_gagnant() . ")<br>";
        if ($loterie->get_id_gagnant() == $_SESSION['AuthTroll']) {
            $text .= "<font color='red'><b>Vous avez gagn&eacute; la {$lien} num&eacute;ro {$id_loterie} !<b></font> ";
            $text .= "[<a href='/loteries/loterie.php?gain=fiche&id_loterie={$id_loterie}'>Acc&egrave;s interface de gain loterie {$id_loterie}</a>] ";
        }
    }
    // on regarde si le troll connecté n'a pas déjà été gagnant une fois
    if ($loteries->is_gagnant($_SESSION['AuthTroll'])) {
        $text .= "[<a href='/loteries/loterie.php?gain=liste'>Loteries gagn&eacute;es</a>]";
    }
    if ($text != "") {
        echo "<tr class='mh_tdpage'><td>";
        echo $text;
        echo "</td></tr>";
    }
}
示例#2
0
 function get_db_list_membres()
 {
     global $db_vue_rm;
     if (!$this->id_groupe) {
         return false;
     }
     $sql = " SELECT id_groupe, t.id_troll as id_troll, t.nom_troll as nom_troll, x_troll, y_troll, z_troll, ";
     $sql .= " dla_en_cours, dla_suivante, dla_prevue, date_maj, duree_dla, fatigue_kastar, pa, pv_actuel, pv_max";
     $sql .= " FROM ggc_troll g, trolls t";
     $sql .= " WHERE id_groupe= " . $this->id_groupe;
     $sql .= " AND t.id_troll = g.id_troll ";
     if (!($result = mysql_query($sql, $db_vue_rm))) {
         echo mysql_error();
     } else {
         $i = 1;
         while ($row = mysql_fetch_assoc($result)) {
             $troll = new troll();
             $troll->set_id_troll($row['id_troll']);
             $troll->set_nom_troll($row['nom_troll']);
             $troll->set_x_troll($row['x_troll']);
             $troll->set_y_troll($row['y_troll']);
             $troll->set_z_troll($row['z_troll']);
             $list[$i][troll] = $troll;
             $list[$i][dla1] = $row['dla_en_cours'];
             $list[$i][dla2] = $row['dla_suivante'];
             $list[$i][dla3] = $row['dla_prevue'];
             $list[$i][date_maj] = $row['date_maj'];
             $list[$i][duree_dla] = $row['duree_dla'];
             $list[$i][pa] = $row['pa'];
             $list[$i][fatigue_kastar] = $row['fatigue_kastar'];
             $list[$i][pv_actuel] = $row['pv_actuel'];
             $list[$i][pv_max] = $row['pv_max'];
             $i++;
         }
     }
     return $list;
 }