BARRAUX Arthur
3 years ago
16 changed files with 115 additions and 140 deletions
@ -1,80 +0,0 @@ |
|||||
<?php |
|
||||
echo <<<HTML |
|
||||
<button class="button button-rules" onclick="regles()">Règles</button> |
|
||||
<div class="container"> |
|
||||
<img id="jackpot" src="jackpot.png"></img> |
|
||||
</div> |
|
||||
<div class="game"> |
|
||||
<span class="info">Banque : <span id="banque_score">1000</span></span> |
|
||||
<div class="machine"> |
|
||||
<img src="tirette.png" alt="tirette" id="tirette" onclick="jeu()"> |
|
||||
<img src="machine.png" id="tirage"> |
|
||||
<div id="rouleau_1" class="rouleau"> |
|
||||
<div class="cube"> |
|
||||
<div class="cube__face cube__face--0">0</div> |
|
||||
<div class="cube__face cube__face--1">1</div> |
|
||||
<div class="cube__face cube__face--2">2</div> |
|
||||
<div class="cube__face cube__face--3">3</div> |
|
||||
<div class="cube__face cube__face--4">4</div> |
|
||||
<div class="cube__face cube__face--5">5</div> |
|
||||
<div class="cube__face cube__face--6">6</div> |
|
||||
<div class="cube__face cube__face--7">7</div> |
|
||||
<div class="cube__face cube__face--8">8</div> |
|
||||
<div class="cube__face cube__face--9">9</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div id="rouleau_2" class="rouleau"> |
|
||||
<div class="cube"> |
|
||||
<div class="cube__face cube__face--0">0</div> |
|
||||
<div class="cube__face cube__face--1">1</div> |
|
||||
<div class="cube__face cube__face--2">2</div> |
|
||||
<div class="cube__face cube__face--3">3</div> |
|
||||
<div class="cube__face cube__face--4">4</div> |
|
||||
<div class="cube__face cube__face--5">5</div> |
|
||||
<div class="cube__face cube__face--6">6</div> |
|
||||
<div class="cube__face cube__face--7">7</div> |
|
||||
<div class="cube__face cube__face--8">8</div> |
|
||||
<div class="cube__face cube__face--9">9</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div id="rouleau_3" class="rouleau"> |
|
||||
<div class="cube"> |
|
||||
<div class="cube__face cube__face--0">0</div> |
|
||||
<div class="cube__face cube__face--1">1</div> |
|
||||
<div class="cube__face cube__face--2">2</div> |
|
||||
<div class="cube__face cube__face--3">3</div> |
|
||||
<div class="cube__face cube__face--4">4</div> |
|
||||
<div class="cube__face cube__face--5">5</div> |
|
||||
<div class="cube__face cube__face--6">6</div> |
|
||||
<div class="cube__face cube__face--7">7</div> |
|
||||
<div class="cube__face cube__face--8">8</div> |
|
||||
<div class="cube__face cube__face--9">9</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<input type="text" id="mise_input"> |
|
||||
</img> |
|
||||
</div> |
|
||||
<span class="info">Vous : <span id="joueur_score"></span></span> |
|
||||
</div> |
|
||||
<div class="overlay" style="display: none;"> |
|
||||
<div class="overlay-rules"> |
|
||||
<h1>Règles</h1> |
|
||||
<p> |
|
||||
<h4 style="text-align: center;">Bienvenue au Bellagio !</h4> |
|
||||
Vous disposez pour commencer de 100 jetons (quelle générosité!)<br> |
|
||||
Pour jouer indiquez une somme dans l'encart blanc sur la machine(inférieur à 100)<br> |
|
||||
Puis appuyez sur la tirette rouge et or et laissez la magie opérer.<br> |
|
||||
Si les trois chiffres sont identiques, alors : |
|
||||
<ul> |
|
||||
<li>s’ils sont (9, 9, 9) Bravo vous remportez le jackpot. Tout les jetons tombent </li> |
|
||||
<li>s'ils sont juste identiques: vous remportez 6 fois votre mise (c'est déjà pas mal!)</li> |
|
||||
<li>s'il y en a seulement 2 identiques: vous empochez 3 fois votre mise! (petit veinard)</li> |
|
||||
<li>sinon tant mieux pour nous vous perdez votre mise</li> |
|
||||
</ul> |
|
||||
Le jeu s'arrête lorque vous serez ruinez.</p> |
|
||||
<button class="button is-red" onclick="regles()">Fermer</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
<script type="text/javascript" src="app.js"></script> |
|
||||
HTML; |
|
||||
?> |
|
@ -1,31 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="fr"> |
|
||||
<head> |
|
||||
<meta charset="UTF-8"> |
|
||||
<link rel="stylesheet" href="master.css"> |
|
||||
<title>Bellagio</title> |
|
||||
</head> |
|
||||
<body> |
|
||||
<h1 style="text-align: center; margin: 0;">CASINO BELLAGIO</h1> |
|
||||
<?php |
|
||||
$return_path = ""; |
|
||||
$users = array("admin"=>"admin", "user"=>"yahou") |
|
||||
//euh ça marche pas ici à régler après |
|
||||
$user_scores = array("admin"=>100, "user"=>200) |
|
||||
if(isset($_POST["username"]) and isset($_POST["password"])){ |
|
||||
if(in_array($_POST["username"], $users) and $_POST["password"] == $users[$_POST["username"]]){ |
|
||||
$_GET['score'] = $user_scores[$_POST["username"]]; |
|
||||
$return_path = "casino.php"; |
|
||||
} |
|
||||
else{ |
|
||||
$_GET['error'] = 1; |
|
||||
$return_path = "login.php"; |
|
||||
} |
|
||||
} |
|
||||
else{ |
|
||||
$return_path = "login.php"; |
|
||||
} |
|
||||
include($return_path); |
|
||||
?> |
|
||||
</body> |
|
||||
</html> |
|
@ -0,0 +1,13 @@ |
|||||
|
<?php |
||||
|
session_start(); |
||||
|
if (isset($_SESSION["username"]) AND isset($_SESSION['password']) AND isset($_SESSION['compte']) AND isset($_POST['compte'])) { |
||||
|
$_SESSION['compte'] = $_POST['compte']; |
||||
|
echo $_SESSION['compte']; |
||||
|
$bdd = new SQLite3('../users.db', SQLITE3_OPEN_READWRITE); |
||||
|
|
||||
|
$append = $bdd->prepare("UPDATE users SET compte='".$_POST['compte']."' where username = '".$_SESSION['username']."'"); |
||||
|
|
||||
|
$append->execute(); |
||||
|
} |
||||
|
|
||||
|
?> |
Before Width: | Height: | Size: 922 KiB After Width: | Height: | Size: 922 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -1,20 +0,0 @@ |
|||||
<?php |
|
||||
if(isset($_GET['error']) and $_GET['error'] == 1){ |
|
||||
echo <<<HTML |
|
||||
<p style="text-align: center;">Erreur: Votre mot de passe n'est pas correct</p> |
|
||||
HTML;; |
|
||||
} |
|
||||
echo <<<HTML |
|
||||
<form action="index.php" method="post" id="form"> |
|
||||
<div class="form-chunck"> |
|
||||
<label for="username">Utilisateur</label> |
|
||||
<input class="input" type="text" name="username"> |
|
||||
</div> |
|
||||
<div class="form-chunck"> |
|
||||
<label for="password">Mot de passe</label> |
|
||||
<input class="input" type="password" name="password" id=""> |
|
||||
</div> |
|
||||
<input class="button" type="submit" value="Se connecter"> |
|
||||
</form> |
|
||||
HTML; |
|
||||
?> |
|
@ -0,0 +1,22 @@ |
|||||
|
<?php |
||||
|
if (isset($_POST["username"]) && isset($_POST["password"])) { |
||||
|
$bdd = new SQLite3('../users.db', SQLITE3_OPEN_READWRITE); |
||||
|
$request = $bdd->query("SELECT * FROM users where username='".$_POST['username']."'"); |
||||
|
while($line = $request->fetchArray()) { |
||||
|
if ($line["password"] == sha1($_POST["password"])) { |
||||
|
session_start(); |
||||
|
$_SESSION['username'] = $line['username']; |
||||
|
$_SESSION['password'] = $line['password']; |
||||
|
$_SESSION['compte'] = $line['compte']; |
||||
|
echo '<meta http-equiv="refresh" content="0;URL=../jeu/index.php">'; |
||||
|
exit; |
||||
|
} |
||||
|
else { |
||||
|
echo '<meta http-equiv="refresh" content="0;URL=login.php?error=3">'; |
||||
|
exit; |
||||
|
} |
||||
|
} |
||||
|
echo '<meta http-equiv="refresh" content="0;URL=login.php?error=2">'; |
||||
|
|
||||
|
} |
||||
|
?> |
@ -0,0 +1,25 @@ |
|||||
|
<?php |
||||
|
if (isset($_POST["username"]) && isset($_POST["password"])) { |
||||
|
$bdd = new SQLite3('../users.db', SQLITE3_OPEN_READWRITE); |
||||
|
$request = $bdd->query('SELECT * from users'); |
||||
|
|
||||
|
while($line = $request->fetchArray()) { |
||||
|
if ($line['username'] == $_POST["username"]) { |
||||
|
echo '<meta http-equiv="refresh" content="0;URL=login.php?error=1">'; |
||||
|
exit; |
||||
|
} |
||||
|
} |
||||
|
$append = $bdd->prepare("INSERT INTO users(username, password, compte) VALUES(:username, :password, :compte)"); |
||||
|
|
||||
|
$append->bindValue(':username', $_POST['username']); |
||||
|
$append->bindValue(':password', sha1($_POST['password'])); |
||||
|
$append->bindValue(':compte', 100); |
||||
|
|
||||
|
$append->execute(); |
||||
|
session_start(); |
||||
|
$_SESSION['username'] = $line['username']; |
||||
|
$_SESSION['password'] = $line['password']; |
||||
|
$_SESSION['compte'] = $line['compte']; |
||||
|
echo '<meta http-equiv="refresh" content="0;URL=../jeu/index.php">'; |
||||
|
} |
||||
|
?> |
@ -0,0 +1,35 @@ |
|||||
|
<h1>Content de vous revoir !</h1> |
||||
|
<form action="cible_login.php" method="post" id="form"> |
||||
|
<div class="form-chunck"> |
||||
|
<label for="username">Utilisateur</label> |
||||
|
<input class="input" type="text" name="username"> |
||||
|
<?php if (isset($_GET['error']) AND $_GET['error'] == '2') { echo <<<HTML |
||||
|
<small>Nom d'utilisateur incorrecte</small> |
||||
|
HTML; } ?> |
||||
|
</div> |
||||
|
<div class="form-chunck"> |
||||
|
<label for="password">Mot de passe</label> |
||||
|
<input class="input" type="password" name="password" id=""> |
||||
|
<?php if (isset($_GET['error']) AND $_GET['error'] == '3') { echo <<<HTML |
||||
|
<small>Mot de passe incorrecte</small> |
||||
|
HTML; } ?> |
||||
|
</div> |
||||
|
<input class="button" type="submit" value="Se connecter"> |
||||
|
</form> |
||||
|
<br> |
||||
|
<br> |
||||
|
<h1>Toujours pas de compte chez deuzagio ?</h1> |
||||
|
<form action="cible_sign-up.php" method="post" id="form"> |
||||
|
<div class="form-chunck"> |
||||
|
<label for="username">Utilisateur</label> |
||||
|
<input class="input" type="text" name="username"> |
||||
|
<?php if (isset($_GET['error']) AND $_GET['error'] == '1') { echo <<<HTML |
||||
|
<small>Nom d'utilisateur déjà pris</small> |
||||
|
HTML; } ?> |
||||
|
</div> |
||||
|
<div class="form-chunck"> |
||||
|
<label for="password">Mot de passe</label> |
||||
|
<input class="input" type="password" name="password" id=""> |
||||
|
</div> |
||||
|
<input class="button" type="submit" value="Se connecter"> |
||||
|
</form> |
Binary file not shown.
Loading…
Reference in new issue