Citation :
<?php session_start();
//debut condition reset:
if (isset($_GET['variable'])) {
$_SESSION['depensecumul'] = 0;
$_SESSION['tiragecumul'] = 0;
$_SESSION['jourcumul'] = -1;
$_SESSION['gainscumul'] = 0;
$_SESSION['gainmax'] = 0;
header('Location: loto.php');
}
else
{
if (empty($_SESSION['gainscumul'])) {$_SESSION['gainscumul'] = 0;} else {$_SESSION['gainscumul'] = $_SESSION['gainscumul'];}
if (empty($_SESSION['depensecumul'])) {$_SESSION['depensecumul'] = 2;} else {$_SESSION['depensecumul'] = ($_SESSION['depensecumul'] + 2);}
if (empty($_SESSION['tiragecumul'])) {$_SESSION['tiragecumul'] = 1;} else {$_SESSION['tiragecumul'] = ($_SESSION['tiragecumul'] + 1);}
if (empty($_SESSION['jourcumul'])) {$_SESSION['jourcumul'] = 2.333;} else {$_SESSION['jourcumul'] = ($_SESSION['jourcumul'] + 2.333);} //2.333 pour jouer 3 tirages par semaines, 3.5 pour 2 tirages par semaines, 7 pour 1 tirage par semaines
?>
<html>
<head>
<STYLE type="text/css">
body {
font-family: sans-serif;
}
td {
font-family: sans-serif;
padding: 5px;
text-align: center;
background-color: #ffffff;
width: 25px;
}
</STYLE>
</head>
<body>
LOTO CLASSIQUE:<br><br>
<?php
/* système flash:
$complementaire_moi = rand(1,10);
$moi1= rand(1,49);
$moi2= rand(1,49); while ($moi2 == $moi1) {$moi2= rand(1,49);}
$moi3= rand(1,49); while (($moi3 == $moi2) or ($moi3 == $moi1)) {$moi3= rand(1,49);}
$moi4= rand(1,49); while (($moi4 == $moi3) or ($moi4 == $moi2) or ($moi4 == $moi1)) {$moi4= rand(1,49);}
$moi5= rand(1,49); while (($moi5 == $moi4) or ($moi5 == $moi3) or ($moi5 == $moi2) or ($moi5 == $moi1)) {$moi5= rand(1,49);}
$moi = ("<td>".$moi1."</td><td>".$moi2."</td><td>".$moi3."</td><td>".$moi4."</td><td>".$moi5."</td><td> </td><td><b>".$complementaire_moi."</b></td>" );
*/
/* numéros persos */
$complementaire_moi = 4;
$moi1= 8;
$moi2= 15;
$moi3= 16;
$moi4= 23;
$moi5= 42;
$moi = ("<td>".$moi1."</td><td>".$moi2."</td><td>".$moi3."</td><td>".$moi4."</td><td>".$moi5."</td><td> - </td><td><b>".$complementaire_moi."</b></td>" );
?>
<?php
$complementaire_loto = rand(1,10);
$loto1= rand(1,49);
$loto2= rand(1,49); while ($loto2 == $loto1) {$loto2= rand(1,49);}
$loto3= rand(1,49); while (($loto3 == $loto2) or ($loto3 == $loto1)) {$loto3= rand(1,49);}
$loto4= rand(1,49); while (($loto4 == $loto3) or ($loto4 == $loto2) or ($loto4 == $loto1)) {$loto4= rand(1,49);}
$loto5= rand(1,49); while (($loto5 == $loto4) or ($loto5 == $loto3) or ($loto5 == $loto2) or ($loto5 == $loto1)) {$loto5= rand(1,49);}
$loto = ("<td>".$loto1."</td><td>".$loto2."</td><td>".$loto3."</td><td>".$loto4."</td><td>".$loto5."</td><td> - </td><td><b>".$complementaire_loto."</b></td>" );
?>
<?php
$chiffres_bons = 0;
if (($moi1== $loto1) or ($moi1== $loto2) or ($moi1== $loto3) or ($moi1== $loto4) or ($moi1== $loto5)) {$chiffres_bons = ($chiffres_bons + 1);}
if (($moi2== $loto1) or ($moi2== $loto2) or ($moi2== $loto3) or ($moi2== $loto4) or ($moi2== $loto5)) {$chiffres_bons = ($chiffres_bons + 1);}
if (($moi3== $loto1) or ($moi3== $loto2) or ($moi3== $loto3) or ($moi3== $loto4) or ($moi3== $loto5)) {$chiffres_bons = ($chiffres_bons + 1);}
if (($moi4== $loto1) or ($moi4== $loto2) or ($moi4== $loto3) or ($moi4== $loto4) or ($moi4== $loto5)) {$chiffres_bons = ($chiffres_bons + 1);}
if (($moi5== $loto1) or ($moi5== $loto2) or ($moi5== $loto3) or ($moi5== $loto4) or ($moi5== $loto5)) {$chiffres_bons = ($chiffres_bons + 1);}
?>
<html>
<body>
<?php
echo "<table border=1>";
echo "<tr><td>Vous: </td>".$moi."</tr>";
echo "<tr><td>Tirage: </td>".$loto."</tr>";
echo "</table>";
echo "<table border=0><tr><td style='width: 900px; height: 100px; text-align: left; padding: 0px;'>Numéros bons: ".$chiffres_bons."/5";
if (empty($_SESSION['gainmax'])) {$_SESSION['gainmax'] = 0;}
if (($chiffres_bons == 5) and ($complementaire_loto == $complementaire_moi)) {echo " - <font color = green>Gains: 2 000 000 €(<b>JACKPOT!!!!!!!!!!!!!</b> ) </font><img src='http://forum-images.hardware.fr/images/perso/1/bobl%27eponge.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+2000000); $thisgain = 2000000;}
if (($chiffres_bons == 5) and ($complementaire_loto <> $complementaire_moi)) {echo " - <font color = green>Gains: 180 000 € </font><img src='http://forum-images.hardware.fr/images/perso/warkcolor.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+180000); $thisgain = 180000;}
if ($chiffres_bons == 4) {echo " - <font color = green>Gains: 900 € </font><img src='http://forum-images.hardware.fr/images/perso/client%20du%20commensal.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+900); $thisgain = 900;}
if ($chiffres_bons == 3) {echo " - <font color = green>Gains: 12 € </font><img src='http://forum-images.hardware.fr/images/perso/blair%20witch.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+12); $thisgain = 12;}
if ($chiffres_bons == 2) {echo " - <font color = green>Gains: 5 € </font><img src='http://forum-images.hardware.fr/images/perso/blair%20witch.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+5); $thisgain = 5;}
if (($chiffres_bons == 1) and ($complementaire_loto <> $complementaire_moi)) {echo " - Gains: 0 € <img src='http://forum-images.hardware.fr/images/perso/le%20fleau.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+0); $thisgain = 0;}
if (($chiffres_bons == 1) and ($complementaire_loto == $complementaire_moi)) {echo " - <font color = green>Gains: 2 € </font><img src='http://forum-images.hardware.fr/images/perso/blair%20witch.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+2); $thisgain = 2;}
if (($chiffres_bons == 0) and ($complementaire_loto <> $complementaire_moi)) {echo " - Gains: 0 € <img src='http://forum-images.hardware.fr/images/perso/le%20fleau.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+0); $thisgain = 0;}
if (($chiffres_bons == 0) and ($complementaire_loto == $complementaire_moi)) {echo " - <font color = green>Gains: 2 € </font><img src='http://forum-images.hardware.fr/images/perso/blair%20witch.gif'/>"; $_SESSION['gainscumul'] = (($_SESSION['gainscumul'])+2); $thisgain = 2;}
echo "</tr></td></table>";
if ($thisgain > $_SESSION['gainmax']) {$_SESSION['gainmax'] = $thisgain;}
echo "<table border = 1>";
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Gain max: </td><td style='text-align: left; padding: 0px;'>".$_SESSION['gainmax']." €</td></tr>";;
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Gains cumul: </td><td style='text-align: left; padding: 0px;'>".$_SESSION['gainscumul']." €</td></tr>";
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Mises cumul: </td><td style='text-align: left; padding: 0px;'>".$_SESSION['depensecumul']." €</td></tr>";
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Pertes nettes: </td><td style='text-align: left; padding: 0px;'>".($_SESSION['depensecumul'] - $_SESSION['gainscumul'])." €</td></tr>";
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Tirage N°: </td><td style='text-align: left; padding: 0px;'>".$_SESSION['tiragecumul']."</td></tr>";
echo "<tr><td style='width: 130px; text-align: left; padding: 0px;'>Jour N°: </td><td style='text-align: left; padding: 0px;'>".round(($_SESSION['jourcumul']), 0); if (($_SESSION['jourcumul']) > 365) {echo " (année ".round((($_SESSION['jourcumul'])/365), 0)."  </td></tr>";}
echo "</table>";
?>
<br><br>(maintenir F5 pour simuler sur long terme) <br><br>
<a href="loto.php?variable='truc'">Reset</a>
</body>
</html>
<?php
} //fin condition reset:
?>
<!-- le rageux 2011 pour HFR -->
|