Ajout d'un admin controller +

Page admin très basique +
Maj de la classe métier Enigme et de sa Factory +
Maj de la bd +
Page d'énigme générique (faite mais pas implémenter)
ServeurDeTest
Noé GARNIER 2 years ago
parent 54681d4e41
commit a4342b09c4

@ -3,8 +3,8 @@
$rep =''; $rep ='';
// BD // BD
$dsn = './scripted.db'; // $dsn = './scripted.db';
// $dsn = 'C:\\wamp64\\www\\scripted.db'; $dsn = 'C:\\wamp64\\www\\scripted.db';
//Sel de hashage //Sel de hashage
$sel = "JeSuisUnSeldeHashageEtJeSuisUniqueEtTresSecuriseEtJeSuisTresLong"; $sel = "JeSuisUnSeldeHashageEtJeSuisUniqueEtTresSecuriseEtJeSuisTresLong";
@ -17,8 +17,10 @@ $vues['login'] = 'View/src/pages/LogSign/Login.php';
$vues['signUp'] = 'View/src/pages/LogSign/SignUp.php'; $vues['signUp'] = 'View/src/pages/LogSign/SignUp.php';
$vues['test'] = 'View/src/pages/FirstTests/FirstTest1.html'; $vues['test'] = 'View/src/pages/FirstTests/FirstTest1.html';
$vues['next'] = 'View/src/pages/FirstTests/FirstTest'; $vues['next'] = 'View/src/pages/FirstTests/FirstTest';
$vues['admin'] = 'View/src/pages/Admin.php';
// Enigme // Enigme
$vues['enigme'] = 'View/src/pages/Enigme/Palindrome.html'; // $vues['enigme'] = 'View/src/pages/Enigme/Palindrome.html';
$vues['enigme'] = 'View/src/pages/Enigme/EnigmePage.php';
$vues['chouette'] = 'View/src/pages/Enigme/Chouette.html'; $vues['chouette'] = 'View/src/pages/Enigme/Chouette.html';
$vues['cesarEncrypt'] = 'View/src/pages/Enigme/CesarEncrypt.html'; $vues['cesarEncrypt'] = 'View/src/pages/Enigme/CesarEncrypt.html';
$vues['cesarDecrypt'] = 'View/src/pages/Enigme/CesarDecrypt.html'; $vues['cesarDecrypt'] = 'View/src/pages/Enigme/CesarDecrypt.html';

@ -0,0 +1,80 @@
<?php
class AdminController extends UserController
{
function __construct()
{
try {
global $dsn, $rep, $vues, $error;
parent::__construct();
$action = $_REQUEST['action'];
//register_event_handler('add_to_queue',array($this,"onAddToQueue"));
switch ($action) {
case NULL:
$this->goToHome();
break;
case "goToHome":
$this->goToHome();
break;
case "goToAdmin":
$this->goToAdmin();
break;
case "goToPresentation":
$this->goToPresentation();
break;
case "goToEnigme":
$this->goToEnigme();
break;
case "goToTest":
$this->goToTest();
break;
case "goToChouette":
$this->goToChouette();
break;
case "goToCesarEncrypt":
$this->goToCesarEncrypt();
break;
case "goToCesarDecrypt":
$this->goToCesarDecrypt();
break;
case "goToChuckNorris":
$this->goToChuckNorris();
break;
case "goToHanoi":
$this->goToHanoi();
break;
case "goToTrianglePascal":
$this->goToTrianglePascal();
break;
case "goToDoubleElement":
$this->goToDoubleElement();
break;
case "goToNext":
$this->goToNext();
break;
case "goToQueue":
$this->goToQueue()();
break;
case "logout":
$this->logout();
break;
default:
$error = "Action non valide";
require($rep . $vues['erreur']);
break;
}
} catch (PDOException $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
} catch (Exception $e2) {
$error = $e2->getMessage();
require($rep . $vues['erreur']);
}
}
function goToAdmin()
{
global $rep, $vues;
require($rep . $vues['admin']);
}
}

@ -35,10 +35,10 @@ class EnigmeGateway
*/ */
public function insert(Enigme $enigme) public function insert(Enigme $enigme)
{ {
$query = "INSERT INTO Enigme VALUES (:id,:admin,:enonce,:aide,:rappel,:solution,:test,:tempsDeResolution,:points)"; $query = "INSERT INTO Enigme VALUES (:id,:nom,:enonce,:aide,:rappel,:solution,:test,:tempsDeResolution,:points)";
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':id' => array($enigme->getIdEnigme(),SQLITE3_INTEGER), ':id' => array($enigme->getIdEnigme(),SQLITE3_INTEGER),
':admin' => array($enigme->getAdmin(), SQLITE3_TEXT), ':nom' => array($enigme->getNom(), SQLITE3_TEXT),
':enonce' => array($enigme->getEnonce(), SQLITE3_TEXT), ':enonce' => array($enigme->getEnonce(), SQLITE3_TEXT),
':aide' => array($enigme->getAide(), SQLITE3_TEXT), ':aide' => array($enigme->getAide(), SQLITE3_TEXT),
':rappel' => array($enigme->getRappel(), SQLITE3_TEXT), ':rappel' => array($enigme->getRappel(), SQLITE3_TEXT),
@ -102,15 +102,15 @@ class EnigmeGateway
return $tabEnigme; return $tabEnigme;
} }
public function findById(string $idEnigme) : array public function findById(int $idEnigme) : array
{ {
$query="SELECT * FROM Enigme WHERE idEnigme =:idEnigme"; $query="SELECT * FROM Enigme WHERE id =:id";
$this->con->executequery($query,array( $this->con->executequery($query,array(
':idEnigme' => array($idEnigme,SQLITE3_INTEGER) ':id' => array($idEnigme,SQLITE3_INTEGER)
)); ));
$results=$this->con->getResults(); $results=$this->con->getResults();
$tabEnigme=EnigmeFactory::create($results); $enigme=EnigmeFactory::create($results);
return $tabEnigme; return $enigme;
} }
public function findByTempsDeResolution() : array public function findByTempsDeResolution() : array
@ -129,7 +129,7 @@ class EnigmeGateway
$results = $this->con->getResults(); $results = $this->con->getResults();
foreach ($results as $row) { foreach ($results as $row) {
echo $row['idEnigme'] . '</br>'; echo $row['idEnigme'] . '</br>';
echo $row['admin'] . '</br>'; echo $row['nom'] . '</br>';
echo $row['enonce'] . '</br>'; echo $row['enonce'] . '</br>';
echo $row['aide'] . '</br>'; echo $row['aide'] . '</br>';
echo $row['rappel'] . '</br>'; echo $row['rappel'] . '</br>';

@ -22,11 +22,22 @@ class FrontController
} else if (method_exists('UserController', $action) == false) { } else if (method_exists('UserController', $action) == false) {
$error = "Action non valide " . $action; $error = "Action non valide " . $action;
require($rep . $view['erreur']); require($rep . $view['erreur']);
} } else {
else {
$_REQUEST['action'] = $action; $_REQUEST['action'] = $action;
new UserController(); new UserController();
} }
}
else if ($role == "admin") {
if ($action == NULL) {
$_REQUEST['action'] = $action;
new AdminController();
} else if (method_exists('UserController', $action) == false) {
$error = "Action non valide " . $action;
require($rep . $view['erreur']);
} else {
$_REQUEST['action'] = $action;
new AdminController();
}
} else { } else {
$_REQUEST['action'] = $action; $_REQUEST['action'] = $action;
new VisitorController(); new VisitorController();

@ -77,7 +77,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['main']); require($rep . $vues['main']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -87,7 +87,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['presentation']); require($rep . $vues['presentation']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -97,7 +97,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['test']); require($rep . $vues['test']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -107,7 +107,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['enigme']); require($rep . $vues['enigme']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -117,7 +117,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['chouette']); require($rep . $vues['chouette']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -127,7 +127,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['cesarEncrypt']); require($rep . $vues['cesarEncrypt']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -137,7 +137,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['cesarDecrypt']); require($rep . $vues['cesarDecrypt']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -147,7 +147,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['chuckNorris']); require($rep . $vues['chuckNorris']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -157,7 +157,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['hanoi']); require($rep . $vues['hanoi']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -167,7 +167,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['trianglePascal']); require($rep . $vues['trianglePascal']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
@ -177,7 +177,7 @@ class UserController
global $rep, $vues; global $rep, $vues;
require($rep . $vues['doubleElement']); require($rep . $vues['doubleElement']);
} catch (Exception $e) { } catch (Exception $e) {
$error = "404"; $error = $e->getMessage();
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }

@ -5,7 +5,7 @@ class EnigmeFactory{
$tabEnigme=array(); $tabEnigme=array();
foreach($results as $row) foreach($results as $row)
{ {
$tabEnigme[]= new Enigme($row['id'],$row['admin'],$row['enonce'],$row['aide'],$row['rappel'],$row['solution'],$row['test'],$row['tempsDeResolution'],$row['points']); $tabEnigme[]= new Enigme($row['id'],$row['nom'],$row['enonce'],$row['aide'],$row['rappel'],$row['exemple'],$row['solution'],$row['test'],$row['tempsDeResolution'],$row['points']);
} }
return $tabEnigme; return $tabEnigme;
} }

@ -2,87 +2,72 @@
class Enigme class Enigme
{ {
private string $idEnigme; private int $idEnigme;
private string $nom;
private string $enonce; private string $enonce;
private string $aide; private string $aide;
private string $admin;
private string $rappel; private string $rappel;
private string $exemple;
private string $solution; private string $solution;
private string $test; private string $test;
private int $tempsDeResolution; private int $tempsDeResolution;
private int $points; private int $points;
/** /**
* @param string $idEnigme * @param int $idEnigme
* @param string $nom
* @param string $enonce * @param string $enonce
* @param string $aide * @param string $aide
* @param string $rappel * @param string $rappel
* @param string $exemple
* @param string $solution * @param string $solution
* @param string $test * @param string $test
* @param int $tempsDeResolution * @param int $tempsDeResolution
* @param int $points * @param int $points
*/ */
public function __construct() public function __construct($idEnigme, $nom = "",$enonce = "", $aide = "", $rappel = "", $exemple = "",$solution = "", $test = "", $tempsDeResolution = 0, $points = 0)
{ {
$arguments=func_get_args();
$index=func_num_args();
if(method_exists($this,$function='__construct'.$index));
call_user_func(array(array($this,$function),$arguments));
}
public function __constructMulti(string $idEnigme, string $enonce, string $solution, string $test, int $tempsDeResolution,string $admin,int $points){
$this->idEnigme=$idEnigme;
$this->enonce=$enonce;
$this->solution=$solution;
$this->test=$test;
$this->tempsDeResolution=$tempsDeResolution;
$this->aide=NULL;
$this->rappel=NULL;
$this->admin=$admin;
$this->points=$points;
}
public function __constructSolo(string $idEnigme, string $enonce, string $aide, string $rappel, string $solution, string $test,string $admin){
$this->idEnigme = $idEnigme; $this->idEnigme = $idEnigme;
$this->nom = $nom;
$this->enonce = $enonce; $this->enonce = $enonce;
$this->aide = $aide; $this->aide = $aide;
$this->rappel = $rappel; $this->rappel = $rappel;
$this->exemple = $exemple;
$this->solution = $solution; $this->solution = $solution;
$this->test = $test; $this->test = $test;
$this->tempsDeResolution=0; $this->tempsDeResolution = $tempsDeResolution;
$this->admin=$admin; $this->points = $points;
} }
/** /**
* @return string * @return int
*/ */
public function getAdmin(): string public function getIdEnigme(): int
{ {
return $this->admin; return $this->idEnigme;
} }
/** /**
* @param string $admin * @param int $idEnigme
*/ */
public function setAdmin(string $admin): void public function setIdEnigme(int $idEnigme): void
{ {
$this->admin = $admin; $this->idEnigme = $idEnigme;
} }
/** /**
* @return string * @return string
*/ */
public function getIdEnigme(): string public function getNom(): string
{ {
return $this->idEnigme; return $this->nom;
} }
/** /**
* @param string $idEnigme * @param string $nom
*/ */
public function setIdEnigme(string $idEnigme): void public function setNom(string $nom): void
{ {
$this->idEnigme = $idEnigme; $this->nom = $nom;
} }
/** /**
@ -133,6 +118,22 @@ class Enigme
$this->rappel = $rappel; $this->rappel = $rappel;
} }
/**
* @return string
*/
public function getExemple(): string
{
return $this->exemple;
}
/**
* @param string $exemple
*/
public function setExemple(string $exemple): void
{
$this->exemple = $exemple;
}
/** /**
* @return string * @return string
*/ */

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin</title>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- CSS -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="./View/src/CSS/Main.css" />
</head>
<body class="m-3">
<form>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Enigme</label>
<textarea class="form-control" name="enigme" id="enigme" rows="3"></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Rappel</label>
<textarea class="form-control" name="rappel" id="rappel" rows="3"></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Aide</label>
<textarea class="form-control" name="aide" id="aide" rows="3"></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Exemple</label>
<textarea class="form-control" name="exemple" id="exemple" rows="3"></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Solution</label>
<textarea class="form-control" name="solution" id="solution" rows="3"></textarea>
</div>
</div>
<button class="left" type="submit">
Submit
</button>
</form>
</body>

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Titre</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="View/src/CSS/Enigme.css" />
</head>
<body>
<div class="container-fluid px-5">
<!-- First Row -->
<div class="row py-4">
<div class="col-9 d-flex align-items-center px-0">
<a class="material-icons pl-0" id="home" href="index.php?action=goToHome"
style="font-size: 40px; color: white">home</a>
</div>
<button style="background-color: transparent; border: none" onclick="displayHelp()"
class="col-3 d-flex align-items-center">
<div class="col-10 text-right px-3">
<p style="font-size: 14px; color: white"><b>Besoin d'aide ?</b></p>
</div>
<div class="col-2 text-right">
<img src="View/assets/img/Foxy.png" alt="Logo" class="rounded-circle moving-fox"
style="border: 1px solid #44fff6; width: 60px; height: 60px" />
</div>
</button>
</div>
<!-- End First Row -->
<!-- Second Row -->
<div class="row">
<!-- First Column -->
<div class="col-3 rounded p-3" style="background-color: #222831; min-height: 80vh; height: auto">
<h2 class="text-left py-3" style="color: #44fff6; font-weight: 500">
<?php
$gateways = new EnigmeGateway();
$tabEnigme = $gateways->findById(1);
$enigme = $tabEnigme[0];
echo $enigme->getNom();
?>
</h2>
<p>
<?php
echo $enigme->getEnonce();
?>
</p>
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Rappel</h3>
<p>
<?php
echo $enigme->getRappel();
?>
</p>
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3>
<p>
<?php
echo $enigme->getExemple();
?>
</p>
<h3 class="text-left pb-3 pt-5 help" style="color: #44fff6; display: none">Aide</h3>
<p style="display: none" class="help">
<?php
echo $enigme->getAide();
?>
</p>
</div>
<!-- End First Column -->
<!-- Second Column -->
<div class="col-5 pr-0">
<div class="ace rounded" id="editor">
</div>
</div>
<!-- End Second Column -->
<!-- Third Column -->
<div class="col-4">
<textarea id="console" readonly style="width: 100%; min-height: 65vh; height: auto"
class="p-3 rounded"></textarea>
<div class="row pt-5 text-center" style="cursor: pointer">
<div class="col-6">
<a onclick="run_init()" class="btn">
<span>Run</span>
</a>
</div>
<div class="col-6">
<button onclick="submit()" class="btn" data-toggle="modal" data-target="#modal">
<span>Submit</span>
</button>
</div>
</div>
</div>
<!-- End Third Column -->
</div>
<!-- End Second Row -->
</div>
<!-- Modal -->
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="exampleModalLongTitle" style="color: black">
Results
</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h5 id="result" style="color: black"></h5>
</div>
<div class="modal-footer">
<a href="index.php?action=goToChouette" class="btn" style="display: none" id="next">
<span>NEXT</span>
</a>
</div>
</div>
</div>
</div>
<!-- End Modal -->
<script src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js" type="text/javascript"
charset="utf-8"></script>
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
type="text/javascript" charset="utf-8"></script>
<script src="View/src/JS/base.js"></script>
<?php
echo '<script src="View/src/JS/' . $enigme->getNom() . '.js"></script>';
?>
</body>
</html>

@ -185,6 +185,6 @@
charset="utf-8" charset="utf-8"
></script> ></script>
<script src="View/src/JS/base.js"></script> <script src="View/src/JS/base.js"></script>
<script src="View/src/JS/palindrome.js"></script> <script src="View/src/JS/Palindrome.js"></script>
</body> </body>
</html> </html>

@ -18,20 +18,20 @@
if ($error == 400){ if ($error == 400){
echo '<h1>Error <span class="errorcode">404</span></h1>'; echo '<h1>Error <span class="errorcode">404</span></h1>';
echo '<p class="output">La page que vous recherchez a peut-être été supprimée, a changé de nom ou est temporairement indisponible.</p>'; echo '<p class="output">La page que vous recherchez a peut-être été supprimée, a changé de nom ou est temporairement indisponible.</p>';
echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goTo?page=main">retourné à la page d\'accueil</a>.</p>'; echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goToHome">retourné à la page d\'accueil</a>.</p>';
echo '<p class="output">Bonne Chance Utilisateur.</p>'; echo '<p class="output">Bonne Chance Utilisateur.</p>';
} }
elseif ($error == ""){ elseif ($error == ""){
echo '<h1>Error <span class="errorcode">000</span></h1>'; echo '<h1>Error <span class="errorcode">000</span></h1>';
echo '<p class="output">Erreur inconnue</p>'; echo '<p class="output">Erreur inconnue</p>';
echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goTo?page=main">retourné à la page d\'accueil</a>.</p>'; echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goToHome">retourné à la page d\'accueil</a>.</p>';
echo '<p class="output">Bonne Chance Utilisateur.</p>'; echo '<p class="output">Bonne Chance Utilisateur.</p>';
} }
else{ else{
echo '<h1>Error <span class="errorcode">000</span></h1>'; echo '<h1>Error <span class="errorcode">000</span></h1>';
echo '<p class="output">'.$error.'</p>'; echo '<p class="output">'.$error.'</p>';
echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goTo?page=main">retourné à la page d\'accueil</a>.</p>'; echo '<p class="output">Veuillez essayer de <a href="javascript:history.back()">retourner en arrière</a> ou de <a href="index.php?action=goToHome">retourné à la page d\'accueil</a>.</p>';
echo '<p class="output">Bonne Chance Utilisateur.</p>'; echo '<p class="output">Bonne Chance Utilisateur.</p>';
} }
?> ?>

@ -19,9 +19,11 @@ estAdmin boolean
CREATE TABLE Enigme( CREATE TABLE Enigme(
id integer PRIMARY KEY AUTOINCREMENT, id integer PRIMARY KEY AUTOINCREMENT,
nom varchar(50),
enonce varchar(250) NOT NULL, enonce varchar(250) NOT NULL,
aide varchar(250), aide varchar(250),
rappel varchar(250), rappel varchar(250),
exemple varchar(250),
solution varchar(250) NOT NULL, solution varchar(250) NOT NULL,
test varchar(250) NOT NULL, test varchar(250) NOT NULL,
tempsDeResolution numeric CHECK (tempsDeResolution >0), tempsDeResolution numeric CHECK (tempsDeResolution >0),

@ -3,36 +3,7 @@ require_once('./Config/Config.php');
require_once('./Config/Autoload.php'); require_once('./Config/Autoload.php');
Autoload::charger(); Autoload::charger();
// echo "test1\n";
// try {
// $con = new Connection($dsn);
// // $query = "INSERT INTO Utilisateur VALUES (:email,:pseudo,:mdp,:estAdmin)";
// // $con->executeQuery($query, array(
// // ':email' => array("SUPERsuper", SQLITE3_TEXT),
// // ':pseudo' => array("dragon", SQLITE3_TEXT),
// // ':mdp' => array("qsdfgyutfcvbghytrfcvgbtfcvgh", SQLITE3_TEXT),
// // ':estAdmin' => array(0, SQLITE3_INTEGER)
// // ));
// $query = "SELECT * FROM Utilisateur";
// $con->executeQuery($query);
// $results = $con->getResults();
// foreach ($results as $row) {
// echo $row['email'] . '</br>';
// echo $row['pseudo'] . '</br>';
// echo $row['mdp'] . '</br>';
// echo $row['estAdmin'] . '</br>';
// }
// }
// catch (PDOException $e) {
// echo $e->getMessage();
// }
// catch (Exception $e2) {
// echo $e2->getMessage();
// }
$control = new FrontController(); $control = new FrontController();
// echo "test2\n";
//session_regenerate_id(true); //session_regenerate_id(true);
// session_unset(); // session_unset();

Loading…
Cancel
Save