Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
36e3c6f531
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
class AdminModel
|
||||||
|
{
|
||||||
|
|
||||||
|
private EnigmeGateway $enigme_gateway;
|
||||||
|
private Nettoyage $nettoyage;
|
||||||
|
private Validation $validation;
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
global $error, $view, $rep;
|
||||||
|
$this->enigme_gateway = new EnigmeGateway();
|
||||||
|
$this->nettoyage = new Nettoyage();
|
||||||
|
$this->validation = new Validation();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addNewEnigmeSolo(string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution) : Enigme
|
||||||
|
{
|
||||||
|
$enigme = new Enigme(1,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test);
|
||||||
|
$this->enigme_gateway->insert($enigme);
|
||||||
|
$tabEnigme = $this->enigme_gateway->findLastEnigma();
|
||||||
|
return $tabEnigme[0];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
<!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">
|
||||||
|
<form action="index.php?action=addNewEnigmeSolo" 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"></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"></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>
|
||||||
|
<div class="col">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="" class="form-label">Test</label>
|
||||||
|
<textarea class="form-control" name="test" id="test" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="left" type="submit">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
|
Loading…
Reference in new issue