Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
commit
2088859911
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class DetailPartieGateway
|
||||||
|
{
|
||||||
|
private Connection $con;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Connection $con
|
||||||
|
*/
|
||||||
|
public function __construct(Connection $con)
|
||||||
|
{
|
||||||
|
$this->con = $con;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Connection $con
|
||||||
|
*/
|
||||||
|
public function setCon(Connection $con): void
|
||||||
|
{
|
||||||
|
$this->con = $con;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function insert(DetailPartie $detailPartie)
|
||||||
|
{
|
||||||
|
$query="INSERT INTO DetailPartie VALUES (:idDetailPartie,:joueur,:partie,:enigme,:pointsObtenus,:classement)";
|
||||||
|
$this->con->executeQuery($query,array(
|
||||||
|
'idDetailPartie' => array($detailPartie->getIdDetailPartie(),PDO::PARAM_STR),
|
||||||
|
'joueur' => array($detailPartie->getJoueur(),PDO::PARAM_STR),
|
||||||
|
'partie' => array($detailPartie->getPartie(),PDO::PARAM_STR),
|
||||||
|
'enigme' => array($detailPartie->getEnigme(),PDO::PARAM_STR),
|
||||||
|
'pointsObtenus' => array($detailPartie->getPointsObtenus(),PDO::PARAM_INT),
|
||||||
|
'classement' => array($detailPartie->getClassement(),PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
public function delete(string $partie){
|
||||||
|
$query="DELETE * FROM DetailPartie WHERE partie=:partie";
|
||||||
|
$this->con->executeQuery($query,array(
|
||||||
|
'partie' => array($partie,PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
public function showAll(){
|
||||||
|
$query="SELECT * FROM DetailPartie";
|
||||||
|
$this->con->executeQuery($query);
|
||||||
|
$results=$this->con->getResults();
|
||||||
|
foreach($results as $row)
|
||||||
|
{
|
||||||
|
$row['idDetailPartie'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 3.7 MiB |
After Width: | Height: | Size: 814 KiB |
After Width: | Height: | Size: 5.5 KiB |
@ -0,0 +1,64 @@
|
|||||||
|
window.onload = function () {
|
||||||
|
var chart = new CanvasJS.Chart("chartContainer", {
|
||||||
|
animationEnabled: true,
|
||||||
|
zoomEnabled: true,
|
||||||
|
theme: "dark2",
|
||||||
|
title: {
|
||||||
|
text: "Score"
|
||||||
|
},
|
||||||
|
axisX: {
|
||||||
|
title: "Enigme",
|
||||||
|
valueFormatString: "####",
|
||||||
|
interval: 1
|
||||||
|
},
|
||||||
|
axisY: {
|
||||||
|
title: "Point",
|
||||||
|
titleFontColor: "#6D78AD",
|
||||||
|
lineColor: "#6D78AD",
|
||||||
|
gridThickness: 0,
|
||||||
|
lineThickness: 1,
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
verticalAlign: "top",
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
data: [{
|
||||||
|
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 },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "line",
|
||||||
|
xValueFormatString: "Noe",
|
||||||
|
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 },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
chart.render();
|
||||||
|
}
|
Loading…
Reference in new issue