font vacance et enigme

This commit is contained in:
Baptiste Rebillard 2022-06-13 18:41:47 +02:00
parent 1e46fcd664
commit 8a8a479705
4 changed files with 86 additions and 19 deletions

View file

@ -12,4 +12,42 @@ section {
padding: 50px;
font-size: 1.2rem;
margin-top: 40px;
}
.input {
width: 50%;
background-color: white;
border: 3px solid grey;
border-radius: 4px;
text-align: center;
height: 50px;
margin: 10px;
font-weight: bold;
}
.submit {
width: 50%;
background-color: grey;
border: 3px solid grey;
color: white;
border-radius: 4px;
text-align: center;
height: 50px;
margin: 10px;
font-weight: bold;
}
.submit:hover {
transition: 0.3s ease;
transform: scale(1.05);
}
@media (max-width: 700px) {
.submit {
width: 80%;
}
.input {
width: 80%;
}
}

View file

@ -21,12 +21,40 @@ form {
margin: 20px;
}
input {
width: 50%;
.input {
display: inline-block;
width: 35%;
background-color: white;
border: 3px solid grey;
border-radius: 4px;
text-align: center;
height: 30px;
margin: 5px;
}
.submit {
width: 50%;
background-color: grey;
border: 3px solid grey;
color: white;
border-radius: 4px;
text-align: center;
height: 30px;
margin: 5px;
font-weight: bold;
}
.submit:hover {
transition: 0.3s ease;
transform: scale(1.05);
}
@media (max-width: 1500px) {
section {
display: flex;
width: 90vw;
aspect-ratio: auto;
height: auto;
}
}

View file

@ -60,13 +60,13 @@ if(isset($_POST['send'])) {
if($reponse[0]['team'] == NULL) {
?>
<form method="POST">
<input type="text" placeholder="Réponse à l'énigme" name="answer">
<select name="team">
<input type="text" placeholder="Réponse à l'énigme" name="answer" class="input">
<select name="team" class="input">
<option value="">Choisissez votre équipe</option>
<option value="pkpeach">PKpeach</option>
<option value="boomario">Boomario</option>
</select>
<input type="submit" name="send" value="Valider votre réponse">
<input type="submit" name="send" value="Valider votre réponse" class="submit">
</form>
<?php
} else {

View file

@ -29,11 +29,11 @@ if(isset($_POST['send'])) {
$req = $db->prepare("SELECT * FROM scores WHERE texte = ?");
$req->execute(array("Mots croisés"));
$req->execute(array("Mots croises"));
$req_exist = $req->rowCount();
if($req_exist == 0) {
if($end) {
if(isset($_POST['team']) AND !empy($_POST['team'])) {
if(isset($_POST['team']) AND !empty($_POST['team'])) {
$team = htmlspecialchars($_POST['team']);
if($team == "pkpeach") {
@ -45,9 +45,7 @@ if(isset($_POST['send'])) {
}
$req = $db->prepare("INSERT INTO scores(texte, points, team) VALUES(?, ?, ?)");
$req->execute(array("Mots croisés","500", $team));
} else {
$error = "veuillez indiquer votre équipe";
$req->execute(array("Mots croises","500", $team));
}
}
}
@ -74,21 +72,28 @@ if(isset($_POST['send'])) {
while($r = $req->fetch()) {
?>
<input type="text" name="input<?= $r['id'] ?>" placeholder="<?= $r['id'] ?>" value="<?php if(isset($input[$r['id']])) { echo $input[$r['id']]; } ?>" style="border: 2px solid <?= $color[$r['id']] ?>;"><br>
<input type="text" name="input<?= $r['id'] ?>" placeholder="Mot <?= $r['id'] ?>" value="<?php if(isset($input[$r['id']])) { echo $input[$r['id']]; } ?>" style="border: <?= $color[$r['id']] ?>;" class="input">
<?php
}
if($end) {
$req = $db->prepare("SELECT team FROM scores WHERE texte = ?");
$req->execute(array("Mots croises"));
$req_exist = $req->rowCount();
$team_gg = $req -> fetchAll(PDO::FETCH_ASSOC);
if($end AND $req_exist == 0) {
?> <br>
Franchement GG à vous, choisissez votre équipe ci-dessous pour lui faire remporter les points :<br>
<select name="team">
<select name="team" class="input">
<option value="">Choisissez votre équipe</option>
<option value="pkpeach">PKpeach</option>
<option value="boomario">Boomario</option>
</select>
<?php
}
?><br>
<input type="submit" name="send" value="Envoyer">
?><br><br>
<input type="submit" name="send" value="Envoyer" class="submit">
<font color="red">
<?php if(isset($error)) {
@ -99,10 +104,6 @@ if(isset($_POST['send'])) {
<br><br>
<?php
$req = $db->prepare("SELECT team FROM scores WHERE texte = ?");
$req->execute(array("Mots croises"));
$req_exist = $req->rowCount();
$team_gg = $req -> fetchAll(PDO::FETCH_ASSOC);
if($req_exist == 0) {
echo "Aucune des deux équipes n'a réussit à trouver tout les mots";
} else {