Compare commits
95 Commits
@ -0,0 +1,52 @@
|
||||
Anna BOUDOUL
|
||||
|
||||
Nicolas FRANCO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Ce qui a été fait depuis l'oral:
|
||||
|
||||
- fonction `loadPrivateList` de la classe `TaskModel`
|
||||
* utilise deux nouvelles fonctions: `findUserList` et `findListTask` du gateway pour charger les listes privées d'un user
|
||||
|
||||
- fonction `loadPublicLists` de la classe `TaskModel`
|
||||
* utilise deux fonctions: `findPublicList` et `findListTask` du gateway pour charger les listes publiques
|
||||
|
||||
- vue home.php
|
||||
* correction de la fonction `isConnected` qui est nécessaire dans cette vue
|
||||
|
||||
- contrôleur user
|
||||
* constructeur
|
||||
* méthode `deconnexion` associée à l'action `deconnecter`
|
||||
* méthode `newListPrivate` associée à l'action `creerListePriv`
|
||||
* méthode `loadListePriv` associée à l'action `voirListePriv`
|
||||
* méthode `erasePrivList` associée à l'action `supprimerListePriv`
|
||||
|
||||
- vue connection.php
|
||||
- vue newList.php
|
||||
- vue register.php
|
||||
- vue about.php
|
||||
- vue newTask.php
|
||||
- vue homePriv.php
|
||||
- fin de la vue erreur.php
|
||||
|
||||
- navigation entre les pages avec `href=index.php?action=...`
|
||||
- classe Validation
|
||||
- utilisation de la classe validation dans le code
|
||||
- "binding" des bouttons avec les actions correspondantes (pour les deux controlleurs, visitor et user)
|
||||
- tableau de vues et tableau des messages d'erreurs
|
||||
- corrections de bugs
|
||||
|
||||
#### Ce qui reste à faire
|
||||
|
||||
Nous avions envisagé de permettre à l'utilisateur d'afficher de plus amples informations sur les tâches, comme leurs dates de début et de fin et leur description, à l'aide d'un bouton sur nos vue home et home privé cependant nous n'avons pas eu le temps de le faire et par souci d'esthétisme et de lisibilité nous n'avons pas mis toutes ces informations dans le tableau des tâches pour chaque liste.
|
||||
|
||||
Nous souhaitions également afficher un compte des tâches faites sur le nombre de tâches total par liste mais nous n'avons pas eu le temps de terminer cette fonctionnalité.
|
||||
|
||||
Nous avons tout de même conservé les attributs qui étaient censés être utilisés dans ces fonctionnalités dans notre base de données et dans nos classes métiers en vue d'une possible amélioration de notre site.
|
||||
|
||||
#### Plus de détails
|
||||
* vous pouvez trouver plus de détail sur notre dépot git disponible ici `https://codefirst.iut.uca.fr/git/anna.boudoul/ProjetPHP`, en regardant les commits qui ont été fait tout au long du projet.
|
||||
|
Binary file not shown.
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class Validation {
|
||||
|
||||
static function val_form_texte(&$texte, &$TMessage) {
|
||||
if (!isset($texte)||$texte=="") {
|
||||
$TMessage[] ="Empty fields";
|
||||
$texte="";
|
||||
}
|
||||
|
||||
if ($texte != filter_var($texte, FILTER_SANITIZE_STRING))
|
||||
{
|
||||
$TMessage[]="Attempt to inject code (security attack)";
|
||||
$texte="";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static function val_form_mdp(&$mdp, &$TMessage) {
|
||||
if (!isset($mdp)||$mdp=="") {
|
||||
$TMessage[] ="Password not specified";
|
||||
$mdp="";
|
||||
}
|
||||
|
||||
if ($mdp != filter_var($mdp, FILTER_SANITIZE_SPECIAL_CHARS))
|
||||
{
|
||||
$TMessage[] ="Password must not contain special characters";
|
||||
$mdp="";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,7 +1,21 @@
|
||||
<?php
|
||||
//gen
|
||||
require('dal/Connection.php');
|
||||
|
||||
$rep=__DIR__.'/../';
|
||||
|
||||
require('dal/Connection.php');
|
||||
$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'achanger');
|
||||
//$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger');
|
||||
$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL');
|
||||
|
||||
$TMessage = array();
|
||||
|
||||
$TabVues = array();
|
||||
$TabVues["erreur"] = "view/erreur.php";
|
||||
$TabVues["home"] = "view/home.php";
|
||||
$TabVues["connection"] = "view/connection.php";
|
||||
$TabVues["register"] = "view/register.php";
|
||||
$TabVues["newList"] = "view/newList.php";
|
||||
$TabVues["liste"] = "view/liste.php";
|
||||
$TabVues["about"] = "view/about.php";
|
||||
$TabVues["prives"] = "view/privHome.php";
|
||||
|
||||
?>
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
class CtrlUser{
|
||||
function __construct(){
|
||||
global $vues;
|
||||
$rep=__DIR__.'/../';
|
||||
|
||||
$dVueEreur = array ();
|
||||
try{
|
||||
$action=$_REQUEST['action'];
|
||||
|
||||
switch($action) {
|
||||
case NULL:
|
||||
$this->Reinit();
|
||||
break;
|
||||
case "validationFormulaire":
|
||||
$this->ValidationFormulaire($dVueEreur);
|
||||
break;
|
||||
//mauvaise action
|
||||
default:
|
||||
$dVueEreur[] = "Erreur d'appel php";
|
||||
require ($rep.$vues['vuephp1']);
|
||||
break;
|
||||
}
|
||||
} catch (PDOException $e)
|
||||
{
|
||||
//si erreur BD, pas le cas ici
|
||||
$dVueEreur[] = "Erreur inattendue!!! ";
|
||||
require ($rep.$vues['erreur']);
|
||||
}
|
||||
catch (Exception $e2)
|
||||
{
|
||||
$dVueEreur[] = "Erreur inattendue!!! ";
|
||||
require ($rep.$vues['erreur']);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,3 +1,45 @@
|
||||
<?php
|
||||
require_once("config/config.php");
|
||||
require("model/UserModel.php");
|
||||
|
||||
class FrontCtrl
|
||||
{
|
||||
private UserModel $usrMdl;
|
||||
private $action_User;
|
||||
private bool $isUser;
|
||||
private $TabVues;
|
||||
|
||||
function __construct(&$con, $TabVues){
|
||||
session_start();
|
||||
$this->TabVues = $TabVues;
|
||||
$this->usrMdl = new UserModel($con);
|
||||
$this->action_User = array('deconnecter', 'voirListePriv', 'creerListePriv', 'supprimerListePriv');
|
||||
try{
|
||||
|
||||
$this->isUser = $this->usrMdl->isConnected();
|
||||
$action = $_REQUEST['action'] ?? null;
|
||||
|
||||
if(($i = array_search($action,$this->action_User)) !== false){ # si action dans la liste d'actions user
|
||||
if(!$this->isUser){ # si pas conncter
|
||||
# appel controlleur visiteur avec action connecter
|
||||
require("VisitorCtrl.php");
|
||||
$visitCtrl = new VisitorCtrl($con, $this->TabVues, $this->isUser);
|
||||
$visitCtrl->goconnexion();
|
||||
} else { # sinon
|
||||
# handle action avec controlleur user
|
||||
require("UserCtrl.php");
|
||||
$userCtrl = new UserCtrl($con, $this->TabVues);
|
||||
}
|
||||
|
||||
} else { # sinon forcement action visiteur
|
||||
# appel controlleur visiteur avec l'action
|
||||
require("VisitorCtrl.php");
|
||||
$visitCtrl = new VisitorCtrl($con, $this->TabVues, $this->isUser);
|
||||
}
|
||||
} catch (Exception $e){ // verifier si catch bon
|
||||
$TMessage[] = $e->getMessage();
|
||||
require($this->TabVues["erreur"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
require_once("model/TaskModel.php");
|
||||
|
||||
class UserCtrl
|
||||
{
|
||||
private $view;
|
||||
private $con;
|
||||
private $taskModel;
|
||||
private $userModel;
|
||||
private $TabVues;
|
||||
|
||||
public function __construct(Connection $con, $TabVues){
|
||||
$this->TabVues = $TabVues;
|
||||
$this->con = $con;
|
||||
$this->userModel = new UserModel($this->con);
|
||||
$this->taskModel = new TaskModel($this->con);
|
||||
try{
|
||||
$action=$_REQUEST['action'];
|
||||
switch($action){
|
||||
|
||||
// voir les listes privees
|
||||
case 'voirListePriv':
|
||||
$this->loadListePriv();
|
||||
break;
|
||||
|
||||
// ajouter une liste privee
|
||||
case 'creerListePriv':
|
||||
$this->newListPrivate();
|
||||
break;
|
||||
|
||||
// supprimer une liste privee
|
||||
case 'supprimerListePriv':
|
||||
$this->erasePrivList();
|
||||
break;
|
||||
|
||||
case 'deconnecter':
|
||||
$this->deconnexion();
|
||||
break;
|
||||
default:
|
||||
$TMessage[] = 'Unexpected error';
|
||||
require($this->TabVues["erreur"]);
|
||||
break;
|
||||
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
$TMessage[] = $e->getMessage();
|
||||
require($this->TabVues["erreur"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function loadListePriv(){
|
||||
$user = $_SESSION['login'];
|
||||
$private_lists = $this->taskModel->loadPrivateLists($user);
|
||||
require($this->TabVues["prives"]);
|
||||
}
|
||||
|
||||
public function newListPrivate(){
|
||||
$this->taskModel->addList($_POST['listName'],$_SESSION['login']);
|
||||
$this->loadListePriv();
|
||||
}
|
||||
|
||||
function erasePrivList(){
|
||||
$this->taskModel->supList($_POST['listId']);
|
||||
$this->loadListePriv();
|
||||
}
|
||||
|
||||
function loadHome(){
|
||||
$public_lists = $this->taskModel->loadPublicLists();
|
||||
require($this->TabVues["home"]);
|
||||
}
|
||||
|
||||
public function deconnexion(){
|
||||
$this->userModel->deconnexion();
|
||||
header("Location:index.php");
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
require("model/TaskModel.php");
|
||||
|
||||
class VisitorCtrl
|
||||
{
|
||||
private $taskModel;
|
||||
private $userModel;
|
||||
private $isUser;
|
||||
private $TabVues;
|
||||
|
||||
function __construct($con, $TabVues, $isUser){
|
||||
$this->TabVues = $TabVues;
|
||||
$this->isUser = $isUser;
|
||||
$dvueErreur = array();
|
||||
$this->taskModel = new TaskModel($con);
|
||||
$this->userModel = new UserModel($con);
|
||||
try{
|
||||
if(isset($_REQUEST['action']))
|
||||
$action = $_REQUEST['action'];
|
||||
else
|
||||
$action = null;
|
||||
|
||||
switch($action){
|
||||
case null:
|
||||
$this->loadHome();
|
||||
# initialize la page home avec tout les listes
|
||||
break;
|
||||
|
||||
case 'pageConnection':
|
||||
$this->go_connection();
|
||||
break;
|
||||
|
||||
case 'pageAbout':
|
||||
$this->go_about();
|
||||
break;
|
||||
|
||||
case 'connecter':
|
||||
$this->connection();
|
||||
# charge la vue de connexion
|
||||
break;
|
||||
|
||||
case 'pageRegister':
|
||||
$this->go_register();
|
||||
break;
|
||||
|
||||
case 'register':
|
||||
$this->register();
|
||||
# charge la vue de connexion
|
||||
break;
|
||||
|
||||
case 'pageListe':
|
||||
$this->go_list();
|
||||
break;
|
||||
|
||||
case 'creerListe':
|
||||
$this->makeList();
|
||||
# creer une liste publique
|
||||
break;
|
||||
|
||||
case 'supprimerListe':
|
||||
$this->eraseList();
|
||||
# supprime une liste publique
|
||||
break;
|
||||
|
||||
case 'pageTache':
|
||||
$this->go_task();
|
||||
break;
|
||||
|
||||
case 'ajouterTache':
|
||||
$this->addTask();
|
||||
# ajouter une tache a une liste pub
|
||||
break;
|
||||
|
||||
case 'supprimerTache':
|
||||
$this->eraseTask();
|
||||
# supprimer une tache
|
||||
break;
|
||||
|
||||
case 'isDone':
|
||||
$this->isDone();
|
||||
break;
|
||||
|
||||
default:
|
||||
$TMessage[] = 'Unexpected error';
|
||||
require($this->TabVues["erreur"]);
|
||||
$this->loadHome();
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($_POST);
|
||||
$TMessage[] = $e->getMessage();
|
||||
require($this->TabVues["erreur"]);
|
||||
}
|
||||
}
|
||||
function loadHome(){
|
||||
$public_lists = $this->taskModel->loadPublicLists();
|
||||
# le if suivant est nécéssaire dans le cas ou l'action
|
||||
# connection a été appeller. Dans ce cas, loadHome doit
|
||||
# prendre en compte le user qui vient d'être ajouter a
|
||||
# $_SESSION['login']
|
||||
if(isset($_SESSION['login']) && $_SESSION['login'] != "")
|
||||
$user = $_SESSION['login'];
|
||||
else
|
||||
$user = $this->isUser;
|
||||
|
||||
require($this->TabVues["home"]);
|
||||
}
|
||||
|
||||
function go_connection(){
|
||||
$user = $this->isUser;
|
||||
require($this->TabVues["connection"]);
|
||||
}
|
||||
|
||||
function go_about(){
|
||||
$user = $this->isUser;
|
||||
require($this->TabVues["about"]);
|
||||
}
|
||||
|
||||
function connection(){
|
||||
$isCo = $this->userModel->connexion($_POST['username'],$_POST['password']);
|
||||
if(!$isCo){
|
||||
$TMessage[] = 'This user does not exist'; require($this->TabVues["erreur"]);
|
||||
$this->loadHome();
|
||||
}
|
||||
else
|
||||
$this->loadHome();
|
||||
}
|
||||
|
||||
function go_register(){
|
||||
$user = $this->isUser;
|
||||
require($this->TabVues["register"]);
|
||||
}
|
||||
|
||||
function register(){
|
||||
$this->userModel->ajouter($_POST['username'],$_POST['password']);
|
||||
$this->go_connection();
|
||||
}
|
||||
|
||||
function go_list(){
|
||||
$user = $this->isUser;
|
||||
require("view/newList.php");
|
||||
}
|
||||
|
||||
function makeList(){
|
||||
$this->taskModel->addList($_POST['listName']);
|
||||
$this->loadHome();
|
||||
}
|
||||
|
||||
function eraseList(){
|
||||
$this->taskModel->supList($_POST['listId']);
|
||||
$this->loadHome();
|
||||
}
|
||||
|
||||
function go_task(){
|
||||
$user = $this->isUser;
|
||||
if(isset($_POST['listId'])) $_SESSION['listId'] = $_POST['listId'];
|
||||
if(isset($_POST['isPriv'])) $_SESSION['isPriv'] = $_POST['isPriv'];
|
||||
require("view/newTask.php");
|
||||
}
|
||||
|
||||
function addTask(){
|
||||
$this->taskModel->addTask($_POST['titreT'],$_POST['descT'],
|
||||
$_POST['prioriteT'],$_SESSION['listId'],$_POST['dateDebT'],$_POST['dateFinT']);
|
||||
|
||||
if(isset($_SESSION['isPriv']) && $_SESSION['isPriv'])
|
||||
header("Location:index.php?action=voirListePriv");
|
||||
else
|
||||
$this->loadHome();
|
||||
}
|
||||
|
||||
function eraseTask(){
|
||||
$this->taskModel->supTask($_POST['idT']);
|
||||
if(!empty($_POST['isPriv']))
|
||||
header("Location:index.php?action=voirListePriv");
|
||||
else
|
||||
$this->loadHome();
|
||||
}
|
||||
|
||||
function isDone(){
|
||||
if ($_POST['Tdone'])
|
||||
$this->taskModel->modifTask($_POST['idT'],'isDone',false);
|
||||
else
|
||||
$this->taskModel->modifTask($_POST['idT'],'isDone',true);
|
||||
if(!empty($_POST['isPriv']))
|
||||
header("Location:index.php?action=voirListePriv");
|
||||
else
|
||||
$this->loadHome();
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
require_once("business/ListTask.php");
|
||||
include_once("business/Task.php");
|
||||
|
||||
|
||||
class TaskGateway
|
||||
{
|
||||
// connection attribute
|
||||
public Connection $con;
|
||||
|
||||
// constructor
|
||||
public function __construct(Connection $con){
|
||||
$this->con=$con;
|
||||
}
|
||||
|
||||
// functions
|
||||
// code de retour pour les fonctions i,u,d?
|
||||
public function insertT(Task $t){
|
||||
$query='INSERT INTO Tache VALUES (:id,:titre,:descript,:dateDeb,:dateFin,:priorite,:idList,false)';
|
||||
if($t->get_dateDeb() == null)
|
||||
$dateDeb = NULL;
|
||||
else
|
||||
$dateDeb = $t->get_dateDeb();
|
||||
if($t->get_dateFin() == null)
|
||||
$dateFin = NULL;
|
||||
else
|
||||
$dateFin = $t->get_dateFin();
|
||||
|
||||
$this->con->executeQuery($query, array(
|
||||
':id'=> array($t->get_id(),PDO::PARAM_STR),
|
||||
':titre'=> array($t->get_titre(),PDO::PARAM_STR),
|
||||
':descript'=> array($t->get_description(),PDO::PARAM_STR),
|
||||
':dateDeb'=> array($dateDeb,PDO::PARAM_STR),
|
||||
':dateFin'=> array($dateFin,PDO::PARAM_STR),
|
||||
':priorite'=> array($t->get_priorite(),PDO::PARAM_STR),
|
||||
':idList'=> array($t->get_idList(),PDO::PARAM_STR) ));
|
||||
}
|
||||
|
||||
public function update($table,$id,$element, $valeur){
|
||||
if($table == 'task'){
|
||||
$query='UPDATE Tache SET '.$element.'=:'.$element.' WHERE id=:id';
|
||||
} else {
|
||||
$query='UPDATE uList SET '.$element.'=:'.$element.' WHERE id=:id';
|
||||
}
|
||||
$this->con->executeQuery($query, array(
|
||||
':id'=>array($id,PDO::PARAM_STR),
|
||||
':'.$element =>array($valeur,PDO::PARAM_STR)));
|
||||
}
|
||||
|
||||
public function delete($table,$id){
|
||||
if($table == 'task'){
|
||||
$query='DELETE FROM Tache WHERE id = :id';
|
||||
} else {
|
||||
$query='DELETE FROM uList WHERE id = :id;
|
||||
DELETE FROM Tache WHERE idList = :id;';
|
||||
}
|
||||
$this->con->executeQuery($query, array(
|
||||
':id'=>array($id,PDO::PARAM_STR)));
|
||||
}
|
||||
|
||||
/*si on veut trouver une liste, juste chercher toutes les taches avec idList= id_de_la_liste*/
|
||||
# pour toutes les listes d'un user specifique, appeller 2 fois la fonction:
|
||||
# une fois pour prendre toutes les listes qui ont l'id de l'user
|
||||
# pour toutes ces listes (foreach), find toutes chaque tache associé
|
||||
public function find($table, $element="", $valeur=""){
|
||||
$tabResult = array();
|
||||
if($table =='task'){
|
||||
if(strcmp($element,"")==0)
|
||||
{
|
||||
$query='SELECT * FROM Tache';
|
||||
$this->con->executeQuery($query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query='SELECT * FROM Tache WHERE '.$element.'=:'.$element;
|
||||
$this->con->executeQuery($query, array(
|
||||
':'.$element =>array($valeur,PDO::PARAM_STR)));
|
||||
}
|
||||
|
||||
$results=$this->con->getResults();
|
||||
foreach($results as $row)
|
||||
{
|
||||
$tabTaches[]=new Task($row['titre'],$row['description'],$row['priorite'],
|
||||
$row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone'],$row['id']);
|
||||
}
|
||||
return $tabResult;
|
||||
|
||||
} else if($table == 'list'){
|
||||
if(strcmp($element,"")==0)
|
||||
{
|
||||
$query='SELECT * FROM uList';
|
||||
$this->con->executeQuery($query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query='SELECT * FROM uList WHERE '.$element.'=:'.$element;
|
||||
$this->con->executeQuery($query, array(
|
||||
':'.$element =>array($valeur,PDO::PARAM_STR)));
|
||||
}
|
||||
|
||||
$results=$this->con->getResults();
|
||||
foreach($results as $row)
|
||||
{
|
||||
$tabList[]=new ListTask($row['nom'],$row['user'],$row['dc'],$row['id']);
|
||||
}
|
||||
return $tabResult;
|
||||
}
|
||||
}
|
||||
|
||||
// SELECT tache.id FROM Tache tache, Liste liste
|
||||
// tache.idListe = liste.id AND liste.user IS NULL;
|
||||
|
||||
/* # LIST FUNCTIONS */
|
||||
/*create, update, delete, read(select info)*/
|
||||
public function insertL(ListTask $l){
|
||||
$query='INSERT INTO uList VALUES (:id,:nom,:user,0)';
|
||||
$this->con->executeQuery($query, array(
|
||||
':id'=> array($l->get_id(),PDO::PARAM_STR),
|
||||
':nom'=> array($l->get_nom(),PDO::PARAM_STR),
|
||||
':user'=> array($l->get_owner(),PDO::PARAM_STR)));
|
||||
}
|
||||
|
||||
public function count($list){
|
||||
$query='SELECT COUNT(*) from Tache where idList = :idList';
|
||||
|
||||
$this->con->executeQuery($query, array(
|
||||
':idList' => array($list->get_id(),PDO::PARAM_INT)
|
||||
));
|
||||
|
||||
$result = $this->con->getResults();
|
||||
foreach($result as $row){
|
||||
$taille = $row[0];
|
||||
}
|
||||
return $taille;
|
||||
}
|
||||
|
||||
public function findUserList($user){
|
||||
# pas réussit a faire une jointure optimale donc
|
||||
# decomposé en plusieurs foncitons:
|
||||
# findUserList
|
||||
# findTacheList
|
||||
|
||||
$query='SELECT * from uList where user = :user';
|
||||
$this->con->executeQuery($query, array(
|
||||
':user' => array($user,PDO::PARAM_STR)
|
||||
));
|
||||
$tabLists = array();
|
||||
$results = $this->con->getResults();
|
||||
foreach($results as $row){
|
||||
$tabLists[]= new ListTask($row[1],$row[2],$row[3],$row[0]);
|
||||
}
|
||||
return $tabLists;
|
||||
}
|
||||
|
||||
public function findListTask($list){
|
||||
$query='SELECT * from Tache where idList = :idList';
|
||||
|
||||
$this->con->executeQuery($query, array(
|
||||
':idList' => array($list->get_id(),PDO::PARAM_STR)
|
||||
));
|
||||
|
||||
$results = $this->con->getResults();
|
||||
|
||||
foreach($results as $row){
|
||||
$taches[]= new Task($row['titre'],$row['description'],$row['priorite'],
|
||||
$row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone'],$row['id']);
|
||||
}
|
||||
if(!empty($taches))
|
||||
$list->set_taches($taches);
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function findPublicList(){
|
||||
$query='SELECT * from uList where user is NULL';
|
||||
$this->con->executeQuery($query);
|
||||
|
||||
$tabLists = array();
|
||||
$results = $this->con->getResults();
|
||||
foreach($results as $row){
|
||||
$tabLists[]= new ListTask($row[1],$row[2],$row[3],$row[0]);
|
||||
}
|
||||
return $tabLists;
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,58 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.0
|
||||
-- https://www.phpmyadmin.net/
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `tache`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tache`;
|
||||
CREATE TABLE IF NOT EXISTS `tache` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`titre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`dateDebut` date DEFAULT NULL,
|
||||
`dateFin` date DEFAULT NULL,
|
||||
`priorite` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`idList` int NOT NULL,
|
||||
`isDone` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_list` (`idList`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `ulist`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `ulist`;
|
||||
CREATE TABLE IF NOT EXISTS `ulist` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`nom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`user` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`dc` int NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_list_owner` (`user`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `user`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `user`;
|
||||
CREATE TABLE IF NOT EXISTS `user` (
|
||||
`login` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`mdp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
PRIMARY KEY (`login`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
COMMIT;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
$fc = new FrontCtrl();
|
||||
$TMessage = array();
|
||||
|
||||
require_once(controller/FrontCtrl.php);
|
||||
require(erreur.php);*/
|
||||
require("config/config.php");
|
||||
require('config/Validation.php');
|
||||
require_once("controller/FrontCtrl.php");
|
||||
$fc = new FrontCtrl($con, $TabVues);
|
||||
?>
|
||||
|
||||
|
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
include_once("dal/TaskGateway.php");
|
||||
include_once("business/Task.php");
|
||||
|
||||
class TaskModel
|
||||
{
|
||||
public Connection $con;
|
||||
public TaskGateway $gtw;
|
||||
|
||||
public function __construct(Connection $con)
|
||||
{
|
||||
$this->con=$con;
|
||||
$this->gtw= new TaskGateway($con);
|
||||
}
|
||||
|
||||
public function addTask($titre,$desc,$priorite,$idList,$dateDeb=null,$dateFin=null,$isDone=false,$id=0)
|
||||
{
|
||||
$t = new Task($titre,$desc,$priorite,$idList,$dateDeb,$dateFin,$isDone,$id);
|
||||
$this->gtw->insertT($t);
|
||||
// retourne quoi? con->lastInsertId() ??
|
||||
}
|
||||
|
||||
public function supTask($id)
|
||||
{
|
||||
$this->gtw->delete('task',$id);
|
||||
}
|
||||
|
||||
public function modifTask($id,$element,$valeur)
|
||||
{
|
||||
$this->gtw->update('task',$id,$element,$valeur);
|
||||
}
|
||||
|
||||
public function getAllTask()
|
||||
{
|
||||
return $this->gtw->find('task');
|
||||
}
|
||||
|
||||
public function getTaskBy($element,$valeur)
|
||||
{
|
||||
return $this->gtw->find('task',$element,$valeur);
|
||||
}
|
||||
|
||||
/* LIST FUNCTIONS */
|
||||
public function addList($nom,$owner="",$dc=0,$id=0)
|
||||
{
|
||||
Validation::val_form_texte($owner, $TMessage);
|
||||
$l = new ListTask($nom,$owner,$dc);
|
||||
$this->gtw->insertL($l);
|
||||
// retourne quoi? con->lastInsertId() ??
|
||||
}
|
||||
|
||||
public function modifList($id,$element,$valeur)
|
||||
{
|
||||
$this->gtw->update('list',$id,$element,$valeur);
|
||||
}
|
||||
|
||||
public function size($list){
|
||||
$taille = $this->gtw->count($list);
|
||||
return $taille;
|
||||
}
|
||||
|
||||
public function supList($id)
|
||||
{
|
||||
$this->gtw->delete('list',$id);
|
||||
}
|
||||
|
||||
function loadPublicLists()
|
||||
{
|
||||
$lists = $this->gtw->findPublicList();
|
||||
|
||||
foreach($lists as &$row){
|
||||
$row = $this->gtw->findListTask($row);
|
||||
}
|
||||
return $lists;
|
||||
}
|
||||
|
||||
function loadPrivateLists($user){
|
||||
# prend toutes les listes de l'user
|
||||
$lists = $this->gtw->findUserList($user);
|
||||
|
||||
# pour chacune de ses listes, charge les taches
|
||||
foreach($lists as &$row){
|
||||
$row = $this->gtw->findListTask($row);
|
||||
}
|
||||
return $lists;
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
require_once("business/Task.php");
|
||||
require_once("business/ListTask.php");
|
||||
require_once("dal/TaskGateway.php");
|
||||
require_once("controller/VisitorCtrl.php");
|
||||
require_once("dal/Connection.php");
|
||||
//echo "<h1>2do test</h1>";
|
||||
|
||||
# Test de la Gateway Tache
|
||||
# nouvelle tache
|
||||
# $t = new Task(5,'tacheNotErr','desc.','urgent','001');
|
||||
|
||||
# connection
|
||||
$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger');
|
||||
|
||||
# gateway
|
||||
// $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0');
|
||||
// $tgt = new TaskGateway($con);
|
||||
// $tgt->insertT($t);
|
||||
//$tgt->delete('10');
|
||||
//$taches = $tgt->findUserList('nifranco');
|
||||
// foreach($taches as $t){
|
||||
// echo $t->get_id()." ".$t->get_idList()."<br>";
|
||||
// }
|
||||
|
||||
# test find
|
||||
// $tasks=$tgt->find('idList','001');
|
||||
// foreach($tasks as $i)
|
||||
// echo $i->get_id()."<br>";
|
||||
|
||||
# Test du modele Tache
|
||||
// $mt= new TaskModel($con);
|
||||
//$mt->addTask('3','testIsDone','desc.','urgent','001');
|
||||
//$mt->modifTask('3','isDone','1');
|
||||
//$tasks = $mt->getTaskBy('titre','tache1');
|
||||
// $tasks = $mt->getAllTask();
|
||||
// foreach($tasks as $i)
|
||||
// echo $i->get_id()."<br>";
|
||||
|
||||
# Test LOAD PRIVATE TASKS
|
||||
$mt= new TaskModel($con);
|
||||
$mt->addList('Nicolas2do');
|
||||
# Test LOAD PRIVATE TASKS
|
||||
// $mt= new TaskModel($con);
|
||||
// $mt->addList('private','nifranco');
|
||||
// $lists = $mt->loadPublicLists();
|
||||
|
||||
// foreach($lists as $l){
|
||||
// echo 'List: '.$l->get_id()."<br>";
|
||||
// echo "Tasks: <br>";
|
||||
// foreach($l->get_taches() as $t){
|
||||
// echo $t->get_id()."<br>";
|
||||
// }
|
||||
// }
|
||||
// //$tasks = $mt->getTaskBy('titre','tache1');
|
||||
// $tasks = $mt->getAllTask();
|
||||
// foreach($tasks as $i)
|
||||
// echo $i->get_id()."<br>";
|
||||
// $tasks = $mt->loadPublicLists();
|
||||
// foreach($tasks as $i)
|
||||
// echo $i->get_id()."<br>";
|
||||
|
||||
// $mt->addList('002','todo2','nifranco');
|
||||
// $mt->modifList('2','nom','22do');
|
||||
//mt->supList('2');
|
||||
// $public_lists = $mt->loadPrivateLists('nifranco');
|
||||
// $user = true;
|
||||
//require("../view/home.php");
|
||||
//require("../view/register.php");
|
||||
//require("../view/connection.php");
|
||||
/* -------------
|
||||
TEST ANNA
|
||||
----------------*/
|
||||
|
||||
require('../dal/UserGateway.php');
|
||||
require('../model/UserModel.php');
|
||||
require('../controller/UserCtrl.php');
|
||||
|
||||
// Test Gateway User
|
||||
|
||||
// $gat = new UserGateway($con);
|
||||
// $gat->create('Nicolas', 'tranquilloubilou');
|
||||
// $gat->updateLogin('Nicolas', 'RicharlisonR9');
|
||||
// $gat->updateMdp('RicharlisonR9', 'hexachampion');
|
||||
// $tab = $gat->find('RicharlisonR9', 'login');
|
||||
// $gat->delete('RicharlisonR9');
|
||||
|
||||
// Test Modèle User
|
||||
|
||||
//$mu = new UserModel($con);
|
||||
//$res = $mu->connexion('nifranco','achanger');
|
||||
//var_dump($res);
|
||||
$mdl = new UserModel($con);
|
||||
// $mdl->ajouter('Anna', 'unmdptrescomplique');
|
||||
// $mdl->modifLogin('Anna', 'Aeryn');
|
||||
// $mdl->modifMdp('Aeryn', 'wtfmec');
|
||||
// $mdl->supprimer('Aeryn');
|
||||
// $mdl->connexion('Aeryn', 'wtfmec');
|
||||
|
||||
// $mt->addList("Test Liste");
|
||||
// $mt->addList("Liste publique");
|
||||
// $mt->addList("Liste privée", "Aeryn");
|
||||
// $mt->addList("Projet de PHP", "Aeryn");
|
||||
// $mt->addList("Projet Blazor", "Aeryn");
|
||||
// $mt->addList("Projet de PHP", "RicharlisonR9");
|
||||
// $mt->addList("Projet Blazor", "RicharlisonR9");
|
||||
|
||||
// TEST USER CONTROLLER
|
||||
|
||||
|
||||
// session_start();
|
||||
// $_SESSION['login'] = 'RicharlisonR9';
|
||||
// $usrctrl = new UserCtrl($con);
|
||||
// $usrctrl->loadHome();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
static $user = 'anboudoul';
|
||||
static $pass = 'mdpMYSQL';
|
||||
?>
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
require('../dal/Connection.php');
|
||||
require('../dal/GatUser.php');
|
||||
require('../model/ModelUser.php');
|
||||
$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'achanger');
|
||||
|
||||
// Test Gateway User
|
||||
|
||||
// $gat = new GatUser($con);
|
||||
// $gat->create('Nicolas', 'tranquilloubilou');
|
||||
// $gat->updateLogin('Nicolas', 'RicharlisonR9');
|
||||
// $gat->updateMdp('RicharlisonR9', 'hexachampion');
|
||||
// $tab = $gat->find('RicharlisonR9', 'login');
|
||||
// $gat->delete('RicharlisonR9');
|
||||
|
||||
// Test Modèle User
|
||||
|
||||
// $mdl = new ModelUser($con);
|
||||
// $mdl->ajouter('Anna', 'unmdptrescomplique');
|
||||
// $mdl->modifLogin('Anna', 'Aeryn');
|
||||
// $mdl->modifMdp('Aeryn', 'wtfmec');
|
||||
// $mdl->supprimer('Aeryn');
|
||||
|
||||
?>
|
@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenu de la page ici-->
|
||||
<div class="container-fluid">
|
||||
<center>
|
||||
<div class="col-lg-4 mb-5 mb-lg-0 text-center">
|
||||
<div>
|
||||
<div class="rounded-5 shadow-3-soft p-4" style="background-color: #fff9f2">
|
||||
<div class="border-top border-dark mx-auto" style="width: 100px"></div>
|
||||
<p class="text-muted mt-4 mb-2">2Do</p>
|
||||
<p class="h5 mb-4" style="color: #344e41">A PHP project</p>
|
||||
<p class="pb-4 mb-4">
|
||||
A little PHP project realised by two french students studying Computer Science at the IUT of
|
||||
Clermont Auvergne in France. The main goal of this project was to create a little To Do List
|
||||
using the PHP language. We hope that you will find it useful.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="../view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,28 +0,0 @@
|
||||
body{
|
||||
text-align : center;
|
||||
}
|
||||
|
||||
form{
|
||||
display : flex;
|
||||
flex-flow : column nowrap;
|
||||
align-items : center;
|
||||
}
|
||||
|
||||
input{
|
||||
width : 90%;
|
||||
border-radius : 5px;
|
||||
color : #595959;
|
||||
}
|
||||
|
||||
label{
|
||||
margin-top : 20px;
|
||||
}
|
||||
|
||||
#envoyer{
|
||||
width : 150px;
|
||||
height : 30px;
|
||||
}
|
||||
|
||||
#btnEnvoi{
|
||||
margin: 20px;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="#!">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenue de la page ici-->
|
||||
<div class="container-fluid">
|
||||
<h1 class="text-center my-3 pb-3">Welcome back!</h1>
|
||||
<form action="index.php" method="post">
|
||||
<!-- Login input -->
|
||||
<div class="form-outline mb-4 align-items-center">
|
||||
<input name="username" type="text" id="form2Example1" class="form-control" required/>
|
||||
<label class="form-label" for="form2Example1">Username</label>
|
||||
</div>
|
||||
|
||||
<!-- Password input -->
|
||||
<div class="form-outline mb-4">
|
||||
<input name="password" type="password" id="form2Example2" class="form-control" required/>
|
||||
<label class="form-label" for="form2Example2">Password</label>
|
||||
</div>
|
||||
|
||||
<!-- Submit button -->
|
||||
<button type="submit" class="btn btn-primary btn-block mb-4">Log In</button>
|
||||
<input type="hidden" name="action" value="connecter" ></input>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
foreach($TMessage as $err) {
|
||||
echo $err . "<br/>";
|
||||
echo '<div class="alert alert-danger alert-dismissible d-flex align-items-center fade show">
|
||||
<i class="bi-exclamation-octagon-fill"></i>
|
||||
<strong class="mx-2">Error!</strong>' . $err . "</div>";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
<a href="CtrlUser.php?action=exaction&id=1"
|
@ -0,0 +1,152 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Page content-->
|
||||
<div class="container-fluid">
|
||||
<h1 class="mt-4">Public lists</h1>
|
||||
|
||||
<?php
|
||||
# check if set
|
||||
foreach($public_lists as $l){
|
||||
echo '
|
||||
<section class="vh-0" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
<form action="index.php" method="post" class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
<div class="col-12 position-absolute top-0 start-0">
|
||||
<button type="submit" class="btn btn-danger">🗑</button>
|
||||
<input type="hidden" name="listId" value="'.$l->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="supprimerListe"></input>
|
||||
</div>
|
||||
</form>
|
||||
<h4 class="text-center my-3 pb-3">'.$l->get_nom().'</h4>
|
||||
<form action="index.php" method="post" class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">New task 📝</button>
|
||||
<input type="hidden" name="listId" value="'.$l->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="pageTache"></input>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Task</th>
|
||||
<th scope="col">Importance</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
# IF NO TASKS, display NO TASKS
|
||||
if(!empty($l->get_taches())){
|
||||
foreach($l->get_taches() as $t){
|
||||
if(!$t->get_isDone()){
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$t->get_titre().'</td>
|
||||
<td>'.$t->get_priorite().'</td>';
|
||||
} else {
|
||||
echo '
|
||||
<tr>
|
||||
<td><del>'.$t->get_titre().'</del></td>
|
||||
<td><del>'.$t->get_priorite().'</del></td>';
|
||||
}
|
||||
echo '
|
||||
<td>
|
||||
<form action="index.php" method="post" class="d-inline-block">';
|
||||
if(!$t->get_isDone()){
|
||||
echo '<button type="submit" class="btn btn-success ms-1">✔
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="Tdone" value="'.$t->get_isDone().'"></input>
|
||||
<input type="hidden" name="action" value="isDone">
|
||||
</button>';
|
||||
} else {
|
||||
echo '<button type="submit" class="btn btn-secondary ms-1">✖
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="Tdone" value="'.$t->get_isDone().'"></input>
|
||||
<input type="hidden" name="action" value="isDone">
|
||||
</button>';
|
||||
}
|
||||
echo '
|
||||
</form>
|
||||
<form action="index.php" method="post" class="d-inline-block">
|
||||
<button type="submit" class="btn btn-danger">🗑
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="supprimerTache">
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
} else {
|
||||
echo '<h6 class="text-center my-3 pb-3">No tasks here yet!</h6>';
|
||||
}
|
||||
|
||||
echo ' </tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Bootstrap core JS-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<section class="vh-100" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<h4 class="text-center my-3 pb-3">My List</h4>
|
||||
<form class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">New task 📝</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Task</th>
|
||||
<th scope="col">Importance</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($TabTask as $task){
|
||||
echo '<tr>
|
||||
<td scope="col">'.$task->get_titre().'</td>
|
||||
<td scope="col">'.$task->get_priorite().'</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-success ms-1">Done</button>
|
||||
<button type="submit" class="btn btn-danger">🗑</button>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="../view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenue de la page ici-->
|
||||
<div class="container-fluid">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="../view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<section class="vh-100" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<h4 class="text-center my-3 pb-3">New List</h4>
|
||||
<form class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
<div class="col-12">
|
||||
<div class="form-outline">
|
||||
<input type="text" id="form1" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">Make private 🔒</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* Start Bootstrap - Simple Sidebar v6.0.5 (https://startbootstrap.com/template/simple-sidebar)
|
||||
* Copyright 2013-2022 Start Bootstrap
|
||||
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-simple-sidebar/blob/master/LICENSE)
|
||||
*/
|
||||
//
|
||||
// Scripts
|
||||
//
|
||||
|
||||
window.addEventListener('DOMContentLoaded', event => {
|
||||
|
||||
// Toggle the side navigation
|
||||
const sidebarToggle = document.body.querySelector('#sidebarToggle');
|
||||
if (sidebarToggle) {
|
||||
// Uncomment Below to persist sidebar toggle between refreshes
|
||||
// if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
|
||||
// document.body.classList.toggle('sb-sidenav-toggled');
|
||||
// }
|
||||
sidebarToggle.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
document.body.classList.toggle('sb-sidenav-toggled');
|
||||
localStorage.setItem('sb|sidebar-toggle', document.body.classList.contains('sb-sidenav-toggled'));
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function hideShow() {
|
||||
var x = document.getElementById("myDIV");
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "block";
|
||||
} else {
|
||||
x.style.display = "none";
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenue de la page ici-->
|
||||
<div class="container-fluid">
|
||||
<section class="vh-50" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<h4 class="text-center my-3 pb-3">New List</h4>
|
||||
<form action="index.php" class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2" method="post">
|
||||
<div class="col-12">
|
||||
<div class="form-outline">
|
||||
<input type="text" id="form1" class="form-control" name="listName" required/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
<input type="hidden" name="action" value="creerListe"></input>
|
||||
|
||||
<?php
|
||||
if($user){
|
||||
echo '
|
||||
<label for="privateRadio" class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="action" value="creerListePriv"> Private 🔒
|
||||
</label>';
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageRegister">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenue de la page ici-->
|
||||
<div class="container-fluid">
|
||||
<h4 class="text-center my-3 pb-3">New Task</h4>
|
||||
<form method="post" action="index.php">
|
||||
<div class="form-outline mb-4 align-items-center">
|
||||
<label class="form-label" for="form2title">Name</label>
|
||||
<input name="titreT" type="text" id="form2title" class="form-control" required minlength="0" maxlength="250"/>
|
||||
</div>
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<label class="form-label" for="form2description">Description</label>
|
||||
<input name="descT" type="text" id="form2description" class="form-control" minlength="0" maxlength="250">
|
||||
</div>
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<label class="form-label" for="form2dateDeb">Starting date</label>
|
||||
<input name="dateDebT" type="date" id="form2dateDeb" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<label class="form-label" for="form2dateFin">Ending date</label>
|
||||
<input name="dateFinT" type="date" id="form2dateFin" class="form-control">
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-outline mb-4">
|
||||
<input name="prioriteT" type="text" id="form2importance" class="form-control" />
|
||||
<label class="form-label" for="form2importance">Importance</label>
|
||||
</div> -->
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<label class="form-label" for="form2importance">Importance</label>
|
||||
<select name="prioriteT" id="form2importance" class="form-control">
|
||||
<option value="">--Please choose an option--</option>
|
||||
<option value="Urgent">Urgent</option>
|
||||
<option value="Important">Important</option>
|
||||
<option value="Medium">Medium</option>
|
||||
<option value="Low">Low</option>
|
||||
<option value="None">None</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Submit button -->
|
||||
<button type="submit" class="btn btn-primary btn-block mb-4" >Save</button>
|
||||
<input type="hidden" name="action" value="ajouterTache"></input>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Page content-->
|
||||
<div class="container-fluid">
|
||||
<h1 class="mt-4">My Lists</h1>
|
||||
|
||||
<?php
|
||||
if(empty($private_lists)){
|
||||
echo'
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<a href="index.php?action=pageListe" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-envelope"></span>Add List ➕</a>
|
||||
</div>';
|
||||
}
|
||||
foreach($private_lists as $l){
|
||||
echo '
|
||||
<section class="vh-0" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
<form action="index.php" method="post" class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
<div class="col-12 position-absolute top-0 start-0">
|
||||
<button type="submit" class="btn btn-danger">🗑</button>
|
||||
<input type="hidden" name="listId" value="'.$l->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="supprimerListePriv"></input>
|
||||
</div>
|
||||
</form>
|
||||
<h4 class="text-center my-3 pb-3">'.$l->get_nom().'</h4>
|
||||
<form action="index.php" method="post" class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">New task 📝</button>
|
||||
<input type="hidden" name="listId" value="'.$l->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="pageTache"></input>
|
||||
<input type="hidden" name="isPriv" value="true"></input>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Task</th>
|
||||
<th scope="col">Importance</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
# IF NO TASKS, display NO TASKS
|
||||
if(!empty($l->get_taches())){
|
||||
foreach($l->get_taches() as $t){
|
||||
if(!$t->get_isDone()){
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$t->get_titre().'</td>
|
||||
<td>'.$t->get_priorite().'</td>';
|
||||
} else {
|
||||
echo '
|
||||
<tr>
|
||||
<td><del>'.$t->get_titre().'</del></td>
|
||||
<td><del>'.$t->get_priorite().'</del></td>';
|
||||
}
|
||||
echo '
|
||||
<td>
|
||||
<form action="index.php" method="post" class="d-inline-block">';
|
||||
if(!$t->get_isDone()){
|
||||
echo '<button type="submit" class="btn btn-success ms-1">✔
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="Tdone" value="'.$t->get_isDone().'"></input>
|
||||
<input type="hidden" name="action" value="isDone">
|
||||
<input type="hidden" name="isPriv" value="true">
|
||||
</button>';
|
||||
} else {
|
||||
echo '<button type="submit" class="btn btn-secondary ms-1">✖
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="Tdone" value="'.$t->get_isDone().'"></input>
|
||||
<input type="hidden" name="action" value="isDone">
|
||||
<input type="hidden" name="isPriv" value="true">
|
||||
</button>';
|
||||
}
|
||||
echo '
|
||||
</form>
|
||||
<form action="index.php" method="post" class="d-inline-block">
|
||||
<button type="submit" class="btn btn-danger">🗑
|
||||
<input type="hidden" name="idT" value="'.$t->get_id().'"></input>
|
||||
<input type="hidden" name="action" value="supprimerTache">
|
||||
<input type="hidden" name="isPriv" value="true">
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
} else {
|
||||
echo '<h6 class="text-center my-3 pb-3">No tasks here yet!</h6>';
|
||||
}
|
||||
|
||||
echo ' </tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>';
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Bootstrap core JS-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="view/css/home.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar-->
|
||||
<div class="border-end bg-white" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading border-bottom bg-light">2do</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php">Home</a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageListe">New List +</a>
|
||||
<?php
|
||||
if($user){
|
||||
echo '<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=voirListePriv">My Lists 🔒</a>';
|
||||
}
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" href="index.php?action=pageAbout">About</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
<div id="page-content-wrapper">
|
||||
<!-- Top navigation-->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
||||
<div class="container-fluid">
|
||||
<button class="btn btn-primary" id="sidebarToggle">Toggle Menu</button>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
|
||||
<?php
|
||||
if($user){
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=deconnecter">Log out</a></li>';
|
||||
} else {
|
||||
echo '<li class="nav-item"><a class="nav-link" href="index.php?action=pageConnection">Log In</a></li>';
|
||||
echo '<li class="nav-item"><a class="nav-link" href="#!">Register</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!--Contenue de la page ici-->
|
||||
<div class="container-fluid">
|
||||
<h2 class="text-center my-3 pb-3">Make private lists with a personnal account</h2>
|
||||
<form action="index.php" method="post">
|
||||
<!-- Login input -->
|
||||
<div class="form-outline mb-4 align-items-center">
|
||||
<input name="username" type="text" id="form2Example1" class="form-control" required/>
|
||||
<label class="form-label" for="form2Example1">Username</label>
|
||||
</div>
|
||||
|
||||
<!-- Password input -->
|
||||
<div class="form-outline mb-4">
|
||||
<input name="password" type="password" id="form2Example2" class="form-control" required/>
|
||||
<label class="form-label" for="form2Example2">Password</label>
|
||||
</div>
|
||||
|
||||
<!-- Submit button -->
|
||||
<button type="submit" class="btn btn-primary btn-block mb-4">Register</button>
|
||||
<input type="hidden" name="action" value="register" ></input>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Core theme JS-->
|
||||
<script src="view/js/home.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<section class="vh-100" style="background-color: #eee;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col col-lg-9 col-xl-7">
|
||||
<div class="card rounded-3"><div class="card rounded-3">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<h4 class="text-center my-3 pb-3">My List</h4>
|
||||
<form class="row row-cols-lg-auto g-3 justify-content-center align-items-center mb-4 pb-2">
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">New task 📝</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Task</th>
|
||||
<th scope="col">Importance</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($TabTask as $task){
|
||||
echo '<tr>
|
||||
<td scope="col">'.$task->get_titre().'</td>
|
||||
<td scope="col">'.$task->get_priorite().'</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-success ms-1">Done</button>
|
||||
<button type="submit" class="btn btn-danger">🗑</button>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue