commit
78bb346dd3
12 changed files with 322 additions and 510 deletions
|
|
@ -1,11 +1,44 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class AdminCtrl{
|
require("../app/models/project_model.php");
|
||||||
|
require("../app/entities/project_entity.php");
|
||||||
|
require("../app/models/category_model.php");
|
||||||
|
require("../app/entities/category_entity.php");
|
||||||
|
require("../app/models/image_model.php");
|
||||||
|
require("../app/entities/image_entity.php");
|
||||||
|
require("../app/models/user_model.php");
|
||||||
|
require("../app/entities/user_entity.php");
|
||||||
|
|
||||||
public function admin(){
|
/**
|
||||||
|
* Le controller de la partie accessible uniquement par l'admin
|
||||||
|
* @author Laura
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AdminCtrl{
|
||||||
|
|
||||||
|
public function admin() {
|
||||||
|
|
||||||
|
/* $objCategory = new Category ();
|
||||||
|
$objCategory->setName($_POST['category_name'] ?? "");
|
||||||
|
$objCategory->setParent($_POST['category_parent'] ?? "");
|
||||||
|
|
||||||
|
$objCategoryModel = new CategoryModel();
|
||||||
|
$boolInsert = $objCategoryModel->insert($objCategory);
|
||||||
|
|
||||||
|
EN ATTENTE
|
||||||
|
if ($boolInsert === true) {
|
||||||
|
$_SESSION['success'] = "Catégorie ajoutée avec succès";
|
||||||
|
header("Location:index.php?ctrl=admin&action=admin");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
// Erreur globale
|
||||||
|
$arrError['global'] = "Erreur lors de l'ajout";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
include('../app/views/partials/header.php');
|
||||||
include('../app/views/admin.php');
|
include('../app/views/admin.php');
|
||||||
|
include('../app/views/partials/footer.php');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,10 @@
|
||||||
|
|
||||||
public function search(){
|
public function search(){
|
||||||
|
|
||||||
//variable pour faire fonctionner le script en footer
|
|
||||||
$strPage = "search";
|
|
||||||
|
|
||||||
// inclusion du header
|
// inclusion du header
|
||||||
include('../app/views/partials/header.php');
|
include('../app/views/partials/header.php');
|
||||||
|
|
||||||
//Récupérer les informations du Formulaire
|
//Récupérer les informations du formulaire
|
||||||
$strKeywords = $_POST['keywords']??'';
|
$strKeywords = $_POST['keywords']??'';
|
||||||
$intAuthor = $_POST['author']??0;
|
$intAuthor = $_POST['author']??0;
|
||||||
$intPeriod = $_POST['period']??0;
|
$intPeriod = $_POST['period']??0;
|
||||||
|
|
@ -56,7 +53,7 @@
|
||||||
// Récupération des projetc
|
// Récupération des projetc
|
||||||
$objProjectModel = new ProjectModel;
|
$objProjectModel = new ProjectModel;
|
||||||
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
|
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
|
||||||
strKeywords:$strKeywords, strStartDate:$strStartDate, strEndDate:$strEndDate, intCategory:$intCategory);
|
strKeywords:$strKeywords, strStartDate:$strStartDate, strEndDate:$strEndDate, intCategory:$intCategory);
|
||||||
|
|
||||||
// Initialisation d'un tableau => objets
|
// Initialisation d'un tableau => objets
|
||||||
$arrProjectToDisplay = array();
|
$arrProjectToDisplay = array();
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ require_once("mother_entity.php");
|
||||||
|
|
||||||
class Category extends Entity{
|
class Category extends Entity{
|
||||||
|
|
||||||
private int $_id;
|
private int $_id;
|
||||||
protected string $_name = '';
|
protected string $_name = '';
|
||||||
|
protected string $_parent = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructeur (j'ai toujours pas compris à quoi ça sert)
|
* Constructeur (j'ai toujours pas compris à quoi ça sert)
|
||||||
|
|
@ -53,5 +54,20 @@ class Category extends Entity{
|
||||||
$this->_name = $name;
|
$this->_name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Récuperation du nom du parent de la catégorie
|
||||||
|
* @return string nom de la catégorie
|
||||||
|
*/
|
||||||
|
public function getParent(){
|
||||||
|
return $this->_parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mise à jour du nom du parent de la catégorie
|
||||||
|
* @param string le nouveau nom de la catégorie
|
||||||
|
*/
|
||||||
|
public function setParent($parent){
|
||||||
|
$this->_parent = $parent;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,50 +2,123 @@
|
||||||
require_once("mother_entity.php");
|
require_once("mother_entity.php");
|
||||||
|
|
||||||
class User extends Entity{
|
class User extends Entity{
|
||||||
// Attributs
|
private int $_id;
|
||||||
private string $_name = '';
|
private string $_name = '';
|
||||||
private string $_firstname = '';
|
private string $_firstname = '';
|
||||||
|
private string $_pseudo = '';
|
||||||
|
private string $_image = '';
|
||||||
private string $_mail = '';
|
private string $_mail = '';
|
||||||
private string $_pwd;
|
private string $_pwd;
|
||||||
|
private string $_phone = '';
|
||||||
|
private string $_work = '';
|
||||||
|
private string $_birth = '';
|
||||||
|
private string $_location = '';
|
||||||
|
private string $_description = '';
|
||||||
|
private string $_account_creation = '';
|
||||||
|
private int $_status;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructeur
|
|
||||||
*/
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
// Préfixe de la table pour hydratation
|
$this->_prefix = 'user_';
|
||||||
$this->_prefixe = 'user_';
|
}
|
||||||
|
|
||||||
|
public function getId():int{
|
||||||
|
return $this->_id;
|
||||||
|
}
|
||||||
|
public function setId(int $id){
|
||||||
|
$this->_id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Méthodes - getters et setters
|
|
||||||
public function getName():string{
|
public function getName():string{
|
||||||
return $this->_name;
|
return $this->_name;
|
||||||
}
|
}
|
||||||
public function setName(string $strNewName){
|
public function setName(string $name){
|
||||||
$this->_name = $this->nettoyer($strNewName);
|
$this->_name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFirstname():string{
|
public function getFirstname():string{
|
||||||
return $this->_firstname;
|
return $this->_firstname;
|
||||||
}
|
}
|
||||||
public function setFirstname(string $strFirstname){
|
public function setFirstname(string $firstname){
|
||||||
$this->_firstname = $this->nettoyer($strFirstname);
|
$this->_firstname = $firstname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPseudo():string{
|
||||||
|
return $this->_pseudo;
|
||||||
|
}
|
||||||
|
public function setPseudo(string $pseudo){
|
||||||
|
$this->_pseudo = $pseudo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImage():string{
|
||||||
|
return $this->_image;
|
||||||
|
}
|
||||||
|
public function setImage(string $image){
|
||||||
|
$this->_image = $image;
|
||||||
|
}
|
||||||
|
|
||||||
public function getMail():string{
|
public function getMail():string{
|
||||||
return $this->_mail;
|
return $this->_mail;
|
||||||
}
|
}
|
||||||
public function setMail(string $strMail){
|
public function setMail(string $mail){
|
||||||
$this->_mail = strtolower($this->nettoyer($strMail));
|
$this->_mail = strtolower($mail);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPwd():string{
|
public function getPwd():string{
|
||||||
return $this->_pwd;
|
return $this->_pwd;
|
||||||
}
|
}
|
||||||
public function getPwdHash():string{
|
public function getPwdHash():string{
|
||||||
return password_hash($this->_pwd, PASSWORD_DEFAULT);
|
return password_hash($this->_pwd, PASSWORD_DEFAULT);
|
||||||
}
|
}
|
||||||
public function setPwd(string $strPwd){
|
public function setPwd(string $pwd){
|
||||||
$this->_pwd = $strPwd;
|
$this->_pwd = $pwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPhone():string{
|
||||||
|
return $this->_phone;
|
||||||
|
}
|
||||||
|
public function setPhone(string $phone){
|
||||||
|
$this->_phone = $phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWork():string{
|
||||||
|
return $this->_work;
|
||||||
|
}
|
||||||
|
public function setWork(string $work){
|
||||||
|
$this->_work = $work;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBirth():string{
|
||||||
|
return $this->_birth;
|
||||||
|
}
|
||||||
|
public function setBirth(string $birth){
|
||||||
|
$this->_birth = $birth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLocation():string{
|
||||||
|
return $this->_location;
|
||||||
|
}
|
||||||
|
public function setLocation(string $location){
|
||||||
|
$this->_location = $location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription():string{
|
||||||
|
return $this->_description;
|
||||||
|
}
|
||||||
|
public function setDescription(string $description){
|
||||||
|
$this->_description = $description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAccountCreation():string{
|
||||||
|
return $this->_account_creation;
|
||||||
|
}
|
||||||
|
public function setAccountCreation(string $account_creation){
|
||||||
|
$this->_account_creation = $account_creation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getStatus():int{
|
||||||
|
return $this->_status;
|
||||||
|
}
|
||||||
|
public function setStatus(int $status){
|
||||||
|
$this->_status = $status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
<?php
|
|
||||||
require_once("mother_entity.php");
|
|
||||||
|
|
||||||
class User extends Entity{
|
|
||||||
private int $_id;
|
|
||||||
private string $_name = '';
|
|
||||||
private string $_firstname = '';
|
|
||||||
private string $_pseudo = '';
|
|
||||||
private string $_image = '';
|
|
||||||
private string $_mail = '';
|
|
||||||
private string $_pwd;
|
|
||||||
private string $_phone = '';
|
|
||||||
private string $_work = '';
|
|
||||||
private string $_birth = '';
|
|
||||||
private string $_location = '';
|
|
||||||
private string $_description = '';
|
|
||||||
private string $_account_creation = '';
|
|
||||||
private int $_status;
|
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
$this->_prefix = 'user_';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId():int{
|
|
||||||
return $this->_id;
|
|
||||||
}
|
|
||||||
public function setId(int $id){
|
|
||||||
$this->_id = $id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getName():string{
|
|
||||||
return $this->_name;
|
|
||||||
}
|
|
||||||
public function setName(string $name){
|
|
||||||
$this->_name = $name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFirstname():string{
|
|
||||||
return $this->_firstname;
|
|
||||||
}
|
|
||||||
public function setFirstname(string $firstname){
|
|
||||||
$this->_firstname = $firstname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPseudo():string{
|
|
||||||
return $this->_pseudo;
|
|
||||||
}
|
|
||||||
public function setPseudo(string $pseudo){
|
|
||||||
$this->_pseudo = $pseudo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getImage():string{
|
|
||||||
return $this->_image;
|
|
||||||
}
|
|
||||||
public function setImage(string $image){
|
|
||||||
$this->_image = $image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMail():string{
|
|
||||||
return $this->_mail;
|
|
||||||
}
|
|
||||||
public function setMail(string $mail){
|
|
||||||
$this->_mail = strtolower($mail);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPwd():string{
|
|
||||||
return $this->_pwd;
|
|
||||||
}
|
|
||||||
public function getPwdHash():string{
|
|
||||||
return password_hash($this->_pwd, PASSWORD_DEFAULT);
|
|
||||||
}
|
|
||||||
public function setPwd(string $pwd){
|
|
||||||
$this->_pwd = $pwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPhone():string{
|
|
||||||
return $this->_phone;
|
|
||||||
}
|
|
||||||
public function setPhone(string $phone){
|
|
||||||
$this->_phone = $phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getWork():string{
|
|
||||||
return $this->_work;
|
|
||||||
}
|
|
||||||
public function setWork(string $work){
|
|
||||||
$this->_work = $work;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBirth():string{
|
|
||||||
return $this->_birth;
|
|
||||||
}
|
|
||||||
public function setBirth(string $birth){
|
|
||||||
$this->_birth = $birth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLocation():string{
|
|
||||||
return $this->_location;
|
|
||||||
}
|
|
||||||
public function setLocation(string $location){
|
|
||||||
$this->_location = $location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDescription():string{
|
|
||||||
return $this->_description;
|
|
||||||
}
|
|
||||||
public function setDescription(string $description){
|
|
||||||
$this->_description = $description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAccountCreation():string{
|
|
||||||
return $this->_account_creation;
|
|
||||||
}
|
|
||||||
public function setAccountCreation(string $account_creation){
|
|
||||||
$this->_account_creation = $account_creation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getStatus():int{
|
|
||||||
return $this->_status;
|
|
||||||
}
|
|
||||||
public function setStatus(int $status){
|
|
||||||
$this->_status = $status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -8,18 +8,40 @@
|
||||||
|
|
||||||
class CategoryModel extends Connect{
|
class CategoryModel extends Connect{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de récupération des catégories
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
|
||||||
public function findAllCategory(int $intLimit=0):array{
|
public function findAllCategory(int $intLimit=0):array{
|
||||||
|
|
||||||
// Ecrire la requête
|
|
||||||
$strRq = "SELECT category.*
|
$strRq = "SELECT category.*
|
||||||
FROM category";
|
FROM category";
|
||||||
|
|
||||||
|
|
||||||
if ($intLimit > 0){
|
if ($intLimit > 0){
|
||||||
$strRq .= " LIMIT ".$intLimit;
|
$strRq .= " LIMIT ".$intLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lancer la requête et récupérer les résultats
|
|
||||||
return $this->_db->query($strRq)->fetchAll();
|
return $this->_db->query($strRq)->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fonction d'insertion d'une nouvelle catégorie dans la bdd
|
||||||
|
* @param object $objUser L'objet utilisateur
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée (true/false)
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function insert(object $objCategory):bool{
|
||||||
|
|
||||||
|
$strRq = "INSERT INTO category (category_name, category_parent)
|
||||||
|
VALUES (:name, :parent)";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
|
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(":parent", $objCategory->getParent(), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
return $rqPrep->execute();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,9 +8,13 @@
|
||||||
|
|
||||||
class ImageModel extends Connect{
|
class ImageModel extends Connect{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de récupération des images
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
|
||||||
public function findAllImage(int $intLimit=0):array{
|
public function findAllImage(int $intLimit=0):array{
|
||||||
|
|
||||||
// Ecrire la requête
|
|
||||||
$strRq = "SELECT image.*
|
$strRq = "SELECT image.*
|
||||||
FROM image";
|
FROM image";
|
||||||
|
|
||||||
|
|
@ -19,7 +23,6 @@
|
||||||
$strRq .= " LIMIT ".$intLimit;
|
$strRq .= " LIMIT ".$intLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lancer la requête et récupérer les résultats
|
|
||||||
return $this->_db->query($strRq)->fetchAll();
|
return $this->_db->query($strRq)->fetchAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -58,11 +58,7 @@
|
||||||
public function insert(object $objUser):bool{
|
public function insert(object $objUser):bool{
|
||||||
|
|
||||||
// 2. Construire la requête
|
// 2. Construire la requête
|
||||||
/*$strRq = "INSERT INTO users (user_name, user_firstname, user_mail, user_pwd)
|
|
||||||
VALUES ('".$objUser->getName()."',
|
|
||||||
'".$objUser->getFirstname()."',
|
|
||||||
'".$objUser->getMail()."',
|
|
||||||
'".$objUser->getPwdHash()."')";*/
|
|
||||||
$strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description)
|
$strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description)
|
||||||
VALUES (:name, :firstname, :pseudo,:mail, :pwd, :phone, :work, :location,:description)";
|
VALUES (:name, :firstname, :pseudo,:mail, :pwd, :phone, :work, :location,:description)";
|
||||||
// Préparer la requête
|
// Préparer la requête
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
directement en contact avec les entreprises.</p>
|
directement en contact avec les entreprises.</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section aria-label="Articles récents">
|
<section class="container" aria-label="Articles récents">
|
||||||
<h2 class="visually-hidden">Les 4 derniers articles</h2>
|
<h2 class="visually-hidden">Les 4 derniers articles</h2>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
||||||
|
|
@ -1,382 +1,175 @@
|
||||||
|
|
||||||
<!-- Page : Inscription -->
|
<!-- Page : Inscription -->
|
||||||
|
|
||||||
|
|
||||||
<main class="container py-5">
|
<main class="container py-5">
|
||||||
|
|
||||||
<!-- Centrage du formulaire -->
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<!-- Contenu principal de la page -->
|
|
||||||
<main class="container py-5">
|
|
||||||
|
|
||||||
<!-- Centrage horizontal du formulaire -->
|
<!-- Centrage horizontal du formulaire -->
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-12 col-md-10 col-lg-6">
|
<div class="col-12 col-md-10 col-lg-6">
|
||||||
|
|
||||||
<!-- Carte contenant le formulaire d'inscription -->
|
<!-- Carte contenant le formulaire d'inscription -->
|
||||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||||
|
|
||||||
<!-- Titre principal de la page -->
|
<!-- Titre principal de la page -->
|
||||||
<h1 class="h3 fw-bold mb-1">Inscription</h1>
|
|
||||||
|
|
||||||
<!-- Texte descriptif -->
|
|
||||||
<p class="text-secondary mb-4">
|
|
||||||
Créez votre compte utilisateur.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Formulaire d'inscription -->
|
|
||||||
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
|
||||||
<form method="POST">
|
|
||||||
|
|
||||||
<div class="row g-3">
|
|
||||||
|
|
||||||
<!-- Champ : prénom de l'utilisateur -->
|
|
||||||
<div class="col-md-6">
|
|
||||||
<label class="form-label" for="user_firstname">
|
|
||||||
Prénom *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_firstname"
|
|
||||||
name="user_firstname"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : nom de l'utilisateur -->
|
|
||||||
<div class="col-md-6">
|
|
||||||
<label class="form-label" for="user_name">
|
|
||||||
Nom *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_name"
|
|
||||||
name="user_name"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : pseudo (identifiant public de l'utilisateur) -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_pseudo">
|
|
||||||
Pseudo *
|
|
||||||
</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-text">@</span>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_pseudo"
|
|
||||||
name="user_pseudo"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<!-- Carte Bootstrap contenant le formulaire -->
|
|
||||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
|
||||||
|
|
||||||
<!-- Titre et description -->
|
|
||||||
<h1 class="h3 fw-bold mb-1">Inscription</h1>
|
<h1 class="h3 fw-bold mb-1">Inscription</h1>
|
||||||
|
|
||||||
|
<!-- Texte descriptif -->
|
||||||
<p class="text-secondary mb-4">
|
<p class="text-secondary mb-4">
|
||||||
Créez votre compte utilisateur.
|
Créez votre compte utilisateur.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<!-- Formulaire d'inscription -->
|
||||||
// Affichage des messages d'erreur du formulaire, l'affichage en Bootstrap (validation côté serveur)
|
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
||||||
if (!empty($arrError)) { ?>
|
<form method="POST">
|
||||||
<div class="alert alert-danger" role="alert">
|
|
||||||
<?php foreach ($arrError as $strError) { ?>
|
|
||||||
<p class="mb-0">
|
|
||||||
<?php echo htmlspecialchars($strError); ?>
|
|
||||||
</p>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<!-- Formulaire d'inscription -->
|
|
||||||
<!-- Les données sont envoyées en POST vers la méthode signin du user_controller.php -->
|
|
||||||
<form method="POST" action="index.php?ctrl=user&action=signin">
|
|
||||||
|
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
|
|
||||||
<!-- Champ : Nom -->
|
<!-- Champ : prénom de l'utilisateur -->
|
||||||
<div class="col-md-6">
|
|
||||||
<label class="form-label" for="user_name">
|
|
||||||
Nom *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control <?php if (isset($arrError['user_name'])) echo 'is-invalid'; ?>"
|
|
||||||
type="text"
|
|
||||||
id="user_name"
|
|
||||||
name="user_name"
|
|
||||||
value="<?php echo htmlspecialchars($objUser->getName()); ?>"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : Prénom -->
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label class="form-label" for="user_firstname">
|
<label class="form-label" for="user_firstname">
|
||||||
Prénom *
|
Prénom *
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control <?php if (isset($arrError['user_firstname'])) echo 'is-invalid'; ?>"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
id="user_firstname"
|
id="user_firstname"
|
||||||
name="user_firstname"
|
name="user_firstname"
|
||||||
value="<?php echo htmlspecialchars($objUser->getFirstname()); ?>"
|
required >
|
||||||
required
|
</div>
|
||||||
|
|
||||||
|
<!-- Champ : nom de l'utilisateur -->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label class="form-label" for="user_name">
|
||||||
|
Nom *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
id="user_name"
|
||||||
|
name="user_name"
|
||||||
|
required
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ : Pseudo -->
|
<!-- Champ : pseudo -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_pseudo">
|
<label class="form-label" for="user_pseudo">
|
||||||
Pseudo *
|
Pseudo *
|
||||||
</label>
|
</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-text">@</span>
|
<span class="input-group-text">@</span>
|
||||||
<input
|
|
||||||
class="form-control <?php if (isset($arrError['user_pseudo'])) echo 'is-invalid'; ?>"
|
|
||||||
type="text"
|
|
||||||
id="user_pseudo"
|
|
||||||
name="user_pseudo"
|
|
||||||
value="<?php echo htmlspecialchars($objUser->getPseudo()); ?>"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : Adresse e-mail -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_mail">
|
|
||||||
Adresse e-mail *
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
class="form-control <?php if (isset($arrError['user_mail'])) echo 'is-invalid'; ?>"
|
class="form-control"
|
||||||
type="email"
|
type="text"
|
||||||
id="user_mail"
|
id="user_pseudo"
|
||||||
name="user_mail"
|
name="user_pseudo"
|
||||||
value="<?php echo htmlspecialchars($objUser->getMail()); ?>"
|
required
|
||||||
required
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Champ : Mot de passe -->
|
<!-- Champ : adresse e-mail -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_password">
|
<label class="form-label" for="user_mail">
|
||||||
Mot de passe *
|
Adresse e-mail *
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control <?php if (isset($arrError['user_password'])) echo 'is-invalid'; ?>"
|
class="form-control"
|
||||||
type="password"
|
type="email"
|
||||||
id="user_password"
|
id="user_mail"
|
||||||
name="user_password"
|
name="user_mail"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ : Confirmation du mot de passe -->
|
<!-- Champ : mot de passe -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="pwd_confirm">
|
<label class="form-label" for="user_password">
|
||||||
Confirmation du mot de passe *
|
Mot de passe *
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control <?php if (isset($arrError['pwd_confirm'])) echo 'is-invalid'; ?>"
|
class="form-control"
|
||||||
type="password"
|
type="password"
|
||||||
id="pwd_confirm"
|
id="user_password"
|
||||||
name="pwd_confirm"
|
name="user_password"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ optionnel : numéro de téléphone -->
|
<!-- Champ optionnel : numéro de téléphone -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_phone">
|
<label class="form-label" for="user_phone">
|
||||||
Téléphone
|
Téléphone
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
id="user_phone"
|
id="user_phone"
|
||||||
name="user_phone"
|
name="user_phone"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ optionnel : profession de l'utilisateur -->
|
<!-- Champ optionnel : profession de l'utilisateur -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_work">
|
<label class="form-label" for="user_work">
|
||||||
Profession
|
Profession
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
id="user_work"
|
id="user_work"
|
||||||
name="user_work"
|
name="user_work"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ optionnel : localisation de l'utilisateur -->
|
<!-- Champ optionnel : localisation de l'utilisateur -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_location">
|
<label class="form-label" for="user_location">
|
||||||
Localisation
|
Localisation
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
id="user_location"
|
id="user_location"
|
||||||
name="user_location"
|
name="user_location"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ optionnel : phrase d'accroche / description courte -->
|
<!-- Champ optionnel : phrase d'accroche -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label class="form-label" for="user_description">
|
<label class="form-label" for="user_description">
|
||||||
Phrase d'accroche
|
Phrase d'accroche
|
||||||
</label>
|
</label>
|
||||||
<textarea
|
<textarea
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="user_description"
|
id="user_description"
|
||||||
name="user_description"
|
name="user_description"
|
||||||
rows="3"
|
rows="3"
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Lien vers la page de connexion -->
|
<!-- Bouton de soumission du formulaire -->
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 d-grid mt-2">
|
||||||
<small class="text-secondary">
|
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||||
Déjà un compte ?
|
Créer mon compte
|
||||||
<a href="index.php?ctrl=user&action=login">Se connecter</a>
|
</button>
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Bouton de soumission -->
|
|
||||||
<div class="col-12 d-grid mt-2">
|
|
||||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
|
||||||
Créer mon compte
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Lien vers la page de connexion -->
|
||||||
|
<div class="col-12 text-center">
|
||||||
|
<small class="text-secondary">
|
||||||
|
Déjà un compte ?
|
||||||
|
<a href="index.php?ctrl=user&action=login">Se connecter</a>
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : adresse e-mail -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_mail">
|
|
||||||
Adresse e-mail *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="email"
|
|
||||||
id="user_mail"
|
|
||||||
name="user_mail"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : mot de passe -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_password">
|
|
||||||
Mot de passe *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="password"
|
|
||||||
id="user_password"
|
|
||||||
name="user_password"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Confirmation du mot de passe -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="pwd_confirm">
|
|
||||||
Confirmation du mot de passe *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control <?php if (isset($arrError['pwd_confirm'])) echo 'is-invalid'; ?>"
|
|
||||||
type="password"
|
|
||||||
id="pwd_confirm"
|
|
||||||
name="pwd_confirm"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ optionnel : numéro de téléphone -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_phone">
|
|
||||||
Téléphone
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_phone"
|
|
||||||
name="user_phone"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ optionnel : profession de l'utilisateur -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_work">
|
|
||||||
Profession
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_work"
|
|
||||||
name="user_work"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ optionnel : localisation de l'utilisateur -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_location">
|
|
||||||
Localisation
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
id="user_location"
|
|
||||||
name="user_location"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ optionnel : phrase d'accroche / description courte -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label class="form-label" for="user_description">
|
|
||||||
Phrase d'accroche
|
|
||||||
</label>
|
|
||||||
<textarea
|
|
||||||
class="form-control"
|
|
||||||
id="user_description"
|
|
||||||
name="user_description"
|
|
||||||
rows="3"
|
|
||||||
></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Bouton de soumission du formulaire -->
|
|
||||||
<div class="col-12 d-grid mt-2">
|
|
||||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
|
||||||
Créer mon compte
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Lien vers la page de connexion -->
|
|
||||||
<div class="col-12 text-center">
|
|
||||||
<small class="text-secondary">
|
|
||||||
Déjà un compte ?
|
|
||||||
<a href="connexion.php">Se connecter</a>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
@ -28,5 +28,7 @@
|
||||||
<p>Suivez-nous</p>
|
<p>Suivez-nous</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
||||||
|
<script src="js/scripts.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -11,10 +11,11 @@
|
||||||
<link rel="stylesheet" href="assests/css/style.css">
|
<link rel="stylesheet" href="assests/css/style.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||||
|
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
|
||||||
<title>Folliow</title>
|
<title>Folliow</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-expand-lg navbar-light">
|
<nav class="navbar navbar-expand-lg navbar-light">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
<a class="navbar-brand d-flex align-items-center" href="#">
|
<a class="navbar-brand d-flex align-items-center" href="#">
|
||||||
|
|
@ -68,7 +69,7 @@
|
||||||
<ul class="navbar-nav ">
|
<ul class="navbar-nav ">
|
||||||
<li class="nav-item ">
|
<li class="nav-item ">
|
||||||
<a class="nav-link" href="edit_account.php" title="Modifier mon compte" aria-label="Modifier mon compte">
|
<a class="nav-link" href="edit_account.php" title="Modifier mon compte" aria-label="Modifier mon compte">
|
||||||
<img src=".<?php echo $_SESSION["user"]["user_image"]; ?>"
|
<img src=".<?php echo $_SESSION["user"]["user_image"]; ?>"
|
||||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
||||||
style="width: 36px; height: 36px; object-fit: cover;"
|
style="width: 36px; height: 36px; object-fit: cover;"
|
||||||
alt="Photo de profil">
|
alt="Photo de profil">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue