|
|
@ -12,7 +12,9 @@ class EnigmeGateway
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->con = $con;
|
|
|
|
$this->con = $con;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function insert(string $idEnigme, string $admin, string $enonce, string $aide,string $rappel,string $solution,string $test,float $tempsDeResolution){
|
|
|
|
|
|
|
|
|
|
|
|
public function insert(string $idEnigme, string $admin, string $enonce, string $aide, string $rappel, string $solution, string $test, float $tempsDeResolution)
|
|
|
|
|
|
|
|
{
|
|
|
|
$query = "INSERT INTO Enigme VALUES (:idEnigme,:admin,:enonce,:aide,:rappel,:solution,:test,:tempsDeResolution)";
|
|
|
|
$query = "INSERT INTO Enigme VALUES (:idEnigme,:admin,:enonce,:aide,:rappel,:solution,:test,:tempsDeResolution)";
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
':idEnigme' => array($idEnigme, PDO::PARAM_STR),
|
|
|
|
':idEnigme' => array($idEnigme, PDO::PARAM_STR),
|
|
|
@ -24,5 +26,37 @@ class EnigmeGateway
|
|
|
|
':test' => array($tempsDeResolution, PDO::PARAM_STR)
|
|
|
|
':test' => array($tempsDeResolution, PDO::PARAM_STR)
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function delete(string $idEnigme)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$query= "DELETE FROM Enigme WHERE idEnigme=:idEnigme";
|
|
|
|
|
|
|
|
$this->con->executequery($query, array(
|
|
|
|
|
|
|
|
':idEnigme' => array($idEnigme,PDO::PARAM_STR)
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function findById(string $idEnigme)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$query="SELECT * FROM Enigme WHERE idEnigme =:idEnigme";
|
|
|
|
|
|
|
|
$this->con->executequery($query,array(
|
|
|
|
|
|
|
|
':idEnigme' => array($idEnigme,PDO::PARAM_STR)
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function showAll(): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$query = "SELECT * FROM Enigme";
|
|
|
|
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
|
|
|
|
$results = $this->con->getResults();
|
|
|
|
|
|
|
|
foreach ($results as $row) {
|
|
|
|
|
|
|
|
echo $row['idEnigme'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['admin'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['enonce'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['aide'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['rappel'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['solution'] . '</br>';
|
|
|
|
|
|
|
|
echo $row['test'] . '</br>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|