Maj dashborad + front
continuous-integration/drone/push Build is failing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent be0fc1bd82
commit 492e2fb782

@ -24,7 +24,7 @@ li {
a { a {
color: white; color: white;
text-decoration: none !important; text-decoration: none;
} }
a:hover { a:hover {
color: white; color: white;
@ -55,6 +55,11 @@ button {
font-weight: bolder; font-weight: bolder;
} }
.link{
color: rgba(0, 201, 255, 1);
text-decoration: underline;
}
.current { .current {
background: rgb(146, 254, 157); background: rgb(146, 254, 157);
background: -moz-linear-gradient( background: -moz-linear-gradient(

@ -1,98 +1,108 @@
window.onload = function () { function dashboard () {
/*data = [{ var xhr = new XMLHttpRequest();
type: "line", xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersEmail', true);
xValueFormatString: "Pierre", xhr.responseType = 'text';
dataPoints: [ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
{ x: 0, y: 0 }, var playersEmail = xhr.onload = function () {
{ x: 1, y: 50 }, console.log(xhr.responseText);
{ x: 2, y: 100 }, return JSON.parse(xhr.responseText);
{ x: 3, y: 150 }, };
{ x: 4, y: 150 }, xhr.send(null);
{ x: 5, y: 200 }, var xhr = new XMLHttpRequest();
] xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true);
}, xhr.responseType = 'text';
{ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
type: "line", var playersPseudo = xhr.onload = function () {
xValueFormatString: "Noe", return JSON.parse(xhr.responseText);
dataPoints: [
{ x: 0, y: 0 },
{ x: 1, y: 100 },
{ x: 2, y: 100 },
{ x: 3, y: 200 },
{ x: 4, y: 250 },
{ x: 5, y: 300 },
]
},
{
type: "line",
xValueFormatString: "Nathan",
dataPoints: [
{ x: 0, y: 0 },
{ x: 1, y: 75 },
{ x: 2, y: 100 },
{ x: 3, y: 150 },
{ x: 4, y: 200 },
{ x: 5, y: 250 },
]
}]*/
v1 = {
type: "line",
xValueFormatString: "Pierre",
dataPoints: [
{ x: 0, y: 0 },
{ x: 1, y: 50 },
{ x: 2, y: 100 },
{ x: 3, y: 150 },
{ x: 4, y: 150 },
{ x: 5, y: 200 },
]
} }
data = [];
v2 = { if (playersEmail[0] != null) {
type: "line", v1 = {}
xValueFormatString: "Noe", v1.type="line";
dataPoints: [ v1.xValueFormatString=playersPseudo[0];
{ x: 0, y: 0 }, v1.dataPoints=[];
{ x: 1, y: 100 }, var xhr = new XMLHttpRequest();
{ x: 2, y: 100 }, xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayerScore&joueur='. playersEmail[0], true);
{ x: 3, y: 200 }, xhr.responseType = 'text';
{ x: 4, y: 250 }, xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
{ x: 5, y: 300 }, var score = xhr.onload = function () {
] return JSON.parse(xhr.responseText);
};
xhr.send(null);
for (i = 0; i < score.length; i++) {
v1.dataPoints.push({x:i+1,y:score[i]});
}
data.push(v1);
} }
///dataPoints=[{x:0,y:0},{x:1,y:300}] if (playersEmail[1] != null) {
v2 = {}
v2.type="line";
v2.xValueFormatString=playersPseudo[1];
///v3={type:"line",xValueFormatString:"test",dataPoints}; v2.dataPoints=[];
var xhr = new XMLHttpRequest();
data = []; xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayerScore&joueur='. playersEmail[1], true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var score = xhr.onload = function () {
return JSON.parse(xhr.responseText);
};
xhr.send(null);
for (i = 0; i < score.length; i++) {
v2.dataPoints.push({x:i+1,y:score[i]});
}
data.push(v2);
}
v = {} if (playersEmail[2] != null) {
v.type="line"; v3 = {}
v.xValueFormatString="test"; v3.type="line";
v.dataPoints=[]; v3.xValueFormatString=playersPseudo[2];
v.dataPoints.push({x:0,y:0}); v3.dataPoints=[];
v.dataPoints.push({x:0.5,y:300}); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayerScore&joueur='. playersEmail[2], true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var score = xhr.onload = function () {
return JSON.parse(xhr.responseText);
};
xhr.send(null);
for (i = 0; i < score.length; i++) {
v3.dataPoints.push({x:i+1,y:score[i]});
}
data.push(v3);
}
data.push(v); if (playersEmail[3] != null) {
v4 = {}
v4.type="line";
v4.xValueFormatString=playersPseudo[3];
v4.dataPoints=[];
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayerScore&joueur='. playersEmail[3], true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var score = xhr.onload = function () {
return JSON.parse(xhr.responseText);
};
xhr.send(null);
for (i = 0; i < score.length; i++) {
v4.dataPoints.push({x:i+1,y:score[i]});
}
data.push(v4);
}
v = {} // data = [];
v.type="line";
v.xValueFormatString="toto";
v.dataPoints=[{ x: 0, y: 0 },
{ x: 1, y: 100 },
{ x: 2, y: 100 },
{ x: 3, y: 200 },
{ x: 4, y: 250 },
{ x: 5, y: 300 },];
data.push(v); // v4 = {}
///data.push(v3); // v4.type="line";
console.log(data); // v4.xValueFormatString='playersPseudo';
// v4.dataPoints=[];
// v4.dataPoints.push({x:1,y:100});
// data.push(v4);
// console.log(data);
var chart = new CanvasJS.Chart("chartContainer", { var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true, animationEnabled: true,
@ -102,7 +112,7 @@
text: "Score" text: "Score"
}, },
axisX: { axisX: {
title: "Temps", title: "Enigme",
valueFormatString: "####", valueFormatString: "####",
interval: 1 interval: 1
}, },
@ -120,4 +130,11 @@
data data
}); });
chart.render(); chart.render();
} }
window.addEventListener("load", start);
function start(){
dashboard();
setInterval('dashboard()', 10000);
}

@ -94,16 +94,16 @@
<td>Modifier</td> <td>Modifier</td>
<?php <?php
if ($enigme->getOrdre() != 0) { if ($enigme->getOrdre() != 0) {
echo "<td><a href=\"index.php?action=goToModifEnigmeSolo&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>"; echo '<td><a class="link" href=\"index.php?action=goToModifEnigmeSolo&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>"';
} }
else{ else{
echo "<td><a href=\"index.php?action=goToModifEnigmeMulti&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>"; echo '<td><a class="link" href=\"index.php?action=goToModifEnigmeMulti&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>"';
} }
?> ?>
</tr> </tr>
<tr> <tr>
<td>Supprimer</td> <td>Supprimer</td>
<?php echo "<td><a href=\"index.php?action=deleteEnigme&id=".$enigme->getIdEnigme()."\">Supprimer</a></td>"; ?> <?php echo '<td><a class="link" href=\"index.php?action=deleteEnigme&id=".$enigme->getIdEnigme()."\">Supprimer</a></td>";' ?>
</tr> </tr>
</tbody> </tbody>
</table> </table>

Loading…
Cancel
Save