|
|
|
@ -161,7 +161,6 @@ class PartieGateway
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$partie = $this->findLastPartie();
|
|
|
|
|
$tpsMaxPartie = 0;
|
|
|
|
|
$query = "INSERT INTO Contenir VALUES (:partie,:idEnigme,1)";
|
|
|
|
|
foreach ($lesEnigmes as $enigme) {
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
@ -169,9 +168,7 @@ class PartieGateway
|
|
|
|
|
"idEnigme" => array($enigme->getIdEnigme(), SQLITE3_INTEGER)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$tpsMaxPartie += $enigme->getTempsDeResolution();
|
|
|
|
|
}
|
|
|
|
|
$_SESSION['tpsMaxPartie'] = $tpsMaxPartie;
|
|
|
|
|
$query = "INSERT INTO Participer VALUES (:partie,:utilisateur,0)";
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
"partie" => array($partie->getIdPartie(), SQLITE3_INTEGER),
|
|
|
|
@ -320,6 +317,20 @@ class PartieGateway
|
|
|
|
|
$row = $results[0];
|
|
|
|
|
return $row['enigme'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function findAllEnigmeIdInPartie ($idPartie) : array{
|
|
|
|
|
$query = "SELECT * FROM Contenir WHERE partie = :idPartie";
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
"idPartie" => array($idPartie, SQLITE3_INTEGER)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$results = $this->con->getResults();
|
|
|
|
|
$lesEnigmes = array();
|
|
|
|
|
foreach ($results as $row){
|
|
|
|
|
$lesEnigmes[] = $row['enigme'];
|
|
|
|
|
}
|
|
|
|
|
return $lesEnigmes;
|
|
|
|
|
}
|
|
|
|
|
public function getDateDebut($idPartie) : DateTime{
|
|
|
|
|
$query = "SELECT dateDebut FROM Partie WHERE id = :idPartie";
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|