Maj page admin +

Correction de bug image de profil admin
ServeurDeTest
Noé GARNIER 2 years ago
parent 98f9ba9e27
commit aa83b57d90

@ -27,8 +27,10 @@ $vues['next'] = 'View/src/pages/FirstTests/FirstTest';
//Admin
$vues['admin'] = 'View/src/pages/Admin/Admin.php';
$vues['addEnigmeSolo'] = 'View/src/pages/Admin/AddEnigmeSolo.php';
$vues['addEnigmeMulti'] = 'View/src/pages/Admin/AddEnigmeMulti.php';
$vues['detailEnigme'] = 'View/src/pages/Admin/DetailEnigme.php';
$vues['modifEnigmeSolo'] = 'View/src/pages/Admin/ModifEnigmeSolo.php';
$vues['modifEnigmeMulti'] = 'View/src/pages/Admin/ModifEnigmeMulti.php';
$vues['adminSolo'] = 'View/src/pages/Admin/AdminExtendSolo.php';
$vues['adminMulti'] = 'View/src/pages/Admin/AdminExtendMulti.php';
$vues['seeOrdre'] = 'View/src/pages/Admin/SeeOrdre.php';

@ -39,18 +39,27 @@ class AdminController extends UserController
case "goToAddEnigmeSolo":
$this->goToAddEnigmeSolo();
break;
case "goToAddEnigmeMulti":
$this->goToAddEnigmeMulti();
break;
case "logout":
$this->logout();
break;
case "addNewEnigmeSolo":
$this->addNewEnigmeSolo();
break;
case "addNewEnigmeMulti":
$this->addNewEnigmeMulti();
break;
case "goToDetailEnigme":
$this->goToDetailEnigme();
break;
case "goToModifEnigmeSolo":
$this->goToModifEnigmeSolo();
break;
case "goToModifEnigmeMulti":
$this->goToModifEnigmeMulti();
break;
case "goToAdminSolo":
$this->goToAdminSolo();
break;
@ -112,6 +121,7 @@ class AdminController extends UserController
global $rep, $vues;
$model = new AdminModel();
$lesEnigmesSolo = $model->getEnigmesSolo();
$lesEnigmesMulti = $model->getEnigmesMulti();
require($rep . $vues['admin']);
} catch (Exception $e) {
$error = $e->getMessage();
@ -128,6 +138,15 @@ class AdminController extends UserController
require($rep . $vues['erreur']);
}
}
public function goToAddEnigmeMulti(){
try {
global $rep, $vues;
require($rep . $vues['addEnigmeMulti']);
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
}
}
public function goToDetailEnigme()
{
try {
@ -152,6 +171,18 @@ class AdminController extends UserController
require($rep . $vues['erreur']);
}
}
public function goToModifEnigmeMulti()
{
try {
global $rep, $vues;
$model = new AdminModel();
$enigme = $model->getEnigmeById($_GET['id']);
require($rep . $vues['modifEnigmeMulti']);
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
}
}
public function goToAdminSolo()
{
try {
@ -168,8 +199,8 @@ class AdminController extends UserController
{
try {
global $rep, $vues;
// $model = new AdminModel();
// $lesEnigmesSolo = $model->getEnigmesSolo();
$model = new AdminModel();
$lesEnigmesMulti = $model->getEnigmesMulti();
require($rep . $vues['adminMulti']);
} catch (Exception $e) {
$error = $e->getMessage();
@ -226,7 +257,17 @@ class AdminController extends UserController
$test = $_POST['test'];
$solution = $_POST['solution'];
$prompt = $_POST['prompt'];
$enigme = $model->editEnigme($id, $nom, $enonce, $aide, $rappel, $exemple, $test, $solution, $prompt);
if (isset($_POST['points'])) {
$points = $_POST['points'];
} else {
$points = 0;
}
if (isset($_POST['tempsDeResolution'])){
$tempsDeResolution = $_POST['tempsDeResolution'];
} else {
$tempsDeResolution = 0;
}
$enigme = $model->editEnigme($id, $nom, $enonce, $aide, $rappel, $exemple, $test, $solution, $prompt, $points, $tempsDeResolution);
echo '<script>alert("L\'énigme a bien été modifier.");</script>';
require($rep . $vues['detailEnigme']);
}
@ -301,4 +342,39 @@ class AdminController extends UserController
require($rep . $vues['erreur']);
}
}
public function addNewEnigmeMulti()
{
try {
global $rep, $vues;
$model = new AdminModel();
$nom = $_POST['nom'];
$enonce = $_POST['enigme'];
$aide = $_POST['aide'];
$rappel = $_POST['rappel'];
$exemple = $_POST['exemple'];
$test = $_POST['test'];
$solution = $_POST['solution'];
$prompt = $_POST['prompt'];
$points = $_POST['points'];
$tempsDeResolution = $_POST['tempsDeResolution'];
if (empty($nom) || empty($enonce) || empty($test) || empty($solution) || empty($points) || empty($tempsDeResolution)) {
throw new Exception("Les champs nom, enigme, test, solution, points et temps de résolution doivent être remplis");
}
if (empty($aide)) {
$aide = "Il n'y a pas d'aide pour cette énigme";
}
if (empty($rappel)) {
$rappel = "Il n'y a pas de rappel pour cette énigme";
}
if (empty($exemple)) {
$exemple = "Il n'y a pas d'exemple pour cette énigme";
}
$enigme = $model->addNewEnigmeMulti($nom, $enonce, $aide, $rappel, $exemple, $test, $solution, $prompt, $points, $tempsDeResolution);
echo '<script>alert("L\'énigme a bien été ajouté.");</script>';
$this->goToAdmin();
} catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
}
}
}

@ -94,7 +94,8 @@ class EnigmeGateway
public function findMultiEnigma() : array
{
$query = "SELECT * FROM Enigme
WHERE points IS NOT NULL OR points != 0";
WHERE points != 0
AND tempsDeResolution IS NOT NULL OR tempsDeResolution != 0";
$this->con->executeQuery($query);
$tabEnigme=EnigmeFactory::create($this->con->getResults());
return $tabEnigme;
@ -180,7 +181,10 @@ class EnigmeGateway
public function getRandomEnigme() : Enigme
{
$query = "SELECT * FROM Enigme WHERE ordre = 0 ORDER BY RANDOM() LIMIT 1";
$query = "SELECT * FROM Enigme
WHERE points IS NOT NULL OR points != 0
AND tempsDeResolution IS NOT NULL OR tempsDeResolution != 0
ORDER BY RANDOM() LIMIT 1";
$this->con->executequery($query);
$results = $this->con->getResults();
if (empty($results)){

@ -33,6 +33,29 @@ class AdminModel
if (is_resource($js)) {
fwrite($js, "//~ Function that test the user code
async function submit(){
var test = editor.getValue()+`\\n\n". $solution . "\n". $test . "\n`;
exec(\"print ('True')\", \"code\");
exec(test, \"solution\");
result.innerHTML = \"Test en cours...\";
await new Promise(r => setTimeout(r, 1500));
check();
}");
fclose($js);
} else {
throw new Exception("Impossible d'ouvrir le fichier");
}
return $tabEnigme[0];
}
public function addNewEnigmeMulti(string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution, string $prompt, int $points, int $tempsDeResolution) : Enigme
{
$enigme = new Enigme(1,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test, 0, $tempsDeResolution, $points, $prompt);
$this->enigme_gateway->insert($enigme);
$tabEnigme = $this->enigme_gateway->findLastEnigma();
$js = fopen("View/src/JS/$nom.js", "w");
if (is_resource($js)) {
fwrite($js, "//~ Function that test the user code
async function submit(){
var test = editor.getValue()+`\\n\n". $solution . "\n". $test . "\n`;
exec(\"print ('True')\", \"code\");
@ -82,11 +105,15 @@ async function submit(){
{
return $this->enigme_gateway->findSoloEnigma();
}
public function getEnigmesMulti() : array
{
return $this->enigme_gateway->findMultiEnigma();
}
public function getEnigmeById (int $id) : Enigme
{
return $this->enigme_gateway->findById($id)[0];
}
public function editEnigme(int $id, string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution, string $prompt) : Enigme
public function editEnigme(int $id, string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution, string $prompt, int $points, int $tempsDeResolution) : Enigme
{
$old = $this->enigme_gateway->findById($id)[0];
$ordre = $old->getOrdre();
@ -98,7 +125,7 @@ async function submit(){
$test = trim($test);
$solution = trim($solution);
$prompt = trim($prompt);
$enigme = new Enigme($id,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test, $ordre, 0, 0, $prompt);
$enigme = new Enigme($id,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test, $ordre, $tempsDeResolution, $points, $prompt);
$this->enigme_gateway->update($enigme);
$js = fopen("View/src/JS/$nom.js", "w");
if (is_resource($js)) {

@ -219,7 +219,7 @@ button {
.user-box input:valid ~ label {
top: -20px;
left: 0;
color: #be5631;
color: rgba(146, 254, 157, 1);
font-size: 12px;
}

@ -0,0 +1,92 @@
<!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"
/>
</head>
<body class="m-3">
<div>
<a class="btn btn-primary m-3" href="index.php?action=goToAdmin" role="button">Retour</a>
<h1 class="text-center">Ajouter un énigme</h1>
</div>
<form action="index.php?action=addNewEnigmeMulti" method="POST">
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Nom</label>
<textarea class="form-control" name="nom" id="nom" rows="3" required></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Enigme</label>
<textarea class="form-control" name="enigme" id="enigme" rows="3" required></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" required></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Test</label>
<textarea class="form-control" name="test" id="test" rows="3" required></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Prompt, ce qu'il sera écrit par défaut dans l'éditeur</label>
<textarea class="form-control" name="prompt" id="prompt" rows="3"></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Points</label>
<input type="number" class="form-control" name="points" id="points" rows="3" required></input>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Temps de résolution (en seconde)</label>
<input type="number" class="form-control" name="tempsDeResolution" id="tempsDeResolution" rows="3" required></input>
</div>
</div>
<button class="left" type="submit">
Submit
</button>
</form>
</body>

@ -69,7 +69,7 @@
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Prompt, ce qu'il sera écrit par défaut dans l'éditeur</label>
<textarea class="form-control" name="prompt" id="prompt" rows="3" required></textarea>
<textarea class="form-control" name="prompt" id="prompt" rows="3"></textarea>
</div>
</div>
<button class="left" type="submit">

@ -109,7 +109,7 @@
echo '<h6>' . $enigmeSolo->getOrdre(). '</h6>';
echo '</div>';
echo '<div class="col pr-4">';
echo '<a class="font" href=index.php?action=goToDetailEnigme&id='.$enigmeSolo->getIdEnigme().'>' . $enigmeSolo->getNom() . '</a>';
echo '<a class="font" href="index.php?action=goToDetailEnigme&id='.$enigmeSolo->getIdEnigme().'">' . $enigmeSolo->getNom() . '</a>';
echo '</div>';
echo '<div class="col-2 d-flex justify-content-center">';
echo '<a href="index.php?action=goToSeeOrdre">';
@ -142,7 +142,7 @@
<h6 class="legend">Nom Énigme</h6>
</div>
<div class="col-2 d-flex justify-content-end">
<a href="" class="send py-1 px-2 d-flex align-items-center">
<a href="index.php?action=goToAddEnigmeMulti" class="send py-1 px-2 d-flex align-items-center">
<svg class="mr-2" width="20px" height="20px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g stroke="currentColor" stroke-linecap="round" stroke-width="2"> <path d="M12 19V5"></path> <path d="M19 12H5"></path> </g> </g></svg>
Add
</a>
@ -151,19 +151,23 @@
<!-- End Legend part -->
<!-- Pour chaque Enigme dans la BD -->
<div class="row px-3 pt-4 pb-2 mx-0 d-flex align-items-baseline" style="border-top: 1px solid #323232">
<div class="col-3">
<h6>1</h6>
</div>
<div class="col pr-4">
<h6>Enigme 1</h6>
</div>
<div class="col-2 d-flex justify-content-center">
<a href="">
<svg fill="currentColor" width="20px" height="20px" viewBox="0 0 24 24" id="more-vertical" data-name="Flat Line" xmlns="http://www.w3.org/2000/svg" class="icon flat-line" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_iconCarrier"><line id="primary-upstroke" x1="12" y1="5.95" x2="12" y2="6.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-2" data-name="primary-upstroke" x1="12" y1="11.95" x2="12" y2="12.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-3" data-name="primary-upstroke" x1="12" y1="17.95" x2="12" y2="18.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line></g></svg>
</a>
</div>
</div>
<?php
foreach ($lesEnigmesMulti as $enigmeMulti) {
echo '<div class="row px-3 pt-4 pb-2 mx-0 d-flex align-items-baseline" style="border-top: 1px solid #323232">';
echo '<div class="col-3">';
echo '<h6> X </h6>';
echo '</div>';
echo '<div class="col pr-4">';
echo '<a class="font" href="index.php?action=goToDetailEnigme&id='.$enigmeMulti->getIdEnigme().'">' . $enigmeMulti->getNom() . '</a>';
echo '</div>';
echo '<div class="col-2 d-flex justify-content-center">';
echo '<a href="#">';
echo '<svg fill="currentColor" width="20px" height="20px" viewBox="0 0 24 24" id="more-vertical" data-name="Flat Line" xmlns="http://www.w3.org/2000/svg" class="icon flat-line" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_iconCarrier"><line id="primary-upstroke" x1="12" y1="5.95" x2="12" y2="6.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-2" data-name="primary-upstroke" x1="12" y1="11.95" x2="12" y2="12.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-3" data-name="primary-upstroke" x1="12" y1="17.95" x2="12" y2="18.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line></g></svg>';
echo '</a>';
echo '</div>';
echo '</div>';
}
?>
<!-- End Pour chaque Enigme dans la BD -->
</div>
<!-- End Enigme Multi -->

@ -88,23 +88,33 @@
<h6 class="legend">Nom Énigme</h6>
</div>
<div class="col-2"></div>
<div class="col-2 d-flex justify-content-center">
<a href="index.php?action=goToAddEnigmeMulti" class="send py-1 px-2 d-flex align-items-center">
<svg class="mr-2" width="20px" height="20px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g stroke="currentColor" stroke-linecap="round" stroke-width="2"> <path d="M12 19V5"></path> <path d="M19 12H5"></path> </g> </g></svg>
Add
</a>
</div>
</div>
<!-- End Legend part -->
<!-- Pour chaque Enigme dans la BD -->
<div class="row px-3 pt-4 pb-2 mx-0 d-flex align-items-baseline" style="border-top: 1px solid #323232">
<div class="col-3">
<h6>1</h6>
</div>
<div class="col pr-4">
<h6>Énigme 1</h6>
</div>
<div class="col-2 d-flex justify-content-end">
<a href="">
<svg fill="currentColor" width="20px" height="20px" viewBox="0 0 24 24" id="more-vertical" data-name="Flat Line" xmlns="http://www.w3.org/2000/svg" class="icon flat-line" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_iconCarrier"><line id="primary-upstroke" x1="12" y1="5.95" x2="12" y2="6.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-2" data-name="primary-upstroke" x1="12" y1="11.95" x2="12" y2="12.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-3" data-name="primary-upstroke" x1="12" y1="17.95" x2="12" y2="18.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line></g></svg>
</a>
</div>
</div>
<?php
foreach ($lesEnigmesMulti as $enigmeMulti) {
echo '<div class="row px-3 pt-4 pb-2 mx-0 d-flex align-items-baseline" style="border-top: 1px solid #323232">';
echo '<div class="col-3">';
echo '<h6> X </h6>';
echo '</div>';
echo '<div class="col pr-4">';
echo '<a class="font" href=#>' . $enigmeMulti->getNom() . '</a>';
echo '</div>';
echo '<div class="col-2 d-flex justify-content-center">';
echo '<a href="#">';
echo '<svg fill="currentColor" width="20px" height="20px" viewBox="0 0 24 24" id="more-vertical" data-name="Flat Line" xmlns="http://www.w3.org/2000/svg" class="icon flat-line" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_iconCarrier"><line id="primary-upstroke" x1="12" y1="5.95" x2="12" y2="6.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-2" data-name="primary-upstroke" x1="12" y1="11.95" x2="12" y2="12.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line><line id="primary-upstroke-3" data-name="primary-upstroke" x1="12" y1="17.95" x2="12" y2="18.05" style="fill: none; stroke: #ffffff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line></g></svg>';
echo '</a>';
echo '</div>';
echo '</div>';
}
?>
<!-- End Pour chaque Enigme dans la BD -->
</div>
</div>

@ -34,10 +34,15 @@
<th scope="col">Donnée</th>
</tr>
</thead>
<tbody><tr>
<td>Ordre</td>
<?php echo "<td>".$enigme->getOrdre()."</td>"; ?>
</tr>
<tbody>
<?php
if ($enigme->getOrdre() != 0){
echo '<tr>';
echo '<td>Ordre</td>';
echo "<td>".$enigme->getOrdre()."</td>";
echo '</tr>';
}
?>
<tr>
<td>Nom</td>
<?php echo "<td>".$enigme->getNom()."</td>"; ?>
@ -70,9 +75,28 @@
<td>Prompt</td>
<?php echo "<td>".$enigme->getPrompt()."</td>"; ?>
</tr>
<?php
if ($enigme->getPoints() != 0 && $enigme->getTempsDeResolution() != 0){
echo '<tr>';
echo '<td>Points</td>';
echo "<td>".$enigme->getPoints()."</td>";
echo '</tr>';
echo '<tr>';
echo '<td>Temps de résolution</td>';
echo "<td>".$enigme->getTempsDeResolution()."</td>";
echo '</tr>';
}
?>
<tr>
<td>Modifier</td>
<?php echo "<td><a href=\"index.php?action=goToModifEnigmeSolo&id=".$enigme->getIdEnigme()."\">Modifier</a></td>"; ?>
<?php
if ($enigme->getOrdre() != 0) {
echo "<td><a href=\"index.php?action=goToModifEnigmeSolo&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>";
}
else{
echo "<td><a href=\"index.php?action=goToModifEnigmeMulti&id=" . $enigme->getIdEnigme() . "\">Modifier</a></td>";
}
?>
</tr>
<tr>
<td>Supprimer</td>

@ -0,0 +1,93 @@
<!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"
/>
</head>
<body class="m-3">
<div>
<a class="btn btn-primary m-3" href="index.php?action=goToAdmin" role="button">Retour</a>
<h1> Modifier une énigme </h1>
</div>
<form
<?php echo 'action="index.php?action=editEnigme&id='. $enigme->getIdEnigme() .'"'; ?>
method="POST">
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Nom</label>
<textarea class="form-control" name="nom" id="nom" rows="3" required><?php echo $enigme->getNom(); ?></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Enigme</label>
<textarea class="form-control" name="enigme" id="enigme" rows="3" required><?php echo $enigme->getEnonce(); ?></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"><?php echo $enigme->getRappel(); ?></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"><?php echo $enigme->getAide(); ?></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"> <?php echo $enigme->getExemple(); ?></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" required><?php echo $enigme->getSolution(); ?></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Test</label>
<textarea class="form-control" name="test" id="test" rows="3" required> <?php echo $enigme->getTest(); ?></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Prompt, ce qu'il sera écrit par défaut dans l'éditeur</label>
<textarea class="form-control" name="prompt" id="prompt" rows="3"><?php echo $enigme->getPrompt(); ?></textarea>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Points</label>
<input type="number" value="<?php echo $enigme->getPoints(); ?>" class="form-control" name="points" id="points" rows="3" required></input>
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Temps de résolution (en seconde)</label>
<input type="number" value="<?php echo $enigme->getTempsDeResolution(); ?>" class="form-control" name="tempsDeResolution" id="tempsDeResolution" rows="3" required></input>
</div>
</div>
<button class="left" type="submit">
Submit
</button>
</form>
</body>

@ -70,7 +70,7 @@
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Prompt, ce qu'il sera écrit par défaut dans l'éditeur</label>
<textarea class="form-control" name="prompt" id="prompt" rows="3" required><?php echo $enigme->getPrompt(); ?></textarea>
<textarea class="form-control" name="prompt" id="prompt" rows="3"><?php echo $enigme->getPrompt(); ?></textarea>
</div>
</div>
<button class="left" type="submit">

@ -68,7 +68,7 @@
</div>';
} elseif (isset($_SESSION['role']) && $_SESSION['role'] == 'admin') {
echo '<img
src="./View/assets/img/CyberpunkGirl4.png"
src="./View/assets/img/ProfilPicture.png"
alt="Profil"
id="imgProfil"
class="img-fluid rounded-circle align-self-center user-select-none"

@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>GameEnd</title>
<title>Scripted</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"

Loading…
Cancel
Save