Compare commits
48 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";
|
||||
|
||||
?>
|
@ -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;
|
||||
|
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
require("config/config.php");
|
||||
require('config/Validation.php');
|
||||
require_once("controller/FrontCtrl.php");
|
||||
require("erreur.php");
|
||||
|
||||
$fc = new FrontCtrl();
|
||||
$TMessage = array();
|
||||
|
||||
$fc = new FrontCtrl($con, $TabVues);
|
||||
?>
|
||||
|
||||
|
@ -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,5 +1,18 @@
|
||||
<?php
|
||||
foreach($TMessage as $err) {
|
||||
echo $err . "<br/>";
|
||||
}
|
||||
?>
|
||||
<!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 '<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"
|
@ -1,19 +0,0 @@
|
||||
<!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>
|
||||
<?php
|
||||
echo '<h1>'.$name.'</h1><center>';
|
||||
echo '<div class="list-group list-group-light">';
|
||||
foreach($TabList as $liste){
|
||||
echo '<button type="button" class="list-group-item list-group-item-action px-3 border-0">'.$liste->get_nom().'</button>';
|
||||
}
|
||||
echo '</div></center>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -1,41 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<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">
|
||||
<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>
|
||||
<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">
|
||||
<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 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>
|
||||
<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>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</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 class="col-12">
|
||||
<button type="submit" class="btn btn-primary">Make private 🔒</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</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>
|
||||
|
Loading…
Reference in new issue