Merge branch 'master' of https://codefirst.iut.uca.fr/git/celles-qui-obtiendront-la-recompense/phpProject
commit
bcdd70aec9
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -1,14 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require_once(__DIR__.'/controleurs/FrontControleur.php');
|
||||||
|
|
||||||
// Chargement config
|
// Chargement config
|
||||||
require_once(__DIR__.'/config/config.php');
|
require_once(__DIR__.'/config/config.php');
|
||||||
|
|
||||||
// Autoload des classes
|
// Autoload des classes
|
||||||
require_once(__DIR__.'/config/Autoload.php');
|
//require_once(__DIR__.'/config/Autoload.php');
|
||||||
Autoload::charger();
|
//Autoload::charger();
|
||||||
|
|
||||||
|
require_once(__DIR__.'/config/Validation.php');
|
||||||
|
require_once(__DIR__.'/controleurs/ControleurUtilisateur.php');
|
||||||
|
require_once(__DIR__.'/controleurs/ControleurVisiteur.php');
|
||||||
|
require_once(__DIR__.'/controleurs/FrontControleur.php');
|
||||||
|
require_once(__DIR__.'/modeles/Gateways/Connection.php');
|
||||||
|
require_once(__DIR__.'/modeles/Gateways/ListeGateway.php');
|
||||||
|
require_once(__DIR__.'/modeles/Gateways/UserGateway.php');
|
||||||
|
require_once(__DIR__.'/modeles/Métier/Liste.php');
|
||||||
|
require_once(__DIR__.'/modeles/Métier/Tache.php');
|
||||||
|
require_once(__DIR__.'/modeles/Métier/Utilisateur.php');
|
||||||
|
require_once(__DIR__.'/modeles/Modele/UserModel.php');
|
||||||
|
require_once(__DIR__.'/modeles/Modele/VisiteurModel.php');
|
||||||
|
require_once(__DIR__.'/modeles/Modele/ListModel.php');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Construction du controleur
|
// Construction du controleur
|
||||||
$cont=new FrontControleur();
|
//$cont=new FrontControleur();
|
||||||
|
$cont= new FrontControleur();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ListeModel{
|
||||||
|
public $listgw;
|
||||||
|
|
||||||
|
function __construct(){
|
||||||
|
global $rep,$vues,$bd;
|
||||||
|
$co = new Connection($bd['dsn'],$bd['user'],$bd['pswd']);
|
||||||
|
$this->listgw = new ListeGateway($co);
|
||||||
|
}
|
||||||
|
|
||||||
|
function creerListe(string $nom, $private){
|
||||||
|
if(isset($_SESSION['login'])){
|
||||||
|
if($private="on"){
|
||||||
|
$this->listgw->creerListe($nom,$_SESSION['login']);
|
||||||
|
}else{
|
||||||
|
$this->listgw->creerListe($nom,null);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$this->listgw->creerListe($nom,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -1,27 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Liste {
|
class Liste {
|
||||||
private int $id;
|
public int $id;
|
||||||
private string $nom;
|
public string $nom;
|
||||||
private int $idCreator;
|
public ?string $nomCreateur;
|
||||||
|
public ?array $taches;
|
||||||
|
|
||||||
function __construct(int $i, string $n, $t){
|
function __construct(int $i, string $n, ?string $nomCrea,?array $t){
|
||||||
$this->id=$i;
|
$this->id=$i;
|
||||||
$this->nom=$n;
|
$this->nom=$n;
|
||||||
|
$this->nomCreateur=$nomCrea;
|
||||||
$this->taches=$t;
|
$this->taches=$t;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_id(): int {
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_nom(): string {
|
|
||||||
return $this->nom;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_idCreator(): array {
|
|
||||||
return $this->taches;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -1,31 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
Class Tache {
|
Class Tache {
|
||||||
private int $id;
|
public int $id;
|
||||||
private string $intitule;
|
public string $nom;
|
||||||
private boolean $isCompleted;
|
public bool $isCompleted;
|
||||||
private int $idListe;
|
public int $idListe;
|
||||||
|
|
||||||
function __construct(int $i, string $in, boolean $is){
|
function __construct(int $i, string $in, bool $is, int $idListe){
|
||||||
$this->id = $i;
|
$this->id = $i;
|
||||||
$this->intitule = $in;
|
$this->nom = $in;
|
||||||
$this->isCompleted = $is;
|
$this->isCompleted = $is;
|
||||||
}
|
$this->idListe=$idListe;
|
||||||
|
|
||||||
function get_id(): int {
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_intitule(): string {
|
|
||||||
return $this->intitule;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_isCompleted(): boolean {
|
|
||||||
return $this->isCompleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_idListe(): string {
|
|
||||||
return $this->idListe;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<h3>Create a new list</h3>
|
||||||
|
<form method="POST" name="creaListe" id="creaListe">
|
||||||
|
<p>Name of the liste
|
||||||
|
<input type="text" name="name" id="name" required/></p>
|
||||||
|
<?php
|
||||||
|
if(isset($_SESSION['login'])){
|
||||||
|
echo '<input type="checkbox" id="private" name="private[]">
|
||||||
|
<label for="private">Private List?</label>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<input class="button" type="submit" value="Create List"/>
|
||||||
|
<input type="hidden" name="action" value="creerListe"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<h2>Private Lists</h2>
|
||||||
|
<?php
|
||||||
|
if (isset($dataView)) {
|
||||||
|
foreach ($dataView as $liste){
|
||||||
|
echo $liste->nom;
|
||||||
|
echo '<br/>';
|
||||||
|
if($liste->taches != null){
|
||||||
|
foreach($liste->taches as $tache){
|
||||||
|
echo ' * '.$tache->nom;
|
||||||
|
echo '<br/>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>What you wanna young padawan?</h2>
|
||||||
|
<div>
|
||||||
|
<form method="POST" name="deconnection">
|
||||||
|
<input class="button" type="submit" value="Déconnection"/>
|
||||||
|
<input type="hidden" name="action" value="deconnection"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<form method="POST" name="desincription">
|
||||||
|
<input class="button" type="submit" value="Desinscription"/>
|
||||||
|
<input type="hidden" name="action" value="desinscription"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Binary file not shown.
@ -0,0 +1,33 @@
|
|||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 40px;
|
||||||
|
padding-bottom: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin {
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="text"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
Loading…
Reference in new issue