Example #1
0
function loterie_interface_gain_fiche($id_troll, $id_loterie)
{
    $loterie = new loterie($id_loterie);
    if ($_SESSION[admin] == 'authenticated' && $id_troll != "") {
        // rien ici
    } elseif ($id_troll != $loterie->get_id_gagnant()) {
        afficher_contenu_tableau("Erreur. Vous n'êtes pas admin, ou vous n'avez gagné cette loterie, ou la loterie n'est pas close");
        die(' ');
    }
    $text = "Fiche de gain<br>";
    $text = "Gain : " . $loterie->get_gain() . "<br>";
    $text .= "Chaque participant doit donner ";
    $text .= $loterie->get_valeur_participe() . " " . $loterie->get_valeur_type() . ".<br>";
    afficher_contenu_tableau($text);
    $loterie_participants = new loterie_participants($id_loterie);
    $list = $loterie_participants->get_list();
    echo "<form name='fiche_gain' method='POST'>";
    echo "<input type='hidden' value='{$id_loterie}' name='gain_num_loterie'>";
    echo "<input type='hidden' value='enregistre' name='gain'>";
    echo "<table class='mh_tdborder' align='center'>";
    echo "<tr class='mh_tdtitre'>";
    echo "<td>Participant</td>";
    echo "<td>Remise effectu&eacute;e</td>";
    if ($_SESSION[admin] == 'authenticated') {
        echo "<td>Info Admin : date inscription</td>";
        echo "<td>Info Admin : date not&eacute;e remise</td>";
        echo "<td>Info Admin : ip vote</td>";
    }
    echo "<td>Remise</td>";
    echo "</tr>";
    for ($i = 1; $i <= count($list); $i++) {
        echo "<tr class='mh_tdpage'>";
        echo "<td>";
        //$troll = new troll($list[$i][id_troll_loteriep]);
        echo $list[$i][nom_troll_loteriep] . " (" . $list[$i][id_troll_loteriep] . ")";
        echo "</td>";
        echo "<td>";
        if ($list[$i][date_remise_loteriep] != "") {
            echo "Oui";
        } else {
            echo "<b><font color='red'>Non</font></b>";
        }
        echo "</td>";
        if ($_SESSION[admin] == 'authenticated') {
            echo "<td>";
            echo $list[$i][date_loteriep];
            echo "</td>";
            echo "<td>";
            echo $list[$i][date_remise_loteriep];
            echo "</td>";
            echo "<td>";
            echo $list[$i][ip_loteriep];
            echo "</td>";
        }
        if ($list[$i][date_remise_loteriep] == "") {
            echo "<td>";
            echo "Remise effectu&eacute;e<br> ";
            echo "<input type='checkbox' value='oui' name='remise_" . $list[$i][id_troll_loteriep] . "'>";
            echo "</td>";
        }
        echo "</tr>";
    }
    $lien = '/loteries/loterie.php?gain=liste';
    $lien2 = '/loteries/loterie.php?admin=liste';
    echo "<tr class='mh_tdtitre' align='center'>";
    echo "<td colspan='10'>";
    echo "<input type='submit' value='Valider' class='mh_form_submit'> ";
    if ($_SESSION[admin] == 'authenticated') {
        if ($loterie->get_id_gagnant() != false) {
            $lien = "/loteries/loterie.php?gain=liste&id_troll=" . $loterie->get_id_gagnant();
            echo "<input type='button' value='Retour Liste' onClick='Javascript:document.location.href=\"{$lien}\"'  class='mh_form_submit'> ";
        }
    }
    if ($_SESSION[admin] != 'authenticated') {
        echo "<input type='button' value='Retour Liste' onClick='Javascript:document.location.href=\"{$lien}\"'  class='mh_form_submit'> ";
    }
    if ($_SESSION[admin] == 'authenticated') {
        echo "<input type='button' value='Retour Liste Admin' onClick='Javascript:document.location.href=\"{$lien2}\"'  class='mh_form_submit'> ";
    }
    echo "</tr>";
    echo "</table>";
    echo "</form>";
}
 function get_total_participe()
 {
     global $db_vue_rm;
     $loterie = new loterie($this->id_loterie);
     return $this->get_nombre_participants() * $loterie->get_valeur_participe();
 }