algolfier 4 years ago
parent 86903a3054
commit 6e8bc7e2e2

Binary file not shown.

@ -1,13 +0,0 @@
<?php
session_start();
require_once("ConnexionBD.php");
$db = new MyDB();
$score = $_POST['score'];
$nom = $_POST['nom'];
$modeJeu = $_POST['modeJeu'];
$requete = "INSERT INTO HIGHSCORE (nomjoueur, score, modeJeu) VALUES ('$nom','$score','$modeJeu')";
$resultat = $db->query($requete);
if (isset($resultat)) echo "1\n";

@ -1,8 +0,0 @@
<?php
class MyDB extends SQLite3
{
function __construct()
{
$this->open('HighscoreBD');
}
}

@ -488,50 +488,3 @@ opacity:0;
cursor:pointer;
}
#table_HS_Match {
visibility: hidden;
}
#table_HS_Timer {
visibility: hidden;
}
#HighscorePage {
display: none;
}
.nominput {
font: 700 3vh "Poppins", sans-serif;
color: #2B2D2F;
}
#nom {
font-family: inherit;
font-size: 1vw;
color: black;
padding: 0.8vh 0;
background: transparent;
transition: border-color 0.2s;
margin-left: 1.5vw;
text-align: center;
}
.boutonajouterHS {
font-family: Montserrat, impact, Arial Black;
font-size: 1.5vw;
margin-top: 0.1vw;
color: var(--lightsedonca);
text-align: center;
width: inherit;
background-color: #B130DE;
border-radius: 45px;
}
#score {
visibility: hidden;
}
#modeJeu {
visibility: hidden;
}

@ -28,32 +28,6 @@ require("ConnexionBDD.php");
</head>
<body onload="settingOpen()">
<div id="HighscorePage">
<form onsubmit="recuphighscore()" method='post' name="formHS" >
<p class="nominput"> Nom :</p> <input id="nom" type='text' size='30' name='nom' value='' onkeypress="verifInput(this.id,'ajouterHS');"/><br/>
<input id="score" type='text' size='30' name='score' value='' />
<input id="modeJeu" type='text' size='30' name='modeJeu' value='' /><br/>
<input class="boutonajouterHS" disabled="disabled" id="ajouterHS" name='ajouter' onclick="reloadAfterHS();"
type='submit' value='Ajouter'/>
</form>
</div>
<script type="text/javascript">
document.getElementById("score").disabled = true;
document.getElementById("modeJeu").disabled = true;
function verifInput(id, idSubmit) {
if(document.getElementById(id).value != "") {
document.getElementById(idSubmit).disabled = "";
}
}
</script>
<div id="pageAccueil">
@ -749,92 +723,6 @@ require("ConnexionBDD.php");
</div>
<div id="containBottom">
<div id="table_HS_Timer">
<h1 class="titreScore" id="classementtxtTimer" >Classement - Timer</h1>
<div id="containScore">
<?php
$requete2 = "SELECT * FROM HIGHSCORE WHERE modeJeu='1' ORDER BY score DESC LIMIT 10";
$resultat2 = $db -> query($requete2);
$row = array();
$i = 0;
while ($ligne2 = $resultat2 -> fetchArray() ) {
$i++;
$pos = "nopodium";
$isLast = "";
if($i == 1){
$pos = "first";
}else if($i == 2){
$pos = "second";
}else if($i == 3){
$pos = "third";
}
if($i > 5){
$isLast = "last";
}
?>
<div class="case-score <?php echo $pos; echo " ".$isLast?>" data-description="Score obtenu le ...">
<div class="score-description">
<div class="score-position"><?php echo $i; ?></div>
<div class="score-pseudo"><?php echo $ligne2['nomjoueur']; ?></div>
<div class="score-points"><?php echo $ligne2['score']; ?></div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
<div id="containBottom">
<div id="table_HS_Match">
<h1 class="titreScore" id="classementtxtMatch">Classement - Match à Point</h1>
<div id="containScore">
<?php
$requete2 = "SELECT * FROM HIGHSCORE WHERE modeJeu='0' ORDER BY score DESC LIMIT 10";
$resultat2 = $db -> query($requete2);
$row = array();
$i = 0;
while ($ligne2 = $resultat2 -> fetchArray() ) {
$i++;
$pos = "nopodium";
$isLast = "";
if($i == 1){
$pos = "first";
}else if($i == 2){
$pos = "second";
}else if($i == 3){
$pos = "third";
}
if($i > 5){
$isLast = "last";
}
?>
<div class="case-score <?php echo $pos; echo " ".$isLast?>" data-description="Score obtenu le ...">
<div class="score-description">
<div class="score-position"><?php echo $i; ?></div>
<div class="score-pseudo"><?php echo $ligne2['nomjoueur']; ?></div>
<div class="score-points"><?php echo $ligne2['score']; ?></div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
</div>
<div class="mounts">
<img src="imgs/lightcloud.png" id="cloud">

@ -166,25 +166,6 @@ function modePrec() {
}
}
var table1 = document.getElementById('table_HS_Timer');
var table2 = document.getElementById('table_HS_Match');
if(selectionMode == 0) {
table1.style.visibility = "hidden";
table2.style.visibility = "visible";
}
if(selectionMode == 1) {
table1.style.visibility = "visible";
table2.style.visibility = "hidden";
}
if(selectionMode == 2) {
table1.style.visibility = "hidden";
table2.style.visibility = "hidden";
}
if(selectionMode == 3) {
table1.style.visibility = "hidden";
table2.style.visibility = "hidden";
}
}
@ -245,26 +226,6 @@ function modeSuiv() {
}
}
var table1 = document.getElementById('table_HS_Timer');
var table2 = document.getElementById('table_HS_Match');
if(selectionMode == 0) {
table1.style.visibility = "hidden";
table2.style.visibility = "visible";
}
if(selectionMode == 1) {
table1.style.visibility = "visible";
table2.style.visibility = "hidden";
}
if(selectionMode == 2) {
table1.style.visibility = "hidden";
table2.style.visibility = "hidden";
}
if(selectionMode == 3) {
table1.style.visibility = "hidden";
table2.style.visibility = "hidden";
}
}
function dimensionPrec() {
@ -2682,11 +2643,11 @@ function rechercheAide() {
if (deckPartie.length < 16 && comb == 0) {
if (!modelangue) {
window.alert("Fin de partie !");
document.getElementById("HighscorePage").style.display = "block";
} else {
window.alert("Game Over !");
document.getElementById("HighscorePage").style.display = "block";
}
retour();
clearInterval(itv);
} else if (deckPartie.length >= 16 && comb == 0) {
lesPoints += 5;
@ -2746,13 +2707,14 @@ function decompte() {
if (cpt == 0) {
if(!modelangue){
window.alert("fin du jeu");
document.getElementById("HighscorePage").style.display = "block";
}
else{
window.alert("Game Over");
document.getElementById("HighscorePage").style.display = "block";
}
retour();
window.location.reload();
clearInterval(itv);
}
@ -3186,8 +3148,8 @@ function functionLange(){
document.getElementById('textjouerr').innerHTML = 'JOUER';
//Traduction classement
document.getElementById('classementtxtTimer').textContent = 'Classement - Timer';
document.getElementById('classementtxtMatch').textContent = 'Classement - Match à Point';
//document.getElementById('classementtxtTimer').textContent = 'Classement - Timer';
//document.getElementById('classementtxtMatch').textContent = 'Classement - Match à Point';
//Traduction paramètres
document.getElementById('SettingName').textContent = 'Paramètres';
@ -3208,8 +3170,8 @@ function functionLange(){
document.getElementById('textjouerr').innerHTML = 'PLAY';
//Traduction classement
document.getElementById('classementtxtTimer').textContent = 'Ranking - Timer';
document.getElementById('classementtxtMatch').textContent = 'Ranking - Point Match';
//document.getElementById('classementtxtTimer').textContent = 'Ranking - Timer';
//document.getElementById('classementtxtMatch').textContent = 'Ranking - Point Match';
//Traduction paramètres
document.getElementById('SettingName').textContent = 'Settings';
@ -3224,31 +3186,3 @@ function functionLange(){
}
}
function recuphighscore(){
var nom = document.getElementById('nom').value;
var score = lesPoints;
$.ajax({
type: "POST",
url: "ajouterScore.php",
data: {
score : score,
nom: nom,
modeJeu : selectionMode
},
success: function(data){
if(data == 1)
alert("requête effectuée ");
else
alert("retapez votre nom svp");
}
});
}
function reloadAfterHS(){
retour();
window.location.reload();
}

Loading…
Cancel
Save