Merge pull request #18 from Yasder5/main
01010000 01101001 01111010 01111010 01100001
This commit is contained in:
commit
4961d959ea
36 changed files with 926 additions and 886 deletions
36
.github/workflows/deploy.yml
vendored
Normal file
36
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: Deploy production (servyass)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy via SSH
|
||||||
|
uses: appleboy/ssh-action@master
|
||||||
|
with:
|
||||||
|
host: boulayoune.com
|
||||||
|
username: yass
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
port: 22
|
||||||
|
script: |
|
||||||
|
set -e
|
||||||
|
echo "➡️ Connexion réussie !"
|
||||||
|
cd /var/www/projet_php
|
||||||
|
|
||||||
|
echo "➡️ Mise à jour du code..."
|
||||||
|
# On enlève le SUDO ici pour que Git utilise la clé de l'utilisateur yass
|
||||||
|
git fetch origin main
|
||||||
|
git reset --hard origin/main
|
||||||
|
|
||||||
|
echo "➡️ Correction des permissions et nettoyage..."
|
||||||
|
# On garde le SUDO ici car ces commandes touchent au système
|
||||||
|
sudo chown -R yass:www-data /var/www/projet_php
|
||||||
|
sudo chmod -R 775 /var/www/projet_php/templates_c
|
||||||
|
sudo rm -rf /var/www/projet_php/templates_c/*
|
||||||
|
|
||||||
|
echo "✅ Déploiement terminé ! (Shin-en no Egotisu)"
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
/templates_c/
|
||||||
|
/templates_c/**
|
||||||
|
Before Width: | Height: | Size: 232 KiB After Width: | Height: | Size: 232 KiB |
|
|
@ -8,6 +8,8 @@
|
||||||
require("./entities/image_entity.php");
|
require("./entities/image_entity.php");
|
||||||
require("./models/user_model.php");
|
require("./models/user_model.php");
|
||||||
require("./entities/user_entity.php");
|
require("./entities/user_entity.php");
|
||||||
|
require("./models/authorisation_model.php");
|
||||||
|
require("./entities/authorisation_entity.php");
|
||||||
require("mother_controller.php");
|
require("mother_controller.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,33 +20,33 @@
|
||||||
class AdminCtrl extends MotherCtrl{
|
class AdminCtrl extends MotherCtrl{
|
||||||
|
|
||||||
public function admin(){
|
public function admin(){
|
||||||
/*accès à la page admin
|
|
||||||
if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){
|
if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){
|
||||||
header("Location:index.php?ctrl=error&action=error_403");
|
header("Location:index.php?ctrl=error&action=error_403");
|
||||||
exit;
|
exit;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
//gestion de l'user
|
||||||
$objCategoryModel = new CategoryModel;
|
$objCategoryModel = new CategoryModel;
|
||||||
|
|
||||||
if (!empty($_POST['new_category'])) {
|
if (!empty($_POST['new_category'])) {
|
||||||
$objNewCategory = new Category;
|
$newCat = new Category();
|
||||||
if (!empty($objNewCategory->getName())) {
|
$newCat->setName($_POST['new_category']);
|
||||||
$objNewCategory = $_POST['new_category'];
|
$objCategoryModel->insertCategory($newCat);
|
||||||
$objCategoryModel->insertCategory($objNewCategory);
|
header('Location: index.php?ctrl=admin&action=admin');
|
||||||
header("Location:index.php?ctrl=admin&action=admin");
|
exit;
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['edit_category'])) {
|
if (!empty($_POST['id_to_edit']) && !empty($_POST['new_name'])) {
|
||||||
$objEditCategory = new Category;
|
$editCat = new Category();
|
||||||
if ($objEditCategory->getId() > 0) {
|
$editCat->setId($_POST['id_to_edit']);
|
||||||
$objEditCategory = $_POST['edit_category'];
|
$editCat->setName($_POST['new_name']);
|
||||||
$objCategoryModel->editCategory($objEditCategory);
|
$objCategoryModel->editCategory($editCat);
|
||||||
header("Location:index.php?ctrl=admin&action=admin");
|
header('Location: index.php?ctrl=admin&action=admin');
|
||||||
exit;
|
exit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//affichage select des catégories
|
||||||
$arrCategory = $objCategoryModel->findAllCategory();
|
$arrCategory = $objCategoryModel->findAllCategory();
|
||||||
$arrCategoryToDisplay = array();
|
$arrCategoryToDisplay = array();
|
||||||
|
|
||||||
|
|
@ -53,10 +55,56 @@
|
||||||
$objCategory->hydrate($arrDetCategory);
|
$objCategory->hydrate($arrDetCategory);
|
||||||
$arrCategoryToDisplay[] = $objCategory;
|
$arrCategoryToDisplay[] = $objCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gestion de l'user
|
||||||
|
$objUserModel = new UserModel;
|
||||||
|
|
||||||
|
if (!empty($_POST['action'])) {
|
||||||
|
$intUserId = (int)$_POST['user_id'];
|
||||||
|
|
||||||
|
if ($intUserId > 0) {
|
||||||
|
if ($_POST['action'] === 'update_status' && !empty($_POST['new_status'])) {
|
||||||
|
$objUser = new User();
|
||||||
|
$objUser->setId($intUserId);
|
||||||
|
$objUser->setStatus((int)$_POST['new_status']);
|
||||||
|
if ($objUserModel->editStatus($objUser)) {
|
||||||
|
$_SESSION['message_success'] = "Le statut a bien été modifié !";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($_POST['action'] === 'delete_user') {
|
||||||
|
$objUserModel->delete_soft($intUserId);
|
||||||
|
$_SESSION['message_success'] = "L'utilisateur a été supprimé.";
|
||||||
|
}
|
||||||
|
header("Location: index.php?ctrl=admin&action=admin");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//affichage select des users
|
||||||
|
$arrUser = $objUserModel->findAllUsers();
|
||||||
|
$arrUserToDisplay = array();
|
||||||
|
|
||||||
|
foreach($arrUser as $arrDetUser){
|
||||||
|
$objUser = new User;
|
||||||
|
$objUser->hydrate($arrDetUser);
|
||||||
|
$arrUserToDisplay[] = $objUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
//affichage select des authorisations
|
||||||
|
$objAuthorisationModel = new AuthorisationModel;
|
||||||
|
$arrAuthorisation = $objAuthorisationModel->findAllAuthorisation();
|
||||||
|
$arrAuthorisationToDisplay = array();
|
||||||
|
|
||||||
|
foreach($arrAuthorisation as $arrDetAuthorisation){
|
||||||
|
$objAuthorisation = new Authorisation;
|
||||||
|
$objAuthorisation->hydrate($arrDetAuthorisation);
|
||||||
|
$arrAuthorisationToDisplay[] = $objAuthorisation;
|
||||||
|
}
|
||||||
|
|
||||||
// Il faudra donner à maman et gérer l'affichage quand Smarty sera prêt
|
//gérer l'affichage
|
||||||
$this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay;
|
$this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay;
|
||||||
//$this->_arrData['intCategory'] = $objCategoryModel->;
|
$this->_arrData['arrUserToDisplay'] = $arrUserToDisplay;
|
||||||
|
$this->_arrData['arrAuthorisationToDisplay'] = $arrAuthorisationToDisplay;
|
||||||
$this->_display("admin");
|
$this->_display("admin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function home(){
|
public function home(){
|
||||||
|
|
||||||
|
|
||||||
|
$intCategory = 0;
|
||||||
|
if (!empty($_GET['filter_cat'])) {
|
||||||
|
$intCategory = (int) $_GET['filter_cat'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$boolOld = false;
|
||||||
|
if (!empty($_GET['filter_old']) && $_GET['filter_old'] == 'true') {
|
||||||
|
$boolOld = true;
|
||||||
|
}
|
||||||
|
|
||||||
$objProjectModel = new ProjectModel;
|
$objProjectModel = new ProjectModel;
|
||||||
$arrProject = $objProjectModel->findAll();
|
$arrProject = $objProjectModel->findAll(0,'',0,0,'','','',$intCategory,$boolOld);
|
||||||
$arrProjectToDisplay = array();
|
$arrProjectToDisplay = array();
|
||||||
foreach($arrProject as $arrDetProject){
|
foreach($arrProject as $arrDetProject){
|
||||||
$objProject = new Project;
|
$objProject = new Project;
|
||||||
|
|
@ -34,8 +45,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
||||||
|
|
||||||
|
|
||||||
$this->_display("home");
|
$this->_display("home");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -43,8 +52,8 @@
|
||||||
/**
|
/**
|
||||||
* Fonction d'affichage de la barre de recherche
|
* Fonction d'affichage de la barre de recherche
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function search(){
|
public function search(){
|
||||||
|
|
||||||
//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;
|
||||||
|
|
@ -76,6 +85,7 @@
|
||||||
|
|
||||||
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
||||||
$this->_arrData['arrCategory'] = $arrCategory;
|
$this->_arrData['arrCategory'] = $arrCategory;
|
||||||
|
$this->_arrData['arrProject'] = $arrProject;
|
||||||
$this->_arrData['arrUser'] = $arrUser;
|
$this->_arrData['arrUser'] = $arrUser;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -87,62 +97,62 @@
|
||||||
/**
|
/**
|
||||||
* Fonction d'affichage de la page projet
|
* Fonction d'affichage de la page projet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public function project (){
|
public function project (){
|
||||||
|
|
||||||
$objProjectModel = new ProjectModel;
|
$objProjectModel = new ProjectModel;
|
||||||
$arrProject = $objProjectModel->findAll(4);
|
$arrProject = $objProjectModel->findAll(4);
|
||||||
$arrProjectToDiplay = array();
|
$arrProjectToDisplay = array();
|
||||||
foreach($arrProject as $arrDetProject){
|
foreach($arrProject as $arrDetProject){
|
||||||
$objProject = new Project;
|
$objProject = new Project;
|
||||||
$objProject->hydrate($arrDetProject);
|
$objProject->hydrate($arrDetProject);
|
||||||
$arrProjectToDiplay[] = $objProject;
|
$arrProjectToDisplay[] = $objProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
$objImageModel = new ImageModel;
|
$objImageModel = new ImageModel;
|
||||||
$arrImage = $objImageModel->findAllImage(4);
|
$arrImage = $objImageModel->findAllImage(4);
|
||||||
$arrImageToDiplay = array();
|
$arrImageToDisplay = array();
|
||||||
foreach($arrImage as $arrDetImage){
|
foreach($arrImage as $arrDetImage){
|
||||||
$objImage = new Image;
|
$objImage = new Image;
|
||||||
$objImage->hydrate($arrDetImage);
|
$objImage->hydrate($arrDetImage);
|
||||||
$arrImageToDiplay[] = $objImage;
|
$arrImageToDisplay[] = $objImage;
|
||||||
}
|
}
|
||||||
//Variable data
|
//Variable data
|
||||||
$_SESSION['title'] = $_POST['titleProject']??"";
|
$_SESSION['title'] = $_POST['titleProject']??"";
|
||||||
$_SESSION['description'] = $_POST['descProject']??"";
|
$_SESSION['description'] = $_POST['descProject']??"";
|
||||||
$_SESSION['content'] = $_POST['textProject']??"";
|
$_SESSION['content'] = $_POST['textProject']??"";
|
||||||
$_SESSION['thumbnail'] = $_FILES['imageProject']['name']??"";
|
$_SESSION['thumbnail'] = $_FILES['imageThumbnail']['name']??"";
|
||||||
$_SESSION['status'] = 'en_attente';
|
$_SESSION['status'] = 'en_attente';
|
||||||
|
$_SESSION['user_id'] = $_SESSION['user']['user_id'];
|
||||||
|
|
||||||
|
|
||||||
$objProject = new Project();
|
$objProject = new Project();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
/* Créer par Besnik le GOAT et l'autre GOAT de Guillaume
|
* Créer par Besnik le GOAT et l'autre GOAT de Guillaume
|
||||||
/*
|
*
|
||||||
/* @return bool pour savoir si le fichier existe,
|
* @return bool pour savoir si le fichier existe,
|
||||||
/* puis déplace vers le fichier uploads avec les images projet des utilisateurs
|
* puis déplace vers le fichier uploads avec les images projet des utilisateurs
|
||||||
/* Communication avec la BDD
|
* Communication avec la BDD
|
||||||
*/
|
*/
|
||||||
if (($_SESSION['thumbnail'] != null)){
|
if (($_SESSION['thumbnail'] != null)){
|
||||||
$strDest = "";
|
$strDest = "";
|
||||||
if ((count($_FILES) > 0) && ($_FILES['imageProject']['error'] != 4)){
|
if ((count($_FILES) > 0) && ($_FILES['imageProject']['error'] != 4)){
|
||||||
$strDest = '../public/uploads/projects/'.$_FILES['imageProject']['name'];
|
$strDest = 'uploads/projects/'.$_FILES['imageProject']['name'];
|
||||||
var_dump($strDest);
|
|
||||||
move_uploaded_file($_FILES['imageProject']['tmp_name'], $strDest);
|
move_uploaded_file($_FILES['imageProject']['tmp_name'], $strDest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** En cas d'appuis sur le bouton d'envoie ou celui de remettre a plus tard
|
/** En cas d'appuis sur le bouton d'envoie ou celui de remettre a plus tard
|
||||||
/* 1. Changement de status
|
* 1. Changement de status
|
||||||
/* 2. Hydratation avec les informations récupéré de l'utilisateur
|
* 2. Hydratation avec les informations récupéré de l'utilisateur
|
||||||
/* 3. Envoie des données à la BDD
|
* 3. Envoie des données à la BDD
|
||||||
*/
|
*/
|
||||||
if (isset($_POST['sendMessage'])) {
|
if (isset($_POST['sendMessage'])) {
|
||||||
$_SESSION['status'] = 'publié';
|
$_SESSION['status'] = 'publié';
|
||||||
$objProject->hydrate($_SESSION);
|
$objProject->hydrate($_SESSION);
|
||||||
$objProject->setThumbnail($strDest);
|
$objProject->setThumbnail($strDest);
|
||||||
|
var_dump($strDest);
|
||||||
|
var_dump($objProject);
|
||||||
$objProjectModel->insert($objProject);
|
$objProjectModel->insert($objProject);
|
||||||
|
|
||||||
} else if (isset($_POST['toContinue'])) {
|
} else if (isset($_POST['toContinue'])) {
|
||||||
|
|
@ -151,14 +161,12 @@
|
||||||
$objProjectModel->insert($objProject);
|
$objProjectModel->insert($objProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Débuggage
|
|
||||||
var_dump($_SESSION);
|
var_dump($_SESSION);
|
||||||
var_dump($objProject);
|
var_dump($objProject);
|
||||||
$this->_arrData['arrProjectToDiplay'] = $arrProjectToDiplay;
|
$this->_arrData['arrProjectToDiplay'] = $arrProjectToDisplay;
|
||||||
$this->_arrData['arrImageToDiplay'] = $arrImageToDiplay;
|
$this->_arrData['arrImageToDiplay'] = $arrImageToDisplay;
|
||||||
|
|
||||||
$this->_display("project");
|
$this->_display("project");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -174,7 +182,7 @@
|
||||||
$objProject->hydrate($arrProject);
|
$objProject->hydrate($arrProject);
|
||||||
|
|
||||||
$this->_arrData["objProject"] = $objProject;
|
$this->_arrData["objProject"] = $objProject;
|
||||||
$this->_display("projet_display");
|
$this->_display("project_display");
|
||||||
} else {
|
} else {
|
||||||
header("Location: index.php?ctrl=project&action=home");
|
header("Location: index.php?ctrl=project&action=home");
|
||||||
exit;
|
exit;
|
||||||
|
|
@ -185,8 +193,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendEmail()
|
public function sendEmail(){
|
||||||
{
|
|
||||||
if (count($_POST) > 0) {
|
if (count($_POST) > 0) {
|
||||||
|
|
||||||
$projectId = (int)($_POST['project_id'] ?? 0);
|
$projectId = (int)($_POST['project_id'] ?? 0);
|
||||||
|
|
@ -217,6 +224,7 @@
|
||||||
|
|
||||||
$objMail->SMTPDebug = 0;
|
$objMail->SMTPDebug = 0;
|
||||||
|
|
||||||
|
|
||||||
$objMail->SMTPAuth = TRUE;
|
$objMail->SMTPAuth = TRUE;
|
||||||
$objMail->SMTPSecure = "tls";
|
$objMail->SMTPSecure = "tls";
|
||||||
$objMail->Port = 587;
|
$objMail->Port = 587;
|
||||||
|
|
@ -256,4 +264,46 @@
|
||||||
header("Location: index.php?ctrl=project&action=home");
|
header("Location: index.php?ctrl=project&action=home");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function accept(){
|
||||||
|
|
||||||
|
//Récupéré l'id dans l'url
|
||||||
|
$intId = $_GET['id'];
|
||||||
|
|
||||||
|
//Je créer un nouveau model pour exec la commande SQL
|
||||||
|
$objProjectModel = new ProjectModel;
|
||||||
|
$objProjectModel->accept($intId);
|
||||||
|
|
||||||
|
//Redirection vers la page
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function refuse(){
|
||||||
|
|
||||||
|
//Récupéré l'id dans l'url
|
||||||
|
$intId = $_GET['id'];
|
||||||
|
|
||||||
|
//Je créer un nouveau model pour exec la commande SQL
|
||||||
|
$objProjectModel = new ProjectModel;
|
||||||
|
$objProjectModel->refuse($intId);
|
||||||
|
|
||||||
|
//Redirection vers la page
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(){
|
||||||
|
|
||||||
|
//Récupéré l'id dans l'url
|
||||||
|
$intId = $_GET['id'];
|
||||||
|
|
||||||
|
//Je créer un nouveau model pour exec la commande SQL
|
||||||
|
$objProjectModel = new ProjectModel;
|
||||||
|
$objProjectModel->delete($intId);
|
||||||
|
|
||||||
|
//Redirection vers la page
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
<?php
|
|
||||||
/* Smarty version 5.7.0, created on 2026-02-06 08:21:14
|
|
||||||
from 'file:views/home.tpl' */
|
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
||||||
'version' => '5.7.0',
|
|
||||||
'unifunc' => 'content_6985a47abcda40_19846426',
|
|
||||||
'has_nocache_code' => false,
|
|
||||||
'file_dependency' =>
|
|
||||||
array (
|
|
||||||
'299f75d7692a19207f23bf5795a2721f507c3fc6' =>
|
|
||||||
array (
|
|
||||||
0 => 'views/home.tpl',
|
|
||||||
1 => 1770365364,
|
|
||||||
2 => 'file',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'includes' =>
|
|
||||||
array (
|
|
||||||
'file:views/_partial/preview.tpl' => 1,
|
|
||||||
),
|
|
||||||
))) {
|
|
||||||
function content_6985a47abcda40_19846426 (\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
|
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_3150142016985a47abb6c29_00747518', "content");
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php }
|
|
||||||
/* {block "content"} */
|
|
||||||
class Block_3150142016985a47abb6c29_00747518 extends \Smarty\Runtime\Block
|
|
||||||
{
|
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
|
||||||
<h1 class="logo">Folliow</h1>
|
|
||||||
<h2>Là où les talents rencontrent leur avenir</h2>
|
|
||||||
<p class="col-6">Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
|
|
||||||
Créer un portfolio réellement pertinent aux exigences du marché et rentrez
|
|
||||||
directement en contact avec les entreprises.</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="container" aria-label="Articles récents">
|
|
||||||
<h2 class="visually-hidden">Les 4 derniers articles</h2>
|
|
||||||
<div class="row mb-2">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
|
|
||||||
$foreach0DoElse = true;
|
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
|
|
||||||
$foreach0DoElse = false;
|
|
||||||
?>
|
|
||||||
<?php $_smarty_tpl->renderSubTemplate("file:views/_partial/preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
||||||
</section>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* {/block "content"} */
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
<?php
|
|
||||||
/* Smarty version 5.7.0, created on 2026-02-06 08:21:14
|
|
||||||
from 'file:views/_partial/preview.tpl' */
|
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
||||||
'version' => '5.7.0',
|
|
||||||
'unifunc' => 'content_6985a47ad585d5_25749521',
|
|
||||||
'has_nocache_code' => false,
|
|
||||||
'file_dependency' =>
|
|
||||||
array (
|
|
||||||
'c724044e55872f26030b02de6dcd14dc34a20b16' =>
|
|
||||||
array (
|
|
||||||
0 => 'views/_partial/preview.tpl',
|
|
||||||
1 => 1770365554,
|
|
||||||
2 => 'file',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'includes' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
))) {
|
|
||||||
function content_6985a47ad585d5_25749521 (\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
|
|
||||||
?><article class="col-md-3 mb-4">
|
|
||||||
<div class="card h-100 shadow-sm article-card">
|
|
||||||
|
|
||||||
<div class="ratio ratio-16x9">
|
|
||||||
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getThumbnail();?>
|
|
||||||
"
|
|
||||||
class="w-100 h-100 object-fit-cover"
|
|
||||||
alt=""
|
|
||||||
loading="lazy">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex align-items-start gap-3">
|
|
||||||
|
|
||||||
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
|
|
||||||
"
|
|
||||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
|
||||||
style="width: 48px; height: 48px; object-fit: cover;"
|
|
||||||
alt="Photo de profil">
|
|
||||||
|
|
||||||
<div class="flex-grow-1 card-body p-3">
|
|
||||||
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<small class="text-body-secondary d-block mb-1">
|
|
||||||
<time><?php echo $_smarty_tpl->getValue('objProject')->getCreation_date();?>
|
|
||||||
</time>
|
|
||||||
– <?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
|
|
||||||
|
|
||||||
</small>
|
|
||||||
|
|
||||||
<a href="?id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
|
||||||
"
|
|
||||||
class="stretched-link small">
|
|
||||||
Lire la suite →
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</article><?php }
|
|
||||||
}
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
require("models/user_model.php");
|
require("models/user_model.php");
|
||||||
require("entities/user_entity.php");
|
require("entities/user_entity.php");
|
||||||
require("mother_controller.php");
|
require("mother_controller.php");
|
||||||
|
require("./models/project_model.php");
|
||||||
|
require("./entities/project_entity.php");
|
||||||
|
|
||||||
class UserCtrl extends MotherCtrl {
|
class UserCtrl extends MotherCtrl {
|
||||||
|
|
||||||
|
|
@ -41,12 +43,8 @@ class UserCtrl extends MotherCtrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_arrData['arrError'] = $arrError;
|
$this->_arrData['arrError'] = $arrError;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->_display("login");
|
$this->_display("login");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -125,7 +123,6 @@ class UserCtrl extends MotherCtrl {
|
||||||
// Si pas d'erreurs => insertion
|
// Si pas d'erreurs => insertion
|
||||||
if (count($arrError) === 0) {
|
if (count($arrError) === 0) {
|
||||||
$objUserModel = new UserModel();
|
$objUserModel = new UserModel();
|
||||||
$boolInsert = $objUserModel->insert($objUser);
|
|
||||||
|
|
||||||
if ($objUserModel->mailExists($objUser->getMail())) {
|
if ($objUserModel->mailExists($objUser->getMail())) {
|
||||||
|
|
||||||
|
|
@ -145,9 +142,46 @@ class UserCtrl extends MotherCtrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affichage de la vue inscription
|
// Affichage de la vue inscription
|
||||||
|
$this->_arrData["arrError"] = $arrError;
|
||||||
$this->_display("inscription");
|
$this->_display("inscription");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* le controlleur affichage de la page user
|
||||||
|
*/
|
||||||
|
public function user(){
|
||||||
|
|
||||||
|
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||||
|
|
||||||
|
if ($intId <= 0) {
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//affichage info utilisateur
|
||||||
|
$objUserModel = new UserModel;
|
||||||
|
$arrUserData = $objUserModel->findUserById($intId);
|
||||||
|
|
||||||
|
if ($arrUserData === false) {
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$objUser = new User;
|
||||||
|
$objUser->hydrate($arrUserData);
|
||||||
|
|
||||||
|
//affichage projet de l'utilisateur
|
||||||
|
$objProjectModel = new ProjectModel;
|
||||||
|
$arrProjects = $objProjectModel->findAll(0,'',$intId);
|
||||||
|
|
||||||
|
$arrProjectToDisplay = array();
|
||||||
|
foreach($arrProjects as $projectData) {
|
||||||
|
$objProject = new Project();
|
||||||
|
$objProject->hydrate($projectData);
|
||||||
|
$arrProjectToDisplay[] = $objProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_arrData['user'] = $objUser;
|
||||||
|
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
||||||
|
$this->_display("user");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
entities/authorisation_entity.php
Normal file
24
entities/authorisation_entity.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
require_once("mother_entity.php");
|
||||||
|
|
||||||
|
class Authorisation extends Entity{
|
||||||
|
|
||||||
|
private int $_id;
|
||||||
|
private string $_name = '';
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
$this->_prefix = 'authorisation_';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId():int{
|
||||||
|
return $this->_id;
|
||||||
|
}
|
||||||
|
public function setId(int $id){
|
||||||
|
$this->_id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName():string{
|
||||||
|
return $this->_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -157,7 +157,7 @@ class Project extends Entity{
|
||||||
* Récupération de l'utilisateur
|
* Récupération de l'utilisateur
|
||||||
* @return int id de l'utilisateur
|
* @return int id de l'utilisateur
|
||||||
*/
|
*/
|
||||||
public function getUser(){
|
public function getUser_id(){
|
||||||
return $this->_user;
|
return $this->_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,7 +165,7 @@ class Project extends Entity{
|
||||||
* Mise à jour de l'utilisateur
|
* Mise à jour de l'utilisateur
|
||||||
* @param int id de l'utilisateur
|
* @param int id de l'utilisateur
|
||||||
*/
|
*/
|
||||||
public function setUser($user){
|
public function setUser_id($user){
|
||||||
$this->_user = $user;
|
$this->_user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,6 +200,7 @@ class Project extends Entity{
|
||||||
public function setCreatorName($creatorname){
|
public function setCreatorName($creatorname){
|
||||||
$this->_creatorname = $creatorname;
|
$this->_creatorname = $creatorname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Récupération du chemin photo profil
|
* Récupération du chemin photo profil
|
||||||
* @return string nom du chemin photo profil
|
* @return string nom du chemin photo profil
|
||||||
|
|
|
||||||
28
models/authorisation_model.php
Normal file
28
models/authorisation_model.php
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
require_once('mother_model.php');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Traitement des requêtes pour le status de l'utilisateur
|
||||||
|
* @author : Laura
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AuthorisationModel extends Connect{
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fonction de récupération des infos d'authorisation
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function findAllAuthorisation():array{
|
||||||
|
|
||||||
|
$strRq = "SELECT *
|
||||||
|
FROM authorisation";
|
||||||
|
|
||||||
|
return $this->_db->query($strRq)->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction de récupération des catégories
|
* Fonction de récupération des catégories
|
||||||
|
* @param int $intLimit
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -27,21 +28,56 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fonction d'insertion d'une nouvelle catégorie dans la bdd
|
* fonction d'insertion d'une nouvelle catégorie dans la bdd
|
||||||
* @param object $objUser L'objet utilisateur
|
* @param object $objCategory l'objet catégorie
|
||||||
* @return bool Est-ce que la requête s'est bien passée (true/false)
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
*/
|
*/
|
||||||
|
public function insertCategory(object $objCategory):bool{
|
||||||
|
|
||||||
public function insert(object $objCategory):bool{
|
$strRq = "INSERT INTO category (category_name)
|
||||||
|
VALUES (:name)";
|
||||||
$strRq = "INSERT INTO category (category_name, category_parent)
|
|
||||||
VALUES (:name, :parent)";
|
|
||||||
|
|
||||||
$rqPrep = $this->_db->prepare($strRq);
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":parent", $objCategory->getParent(), PDO::PARAM_STR);
|
|
||||||
|
|
||||||
return $rqPrep->execute();
|
return $rqPrep->execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* fonction de suppression d'une catégorie dans la bdd
|
||||||
|
* @param object $objCategory l'objet catégorie
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function deleteCategory(object $objCategory):bool{
|
||||||
|
|
||||||
|
$strRq = "DELETE FROM category
|
||||||
|
WHERE category_id= :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
|
$rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
|
||||||
|
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fonction de modification d'une catégorie dans la bdd
|
||||||
|
* @param object $objCategory l'objet catégorie
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function editCategory(object $objCategory):bool{
|
||||||
|
|
||||||
|
$strRq = "UPDATE category
|
||||||
|
SET category_name = :name
|
||||||
|
WHERE category_id = :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
|
$rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
|
||||||
|
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction de récupération des images
|
* Fonction de récupération des images
|
||||||
|
* @param int $intLimit
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
try{
|
try{
|
||||||
// Connexion à la base de données
|
// Connexion à la base de données
|
||||||
$this->_db = new PDO(
|
$this->_db = new PDO(
|
||||||
"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
|
"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD "mysql:host=localhost;dbname=projet_folliow",
|
||||||
"projet_user", //Nom d'utilisateur de la base de données
|
"projet_user", //Nom d'utilisateur de la base de données root
|
||||||
"F0lliowRules!",// Mot de passe de la base de données
|
"F0lliowRules!",// Mot de passe de la base de données
|
||||||
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
|
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
|
||||||
);
|
);
|
||||||
// Pour résoudre les problèmes d’encodage
|
// Pour résoudre les problèmes d’encodage
|
||||||
|
|
@ -20,4 +20,17 @@
|
||||||
echo "Échec : " . $e->getMessage();
|
echo "Échec : " . $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Pour passer sur le serveur de YASS:
|
||||||
|
*"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
|
||||||
|
"projet_user", //Nom d'utilisateur de la base de données
|
||||||
|
"F0lliowRules!",// Mot de passe de la base de données
|
||||||
|
Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
|
||||||
|
|
||||||
|
Pour passer en local:
|
||||||
|
"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
|
||||||
|
"root", //Nom d'utilisateur de la base de données
|
||||||
|
"",// Mot de passe de la base de données
|
||||||
|
*/
|
||||||
|
|
@ -8,19 +8,25 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ProjectModel extends Connect{
|
class ProjectModel extends Connect{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de recherche des projets
|
||||||
|
* @param type string, int et bool
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
|
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
|
||||||
int $intPeriod=0, string $strDate='', string $strStartDate='',
|
int $intPeriod=0, string $strDate='', string $strStartDate='',
|
||||||
string $strEndDate='', int $intCategory=0):array{
|
string $strEndDate='', int $intCategory=0, bool $bool6Months=false):array{
|
||||||
|
|
||||||
// Ecrire la requête
|
|
||||||
$strRq = "SELECT project.*,
|
$strRq = "SELECT project.*,
|
||||||
CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname',
|
CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname',
|
||||||
user_image
|
user_image
|
||||||
FROM project
|
FROM project
|
||||||
INNER JOIN users ON user_id = project_user";
|
INNER JOIN users ON user_id = project_user_id";
|
||||||
|
|
||||||
$strWhere = " WHERE ";
|
$strWhere = " WHERE ";
|
||||||
|
|
||||||
// Recherche par mot clé
|
// Recherche par mot clé
|
||||||
if ($strKeywords != '') {
|
if ($strKeywords != '') {
|
||||||
$strRq .= " WHERE (project_title LIKE '%".$strKeywords."%'
|
$strRq .= " WHERE (project_title LIKE '%".$strKeywords."%'
|
||||||
|
|
@ -41,23 +47,25 @@
|
||||||
$strRq .= $strWhere." project_category = ".$intCategory;
|
$strRq .= $strWhere." project_category = ".$intCategory;
|
||||||
$strWhere = " AND ";
|
$strWhere = " AND ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//recherche par ancienneté
|
||||||
|
if ($bool6Months === true) {
|
||||||
|
$strRq .= $strWhere . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) ";
|
||||||
|
$strWhere = " AND ";
|
||||||
|
}
|
||||||
|
|
||||||
// Recherche par dates
|
// Recherche par dates
|
||||||
if ($intPeriod == 0){
|
if ($intPeriod == 0){
|
||||||
// Par date exacte
|
|
||||||
if ($strDate != ''){
|
if ($strDate != ''){
|
||||||
$strRq .= $strWhere." project_creation_date = '".$strDate."'";
|
$strRq .= $strWhere." project_creation_date = '".$strDate."'";
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// Par période de dates
|
|
||||||
if ($strStartDate != '' && $strEndDate != ''){
|
if ($strStartDate != '' && $strEndDate != ''){
|
||||||
$strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'";
|
$strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'";
|
||||||
}else{
|
}else{
|
||||||
if ($strStartDate != ''){
|
if ($strStartDate != ''){
|
||||||
// A partir de
|
|
||||||
$strRq .= $strWhere." project_creation_date >= '".$strStartDate."'";
|
$strRq .= $strWhere." project_creation_date >= '".$strStartDate."'";
|
||||||
}else if ($strEndDate != ''){
|
}else if ($strEndDate != ''){
|
||||||
// Avant le
|
|
||||||
$strRq .= $strWhere." project_creation_date <= '".$strEndDate."'";
|
$strRq .= $strWhere." project_creation_date <= '".$strEndDate."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -65,44 +73,46 @@
|
||||||
|
|
||||||
$strRq .= " ORDER BY project_creation_date DESC";
|
$strRq .= " ORDER BY project_creation_date DESC";
|
||||||
|
|
||||||
|
|
||||||
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'information dans la BDD (Repris de la partie BLOG vu en cours..)
|
/**
|
||||||
|
* Fonction d'insertion d'un nouveau projet dans la bdd
|
||||||
|
* @param object $objProject l'objet projet
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
public function insert(object $objProject):bool{
|
public function insert(object $objProject):bool{
|
||||||
|
|
||||||
//Construire la requête
|
|
||||||
$strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date)
|
$strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date)
|
||||||
VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()))";
|
VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()))";
|
||||||
|
|
||||||
// Préparer la requête
|
|
||||||
$rqPrep = $this->_db->prepare($strRq);
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
// Donne les informations
|
|
||||||
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":status", $objProject->getStatus(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":status", $objProject->getStatus(), PDO::PARAM_STR);
|
||||||
|
|
||||||
//Executer la requête
|
|
||||||
//var_dump($strRq);die;
|
|
||||||
//return $db->exec($strRq);
|
|
||||||
return $rqPrep->execute();
|
return $rqPrep->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findOne(int $intId) {
|
/**
|
||||||
|
* Fonction de recherche d'un seul projet
|
||||||
|
* @param int $intId
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function findOne(int $intId) :array{
|
||||||
$strRq = "SELECT project.*,
|
$strRq = "SELECT project.*,
|
||||||
CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname',
|
CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname',
|
||||||
users.user_image,
|
users.user_image,
|
||||||
category.category_name
|
category.category_name
|
||||||
FROM project
|
FROM project
|
||||||
INNER JOIN users ON users.user_id = project.project_user
|
INNER JOIN users ON users.user_id = project.project_user_id
|
||||||
LEFT JOIN category ON category.category_id = project.project_category
|
LEFT JOIN category ON category.category_id = project.project_category
|
||||||
WHERE project.project_id = :id";
|
WHERE project.project_id = :id";
|
||||||
|
|
||||||
|
|
@ -112,4 +122,54 @@
|
||||||
|
|
||||||
return $rqPrep->fetch();
|
return $rqPrep->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function accept(int $id){
|
||||||
|
|
||||||
|
//SQL pour changer le status en accept
|
||||||
|
$strRq = "UPDATE project
|
||||||
|
SET project_status= 'publié'
|
||||||
|
WHERE project_id =".$id;
|
||||||
|
|
||||||
|
//retourne la commande
|
||||||
|
return $this->_db->query($strRq);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function refuse(int $id){
|
||||||
|
|
||||||
|
$strRq = "UPDATE project
|
||||||
|
SET project_status= 'refusé'
|
||||||
|
WHERE project_id =".$id;
|
||||||
|
|
||||||
|
return $this->_db->query($strRq);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(int $id){
|
||||||
|
|
||||||
|
$strRq = "DELETE FROM project
|
||||||
|
WHERE project_id =".$id;
|
||||||
|
|
||||||
|
return $this->_db->query($strRq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de mise à jour d'un projet en BDD
|
||||||
|
* @param object $objProject L'objet utilisateur
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function updateProject(object $objProject):bool{
|
||||||
|
|
||||||
|
$strRq = "UPDATE project
|
||||||
|
SET project_title = :title, project_description = :description, project_content = :content
|
||||||
|
WHERE project_id = :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
|
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
|
||||||
|
// Executer la requête
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,66 +5,58 @@
|
||||||
/**
|
/**
|
||||||
* Traitement des requêtes pour les utilisateurs
|
* Traitement des requêtes pour les utilisateurs
|
||||||
* @author : meilleurGroup
|
* @author : meilleurGroup
|
||||||
* @version : V0.5
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class UserModel extends Connect{
|
class UserModel extends Connect{
|
||||||
// Attributs
|
|
||||||
|
|
||||||
|
|
||||||
// Méthodes
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Fonction de recherche des utilisateurs et leur niveau d'autorisation
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function findAllUsers():array{
|
public function findAllUsers():array{
|
||||||
// Ecrire la requête
|
|
||||||
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name
|
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name
|
||||||
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status";
|
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
|
||||||
// Lancer la requête et récupérer les résultats
|
WHERE user_deleted_at IS NULL";
|
||||||
return $this->_db->query($strRq)->fetchAll();
|
return $this->_db->query($strRq)->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Fonction de vérification des utilisateurs
|
||||||
* @param string $strMail
|
* @param string $strMail
|
||||||
* @param string $strPwd
|
* @param string $strPwd
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
*/
|
*/
|
||||||
public function verifUser(string $strMail, string $strPwd):array|bool{
|
public function verifUser(string $strMail, string $strPwd):array|bool{
|
||||||
// 2. Construire la requête
|
|
||||||
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name
|
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name
|
||||||
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
|
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
|
||||||
WHERE user_mail = '".$strMail."'";
|
WHERE user_mail = '".$strMail."'";
|
||||||
// Récupère mon utilisateur
|
|
||||||
// Executer la requête et récupérer les résultats
|
|
||||||
$arrUser = $this->_db->query($strRq)->fetch();
|
$arrUser = $this->_db->query($strRq)->fetch();
|
||||||
// Vérification du mot de passe haché
|
|
||||||
if (password_verify($strPwd, $arrUser['user_password'])){
|
if (password_verify($strPwd, $arrUser['user_password'])){
|
||||||
// Renvoi l'utilisateur
|
unset($arrUser['user_password']);
|
||||||
unset($arrUser['user_password']); // on enlève le pwd
|
|
||||||
return $arrUser;
|
return $arrUser;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//public function insert(string $strName, string $strFirstname, string $strMail, string $strPwd):int{
|
|
||||||
/**
|
/**
|
||||||
* Fonction d'insertion d'un utilisateur en BDD
|
* Fonction d'insertion d'un utilisateur en BDD
|
||||||
* @param object $objUser L'objet utilisateur
|
* @param object $objUser L'objet utilisateur
|
||||||
* @return bool Est-ce que la requête s'est bien passée (true/false)
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
*/
|
*/
|
||||||
public function insert(object $objUser):bool{
|
public function insert(object $objUser):bool{
|
||||||
|
|
||||||
// 2. Construire la requête
|
|
||||||
|
|
||||||
$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
|
|
||||||
$rqPrep = $this->_db->prepare($strRq);
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
// Donne les informations
|
|
||||||
$rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR);
|
||||||
|
|
@ -75,19 +67,70 @@
|
||||||
$rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR);
|
$rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR);
|
$rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 3. Executer la requête
|
|
||||||
//var_dump($strRq);die;
|
|
||||||
//return $db->exec($strRq);
|
|
||||||
return $rqPrep->execute();
|
return $rqPrep->execute();
|
||||||
}
|
}
|
||||||
public function mailExists(string $mail): bool
|
|
||||||
{
|
/**
|
||||||
|
* Fonction de vérification de mail
|
||||||
|
* @param string $mail
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function mailExists(string $mail): bool{
|
||||||
|
|
||||||
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_mail = :mail LIMIT 1");
|
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_mail = :mail LIMIT 1");
|
||||||
$rq->bindValue(":mail", $mail);
|
$rq->bindValue(":mail", $mail);
|
||||||
$rq->execute();
|
$rq->execute();
|
||||||
|
|
||||||
return (bool)$rq->fetchColumn();
|
return (bool)$rq->fetchColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de changement de status d'un utilisateur
|
||||||
|
* @param object $objUser L'objet utilisateur
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function editStatus(object $objUser):bool{
|
||||||
|
|
||||||
|
$strRq = "UPDATE users
|
||||||
|
SET user_status = :status
|
||||||
|
WHERE user_id = :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT);
|
||||||
|
$rqPrep->bindValue(":status", $objUser->getStatus(), PDO::PARAM_INT);
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction permettant de supprimer un utilisateur avec une date de suppression
|
||||||
|
* @param int $intId L'identifiant de l'utilisateur
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function delete_soft(int $intId):bool{
|
||||||
|
|
||||||
|
$strRq = "UPDATE users
|
||||||
|
SET user_deleted_at = NOW()
|
||||||
|
WHERE user_id = :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(":id", $intId, PDO::PARAM_INT);
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Récupère les informations d'un utilisateur par son ID
|
||||||
|
* @param int $intId L'identifiant de l'utilisateur
|
||||||
|
* @return array Tableau associatif (ou false si pas trouvé)
|
||||||
|
*/
|
||||||
|
public function findUserById(int $intId): array|bool {
|
||||||
|
|
||||||
|
$strRq = "SELECT * FROM users WHERE user_id = :id";
|
||||||
|
|
||||||
|
$prep = $this->_db->prepare($strRq);
|
||||||
|
$prep->bindValue(':id', $intId, PDO::PARAM_INT);
|
||||||
|
$prep->execute();
|
||||||
|
|
||||||
|
return $prep->fetch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:35
|
/* Smarty version 5.7.0, created on 2026-02-11 20:36:23
|
||||||
from 'file:views/home.tpl' */
|
from 'file:views/home.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b403135214_06797903',
|
'unifunc' => 'content_698ce8475ca6c5_70769879',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68' =>
|
'0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/home.tpl',
|
0 => 'views/home.tpl',
|
||||||
1 => 1770579251,
|
1 => 1770721453,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -21,20 +21,20 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'file:views/_partial/preview.tpl' => 1,
|
'file:views/_partial/preview.tpl' => 1,
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b403135214_06797903 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce8475ca6c5_70769879 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_8519413186989b403131000_39935260', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1240817329698ce8475c5f82_37934128', "content");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_8519413186989b403131000_39935260 extends \Smarty\Runtime\Block
|
class Block_1240817329698ce8475c5f82_37934128 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
|
@ -48,6 +48,19 @@ $_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
directement en contact avec les entreprises.</p>
|
directement en contact avec les entreprises.</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||||
|
<div class="mb-4">
|
||||||
|
<form method="GET" action="index.php">
|
||||||
|
<input type="hidden" name="ctrl" value="project">
|
||||||
|
<input type="hidden" name="action" value="home">
|
||||||
|
<button type="submit" name="filter_cat" value="1" class="btn btn-primary">Design</button>
|
||||||
|
<button type="submit" name="filter_cat" value="2" class="btn btn-primary">Développement Web</button>
|
||||||
|
<button type="submit" name="filter_old" value="true" class="btn btn-primary">Plus de 6 mois</button>
|
||||||
|
<a href="index.php?ctrl=project&action=home" class="btn btn-primary">Tout</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="container" 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">
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:54
|
/* Smarty version 5.7.0, created on 2026-02-11 20:36:30
|
||||||
from 'file:views/layout.tpl' */
|
from 'file:views/layout.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b41646f355_64257736',
|
'unifunc' => 'content_698ce84e84dcc1_11117501',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'1c51ad9f5c349145220f82584009ce981aa35e0b' =>
|
'1c51ad9f5c349145220f82584009ce981aa35e0b' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/layout.tpl',
|
0 => 'views/layout.tpl',
|
||||||
1 => 1770579251,
|
1 => 1770649781,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -22,21 +22,21 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'file:views/_partial/footer.tpl' => 1,
|
'file:views/_partial/footer.tpl' => 1,
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b41646f355_64257736 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce84e84dcc1_11117501 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
|
||||||
$_smarty_tpl->renderSubTemplate("file:views/_partial/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
$_smarty_tpl->renderSubTemplate("file:views/_partial/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_12018663056989b41646d2e0_34201164', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_2114043754698ce84e84c177_54195501', "content");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php $_smarty_tpl->renderSubTemplate("file:views/_partial/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
<?php $_smarty_tpl->renderSubTemplate("file:views/_partial/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_12018663056989b41646d2e0_34201164 extends \Smarty\Runtime\Block
|
class Block_2114043754698ce84e84c177_54195501 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:54
|
/* Smarty version 5.7.0, created on 2026-02-11 20:36:30
|
||||||
from 'file:views/_partial/footer.tpl' */
|
from 'file:views/_partial/footer.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b416601ef8_77236186',
|
'unifunc' => 'content_698ce84e9b1e51_40033913',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'264314e384c04e79c5fa56e3cf6837f9df55d7fb' =>
|
'264314e384c04e79c5fa56e3cf6837f9df55d7fb' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/_partial/footer.tpl',
|
0 => 'views/_partial/footer.tpl',
|
||||||
1 => 1770579251,
|
1 => 1770649781,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b416601ef8_77236186 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce84e9b1e51_40033913 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
?>
|
?>
|
||||||
<footer class="footer container-fluid d-flex justify-content-around">
|
<footer class="footer container-fluid d-flex justify-content-around">
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 09:55:01
|
/* Smarty version 5.7.0, created on 2026-02-11 20:35:30
|
||||||
from 'file:views/projet_display.tpl' */
|
from 'file:views/project_display.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989aef59222c5_05723018',
|
'unifunc' => 'content_698ce812246388_58459261',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'858273afeea443d46db5cb9b3c1c67988eba5ded' =>
|
'4c2b74d2d77abca5363ffd92e8bc3a455c22b1bd' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/projet_display.tpl',
|
0 => 'views/project_display.tpl',
|
||||||
1 => 1770628836,
|
1 => 1770842115,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -20,18 +20,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989aef59222c5_05723018 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce812246388_58459261 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_9176586226989aef5913c31_97339576', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1262370430698ce812236879_45885506', "content");
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_9176586226989aef5913c31_97339576 extends \Smarty\Runtime\Block
|
class Block_1262370430698ce812236879_45885506 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
|
@ -71,7 +71,7 @@ $_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<?php echo nl2br((string) $_smarty_tpl->getValue('objProject')->getContent(), (bool) 1);?>
|
<?php echo $_smarty_tpl->getValue('objProject')->getContent();?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -100,12 +100,13 @@ $_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
<!-- Sidebar : informations du créateur -->
|
<!-- Sidebar : informations du créateur -->
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<div class="card text-center shadow-sm p-4">
|
<div class="card text-center shadow-sm p-4">
|
||||||
|
<a href="index.php?ctrl=user&action=user&id=<?php echo $_smarty_tpl->getValue('objProject')->getUser_id();?>
|
||||||
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
|
" class="text-decoration-none text-dark">
|
||||||
|
<img src="<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
|
||||||
"
|
"
|
||||||
class="rounded-circle mb-3 mx-auto"
|
class="rounded-circle mb-3 mx-auto"
|
||||||
style="width:100px;height:100px;object-fit:cover;">
|
style="width:100px;height:100px;object-fit:cover;">
|
||||||
|
</a>
|
||||||
<h5><?php echo $_smarty_tpl->getValue('objProject')->getCreatorName();?>
|
<h5><?php echo $_smarty_tpl->getValue('objProject')->getCreatorName();?>
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:54
|
/* Smarty version 5.7.0, created on 2026-02-11 20:36:23
|
||||||
from 'file:views/_partial/preview.tpl' */
|
from 'file:views/_partial/preview.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b416566583_15954947',
|
'unifunc' => 'content_698ce8478dbef1_65073741',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'67e1ae3a210fc2d1bf8782993687bad91a1cf0f6' =>
|
'67e1ae3a210fc2d1bf8782993687bad91a1cf0f6' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/_partial/preview.tpl',
|
0 => 'views/_partial/preview.tpl',
|
||||||
1 => 1770629075,
|
1 => 1770841277,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -20,12 +20,12 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b416566583_15954947 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce8478dbef1_65073741 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<article class="col-md-3 mb-4">
|
<article class="col-md-3 mb-5 <?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_SESSION['user']['user_status'] == 2) {?> pb-5 <?php }?>">
|
||||||
<div class="card h-100 shadow-sm article-card">
|
<div class="card h-100 shadow-sm article-card">
|
||||||
|
|
||||||
<div class="ratio ratio-16x9">
|
<div class="ratio ratio-16x9">
|
||||||
|
|
@ -38,32 +38,60 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
|
|
||||||
<div class="d-flex align-items-start gap-3">
|
<div class="d-flex align-items-start gap-3">
|
||||||
|
|
||||||
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
|
<img src="<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
|
||||||
"
|
"
|
||||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
||||||
style="width: 48px; height: 48px; object-fit: cover;"
|
style="width: 48px; height: 48px; object-fit: cover;"
|
||||||
alt="Photo de profil">
|
alt="Photo de profil">
|
||||||
|
|
||||||
<div class="flex-grow-1 card-body p-3">
|
<div class="flex-grow-1 card-body p-3">
|
||||||
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
|
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<small class="text-body-secondary d-block mb-1">
|
<small class="text-body-secondary d-block mb-1">
|
||||||
<time><?php echo $_smarty_tpl->getValue('objProject')->getCreation_date();?>
|
<time><?php echo $_smarty_tpl->getValue('objProject')->getCreation_date();?>
|
||||||
</time>
|
</time>
|
||||||
– <?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
|
–
|
||||||
|
<a href="index.php?ctrl=user&action=user&id=<?php echo $_smarty_tpl->getValue('objProject')->getUser_id();?>
|
||||||
|
"
|
||||||
|
class="text-decoration-none"
|
||||||
|
style="position: relative; z-index: 2;">
|
||||||
|
<?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
|
||||||
|
|
||||||
</small>
|
</a>
|
||||||
|
</small>
|
||||||
|
|
||||||
<a href="index.php?ctrl=project&action=display&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
<a href="index.php?ctrl=project&action=display&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
||||||
"
|
"
|
||||||
class="stretched-link small">
|
class="stretched-link small">
|
||||||
Lire la suite →
|
Lire la suite →
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
|
||||||
|
<?php if ($_SESSION['user']['user_id'] == $_smarty_tpl->getValue('objProject')->getUser_id()) {?>
|
||||||
|
<a href="index.php?ctrl=project&action=display&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
||||||
|
"
|
||||||
|
class="stretched-link small">
|
||||||
|
Editer
|
||||||
|
</a>
|
||||||
|
<?php }?>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</article><?php }
|
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_SESSION['user']['user_status'] == 2 && $_smarty_tpl->getValue('objProject')->getStatus() == "en_attente") {?>
|
||||||
|
<div class="border rounded text-center">
|
||||||
|
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
||||||
|
" name="toPublished">Accepter</a>
|
||||||
|
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
||||||
|
" name="toRefused">Refuser</a>
|
||||||
|
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
|
||||||
|
" name="toDelete">Supprimer</a>
|
||||||
|
</div>
|
||||||
|
<?php } elseif ($_smarty_tpl->getValue('projectStatus') == "refusé") {?>
|
||||||
|
<p class="text-danger fw-bold">Portfolio refusé</p>
|
||||||
|
<?php }?>
|
||||||
|
</article>
|
||||||
|
<?php }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:54
|
/* Smarty version 5.7.0, created on 2026-02-11 20:35:23
|
||||||
from 'file:views/search.tpl' */
|
from 'file:views/search.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b4162cc7a7_31054147',
|
'unifunc' => 'content_698ce80be447b2_73034229',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'72e5e5c0ee2729980deadb1687a6d7b7b3c501bb' =>
|
'72e5e5c0ee2729980deadb1687a6d7b7b3c501bb' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/search.tpl',
|
0 => 'views/search.tpl',
|
||||||
1 => 1770580115,
|
1 => 1770649781,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -21,18 +21,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'file:views/_partial/preview.tpl' => 1,
|
'file:views/_partial/preview.tpl' => 1,
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b4162cc7a7_31054147 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce80be447b2_73034229 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1139012436989b4162bac57_95455595', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_977268380698ce80be327a4_02425845', "content");
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_1139012436989b4162bac57_95455595 extends \Smarty\Runtime\Block
|
class Block_977268380698ce80be327a4_02425845 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:54
|
/* Smarty version 5.7.0, created on 2026-02-11 20:36:30
|
||||||
from 'file:views/_partial/header.tpl' */
|
from 'file:views/_partial/header.tpl' */
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'version' => '5.7.0',
|
'version' => '5.7.0',
|
||||||
'unifunc' => 'content_6989b4164decf6_40046278',
|
'unifunc' => 'content_698ce84e8f9ec8_97257315',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'8056b95e7f6b28be5e36947735d13c8d176ec944' =>
|
'8056b95e7f6b28be5e36947735d13c8d176ec944' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/_partial/header.tpl',
|
0 => 'views/_partial/header.tpl',
|
||||||
1 => 1770631509,
|
1 => 1770842181,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989b4164decf6_40046278 (\Smarty\Template $_smarty_tpl) {
|
function content_698ce84e8f9ec8_97257315 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
$_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
|
@ -38,7 +38,7 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
<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">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="#">
|
<a class="navbar-brand d-flex align-items-center" href="index.php">
|
||||||
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
|
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
@ -48,15 +48,7 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav me-auto">
|
<ul class="navbar-nav me-auto">
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Découvrir</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Customisation</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Orientation</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="?ctrl=&action=">À propos</a>
|
<a class="nav-link" href="?ctrl=&action=">À propos</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -65,6 +57,9 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
|
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
|
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="?ctrl=project&action=project">Ajouter un projet</a>
|
||||||
|
</li>
|
||||||
<?php if ($_SESSION['user']['authorisation_name'] == "Administrateur") {?>
|
<?php if ($_SESSION['user']['authorisation_name'] == "Administrateur") {?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
|
<a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
|
||||||
|
|
@ -91,7 +86,7 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
<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;"
|
||||||
|
|
@ -111,5 +106,6 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</body>
|
</body>
|
||||||
</html><?php }
|
</html>
|
||||||
|
<?php }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
<?php
|
||||||
|
/* Smarty version 5.7.0, created on 2026-02-11 20:35:28
|
||||||
|
from 'file:views/user.tpl' */
|
||||||
|
|
||||||
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
|
'version' => '5.7.0',
|
||||||
|
'unifunc' => 'content_698ce81087b505_07608517',
|
||||||
|
'has_nocache_code' => false,
|
||||||
|
'file_dependency' =>
|
||||||
|
array (
|
||||||
|
'ac38676c030d472426b3bc83bc530b255f98de05' =>
|
||||||
|
array (
|
||||||
|
0 => 'views/user.tpl',
|
||||||
|
1 => 1770828319,
|
||||||
|
2 => 'file',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'includes' =>
|
||||||
|
array (
|
||||||
|
'file:views/_partial/preview.tpl' => 1,
|
||||||
|
),
|
||||||
|
))) {
|
||||||
|
function content_698ce81087b505_07608517 (\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_323782649698ce81086ce17_81897685', "content");
|
||||||
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
|
}
|
||||||
|
/* {block "content"} */
|
||||||
|
class Block_323782649698ce81086ce17_81897685 extends \Smarty\Runtime\Block
|
||||||
|
{
|
||||||
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<section class="user-profile mb-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 text-center">
|
||||||
|
<img src="<?php echo $_smarty_tpl->getValue('user')->getImage();?>
|
||||||
|
" alt="Avatar de <?php echo $_smarty_tpl->getValue('user')->getPseudo();?>
|
||||||
|
" class="img-fluid rounded-circle mb-3" style="max-width: 200px">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<h1><?php echo $_smarty_tpl->getValue('user')->getPseudo();?>
|
||||||
|
</h1>
|
||||||
|
<p class="text-muted"><?php echo $_smarty_tpl->getValue('user')->getMail();?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php if ($_smarty_tpl->getValue('user')->getWork()) {?>
|
||||||
|
<p><?php echo $_smarty_tpl->getValue('user')->getWork();?>
|
||||||
|
</p>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<?php if ($_smarty_tpl->getValue('user')->getLocation()) {?>
|
||||||
|
<p><?php echo $_smarty_tpl->getValue('user')->getLocation();?>
|
||||||
|
</p>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
<p class="mt-3"><?php echo $_smarty_tpl->getValue('user')->getDescription();?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2 class="mb-4 border-bottom pb-2">Les projets de <?php echo $_smarty_tpl->getValue('user')->getPseudo();?>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<?php if ($_smarty_tpl->getSmarty()->getModifierCallback('count')($_smarty_tpl->getValue('arrProjectToDisplay')) > 0) {?>
|
||||||
|
<?php
|
||||||
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
|
||||||
|
$foreach0DoElse = true;
|
||||||
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
|
||||||
|
$foreach0DoElse = false;
|
||||||
|
?>
|
||||||
|
<?php $_smarty_tpl->renderSubTemplate("file:views/_partial/preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
||||||
|
<?php } else { ?>
|
||||||
|
<p class="alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* {/block "content"} */
|
||||||
|
}
|
||||||
|
|
@ -1,164 +0,0 @@
|
||||||
<?php
|
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:16:45
|
|
||||||
from 'file:views/login.tpl' */
|
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
||||||
'version' => '5.7.0',
|
|
||||||
'unifunc' => 'content_6989b40d157c69_73022561',
|
|
||||||
'has_nocache_code' => false,
|
|
||||||
'file_dependency' =>
|
|
||||||
array (
|
|
||||||
'b44ab733c93381dbf5dbbeae871506874cefd9d6' =>
|
|
||||||
array (
|
|
||||||
0 => 'views/login.tpl',
|
|
||||||
1 => 1770632188,
|
|
||||||
2 => 'file',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'includes' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
))) {
|
|
||||||
function content_6989b40d157c69_73022561 (\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_3583856956989b40d14e663_91083378', "content");
|
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
|
||||||
}
|
|
||||||
/* {block "content"} */
|
|
||||||
class Block_3583856956989b40d14e663_91083378 extends \Smarty\Runtime\Block
|
|
||||||
{
|
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section aria-label="Se connecter">
|
|
||||||
<?php if ($_smarty_tpl->getSmarty()->getModifierCallback('count')($_smarty_tpl->getValue('arrError')) > 0) {?>
|
|
||||||
<div class="alert alert-danger">
|
|
||||||
<?php
|
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrError'), 'strError');
|
|
||||||
$foreach0DoElse = true;
|
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('strError')->value) {
|
|
||||||
$foreach0DoElse = false;
|
|
||||||
?>
|
|
||||||
<p><?php echo $_smarty_tpl->getValue('strError');?>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
||||||
</div>
|
|
||||||
<?php }?>
|
|
||||||
<!-- Contenu principal de la page -->
|
|
||||||
<main class="container py-5">
|
|
||||||
|
|
||||||
<!-- Centrage horizontal du formulaire -->
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<!-- Contenu principal de la page -->
|
|
||||||
<main class="container py-5">
|
|
||||||
|
|
||||||
<!-- Centrage horizontal du formulaire -->
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-12 col-md-8 col-lg-5">
|
|
||||||
|
|
||||||
<!-- Carte contenant le formulaire de connexion -->
|
|
||||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
|
||||||
|
|
||||||
<!-- Titre principal -->
|
|
||||||
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
|
||||||
|
|
||||||
<!-- Texte descriptif -->
|
|
||||||
<p class="text-secondary mb-4">
|
|
||||||
Connectez-vous à votre compte.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Formulaire de connexion -->
|
|
||||||
<!-- Le traitement sera effectué en PHP via la méthode POST -->
|
|
||||||
<form method="POST">
|
|
||||||
|
|
||||||
<div class="row g-3">
|
|
||||||
|
|
||||||
<!-- Champ : adresse e-mail de l'utilisateur -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label for="user_mail" class="form-label">
|
|
||||||
Adresse e-mail
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
value="<?php echo (($tmp = $_smarty_tpl->getValue('strMail') ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
|
|
||||||
"
|
|
||||||
type="email"
|
|
||||||
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['mail'] ?? null)))) {?>is-invalid<?php }?>"
|
|
||||||
id="user_mail"
|
|
||||||
name="user_mail"
|
|
||||||
required
|
|
||||||
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Champ : mot de passe -->
|
|
||||||
<div class="col-12">
|
|
||||||
<label for="user_password" class="form-label">
|
|
||||||
Mot de passe
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="password"
|
|
||||||
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['pwd'] ?? null)))) {?>is-invalid<?php }?>"
|
|
||||||
id="user_password"
|
|
||||||
name="user_password"
|
|
||||||
required
|
|
||||||
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Option "Se souvenir de moi" (fonctionnalité optionnelle côté PHP) -->
|
|
||||||
<div class="col-12">
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
|
||||||
<label class="form-check-label" for="remember_me">
|
|
||||||
Se souvenir de moi
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</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">
|
|
||||||
Se connecter
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Lien vers la page d'inscription -->
|
|
||||||
<div class="col-12 text-center">
|
|
||||||
<small class="text-secondary">
|
|
||||||
Pas encore de compte ?
|
|
||||||
<a href="index.php?ctrl=user&action=signin" class="link-primary">Créer un compte</a>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Lien pour la récupération du mot de passe -->
|
|
||||||
<div class="col-12 text-center">
|
|
||||||
<small>
|
|
||||||
<a href="#" class="link-primary">
|
|
||||||
Mot de passe oublié ?
|
|
||||||
</a>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</section>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* {/block "content"} */
|
|
||||||
}
|
|
||||||
|
|
@ -1,214 +0,0 @@
|
||||||
<?php
|
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 10:06:01
|
|
||||||
from 'file:views/admin.tpl' */
|
|
||||||
|
|
||||||
/* @var \Smarty\Template $_smarty_tpl */
|
|
||||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
||||||
'version' => '5.7.0',
|
|
||||||
'unifunc' => 'content_6989b189902285_60575184',
|
|
||||||
'has_nocache_code' => false,
|
|
||||||
'file_dependency' =>
|
|
||||||
array (
|
|
||||||
'f80694cc4829becd656ad4f73c431db5dba4722b' =>
|
|
||||||
array (
|
|
||||||
0 => 'views/admin.tpl',
|
|
||||||
1 => 1770630804,
|
|
||||||
2 => 'file',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'includes' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
))) {
|
|
||||||
function content_6989b189902285_60575184 (\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_13716580806989b1898f9564_82803825', "content");
|
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
|
||||||
}
|
|
||||||
/* {block "content"} */
|
|
||||||
class Block_13716580806989b1898f9564_82803825 extends \Smarty\Runtime\Block
|
|
||||||
{
|
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
|
||||||
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<section class="sb-nav-fixed">
|
|
||||||
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
|
|
||||||
|
|
||||||
<a class="navbar-brand ps-3" href="index.php?ctrl=project&action=home"><img src="assests/img/Logo-Wordmark.svg" alt="Logo du site" width="150px"></a>
|
|
||||||
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
|
|
||||||
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
|
|
||||||
<div class="input-group">
|
|
||||||
<input class="form-control" type="text" placeholder="Recherche par pseudo..." aria-label="Recherche pseudo" aria-describedby="btnNavbarSearch" />
|
|
||||||
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- Navbar - User-->
|
|
||||||
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
|
|
||||||
<li class="nav-item dropdown">
|
|
||||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
|
|
||||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
|
||||||
<li><a class="dropdown-item" href="/option.php">Paramètre</a></li>
|
|
||||||
<li><hr class="dropdown-divider" /></li>
|
|
||||||
<li><a class="dropdown-item" href="/deconnexion.php">Déconnexion</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<!-- SideNav Infos -->
|
|
||||||
<div id="layoutSidenav">
|
|
||||||
<div id="layoutSidenav_nav">
|
|
||||||
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
|
|
||||||
<div class="sb-sidenav-menu">
|
|
||||||
<div class="nav">
|
|
||||||
<div class="sb-sidenav-menu-heading"></div>
|
|
||||||
<a class="nav-link" href="index.html">
|
|
||||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
|
||||||
Rafraichir la page
|
|
||||||
</a>
|
|
||||||
<div class="sb-sidenav-menu-heading"></div>
|
|
||||||
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form action="post">
|
|
||||||
<div class="container-fluid ps-2">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox1">Par date</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_date" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox2">Par date de creation de compte</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_creationdate" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox3">Recherche par date</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_date" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-12 text-center">
|
|
||||||
<button type="submit" class="btn mt-3 bg-primary text-light">Recherche</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="sb-sidenav-footer">
|
|
||||||
<div class="small">Connecté avec le compte :</div>
|
|
||||||
<?php echo $_SESSION['user']['user_name'];?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="layoutSidenav_content">
|
|
||||||
<main>
|
|
||||||
<div class="container-fluid px-4">
|
|
||||||
<h1 class="mt-4">Dashboard</h1>
|
|
||||||
<div class="container-fluid px-4">
|
|
||||||
<!-- USER MODIF -->
|
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4">
|
|
||||||
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<select class="form-select" aria-label="Default select example">
|
|
||||||
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
|
||||||
<?php
|
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrStatusToDisplay'), 'arrDetStatus');
|
|
||||||
$foreach0DoElse = true;
|
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetStatus')->value) {
|
|
||||||
$foreach0DoElse = false;
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $_smarty_tpl->getValue('arrDetStatus')->getId();?>
|
|
||||||
"><?php echo $_smarty_tpl->getValue('arrDetStatus')->getStatusName();?>
|
|
||||||
</option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- catégorie modif -->
|
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
|
||||||
<form method="post">
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<select class="form-select" aria-label="Default select example">
|
|
||||||
<option value="0" selected >Modifier un catégorie existante</option>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory');
|
|
||||||
$foreach1DoElse = true;
|
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
|
|
||||||
$foreach1DoElse = false;
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $_smarty_tpl->getValue('arrDetCategory')->getId();?>
|
|
||||||
" >
|
|
||||||
<?php echo $_smarty_tpl->getValue('arrDetCategory')->getName();?>
|
|
||||||
|
|
||||||
</option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
||||||
</select>
|
|
||||||
<br>
|
|
||||||
<input type="text" class="form-control" id="floatingInput" name="edit_category">
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div class="row">
|
|
||||||
<!-- creation cat-->
|
|
||||||
<div class="col-6">
|
|
||||||
<label>Créer une nouvelle catégorie</label>
|
|
||||||
<div class="form-floating mb-3">
|
|
||||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
|
||||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* {/block "content"} */
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 236 KiB |
|
|
@ -13,7 +13,7 @@
|
||||||
<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="index.php">
|
||||||
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
|
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
@ -25,15 +25,7 @@
|
||||||
{* Menu de navigation *}
|
{* Menu de navigation *}
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav me-auto">
|
<ul class="navbar-nav me-auto">
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Découvrir</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Customisation</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="?ctrl=&action=">Orientation</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="?ctrl=&action=">À propos</a>
|
<a class="nav-link" href="?ctrl=&action=">À propos</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -42,6 +34,9 @@
|
||||||
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
|
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
|
||||||
</li>
|
</li>
|
||||||
{if isset($smarty.session.user)}
|
{if isset($smarty.session.user)}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="?ctrl=project&action=project">Ajouter un projet</a>
|
||||||
|
</li>
|
||||||
{if $smarty.session.user.authorisation_name == "Administrateur"}
|
{if $smarty.session.user.authorisation_name == "Administrateur"}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
|
<a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
|
||||||
|
|
@ -71,7 +66,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=".{$smarty.session.user.user_image}"
|
<img src="{$smarty.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">
|
||||||
|
|
@ -90,4 +85,4 @@
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<article class="col-md-3 mb-4">
|
<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}">
|
||||||
<div class="card h-100 shadow-sm article-card">
|
<div class="card h-100 shadow-sm article-card">
|
||||||
|
|
||||||
{* IMAGE (80%) *}
|
{* IMAGE (80%) *}
|
||||||
|
|
@ -14,28 +14,53 @@
|
||||||
|
|
||||||
<div class="d-flex align-items-start gap-3">
|
<div class="d-flex align-items-start gap-3">
|
||||||
|
|
||||||
{* PHOTO DE PROFIL *}
|
{* PHOTO DE PROFIL *}
|
||||||
<img src=".{$objProject->getUser_image()}"
|
<img src="{$objProject->getUser_image()}"
|
||||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
||||||
style="width: 48px; height: 48px; object-fit: cover;"
|
style="width: 48px; height: 48px; object-fit: cover;"
|
||||||
alt="Photo de profil">
|
alt="Photo de profil">
|
||||||
|
|
||||||
{* INFOS *}
|
{* INFOS *}
|
||||||
<div class="flex-grow-1 card-body p-3">
|
<div class="flex-grow-1 card-body p-3">
|
||||||
<h3 class="h6 mb-1">{$objProject->getTitle()}</h3>
|
<h3 class="h6 mb-1">{$objProject->getTitle()}</h3>
|
||||||
|
|
||||||
<small class="text-body-secondary d-block mb-1">
|
<small class="text-body-secondary d-block mb-1">
|
||||||
<time>{$objProject->getCreation_date()}</time>
|
<time>{$objProject->getCreation_date()}</time>
|
||||||
– {$objProject->getCreatorname()}
|
–
|
||||||
</small>
|
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}"
|
||||||
|
class="text-decoration-none"
|
||||||
|
style="position: relative; z-index: 2;">
|
||||||
|
{$objProject->getCreatorname()}
|
||||||
|
</a>
|
||||||
|
</small>
|
||||||
|
|
||||||
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
||||||
class="stretched-link small">
|
class="stretched-link small">
|
||||||
Lire la suite →
|
Lire la suite →
|
||||||
</a>
|
</a>
|
||||||
</div>
|
{if isset($smarty.session.user)}
|
||||||
|
{if $smarty.session.user.user_id == $objProject->getUser_id()}
|
||||||
|
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
||||||
|
class="stretched-link small">
|
||||||
|
Editer
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</article>
|
{*Controle de l'utilisateur ainsi que du status du projet*}
|
||||||
|
{if isset($smarty.session.user)
|
||||||
|
and $smarty.session.user.user_status == 2
|
||||||
|
and $objProject->getStatus() eq "en_attente"}
|
||||||
|
<div class="border rounded text-center">
|
||||||
|
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id={$objProject->getId()}" name="toPublished">Accepter</a>
|
||||||
|
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id={$objProject->getId()}" name="toRefused">Refuser</a>
|
||||||
|
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id={$objProject->getId()}" name="toDelete">Supprimer</a>
|
||||||
|
</div>
|
||||||
|
{elseif $projectStatus eq "refusé"}
|
||||||
|
<p class="text-danger fw-bold">Portfolio refusé</p>
|
||||||
|
{/if}
|
||||||
|
</article>
|
||||||
|
|
|
||||||
217
views/admin.tpl
217
views/admin.tpl
|
|
@ -2,154 +2,89 @@
|
||||||
|
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
|
|
||||||
<section class="sb-nav-fixed">
|
<section>
|
||||||
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
|
<div id="layoutSidenav_content">
|
||||||
|
<div class="container-fluid px-4">
|
||||||
<a class="navbar-brand ps-3" href="index.php?ctrl=project&action=home"><img src="assests/img/Logo-Wordmark.svg" alt="Logo du site" width="150px"></a>
|
<h1 class="mt-4">Dashboard</h1>
|
||||||
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
|
<div class="container-fluid px-4">
|
||||||
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
|
<!-- USER MODIF -->
|
||||||
<div class="input-group">
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||||
<input class="form-control" type="text" placeholder="Recherche par pseudo..." aria-label="Recherche pseudo" aria-describedby="btnNavbarSearch" />
|
<div class="container-fluid pt-2">
|
||||||
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
|
<h2>Gestion de l'utilsateur</h2>
|
||||||
|
<p>Changer le statut ou supprimer un utilisateur</p>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
||||||
|
</div>
|
||||||
|
<form method="POST">
|
||||||
|
<div class="col-6">
|
||||||
|
<select class="form-select" aria-label="Default select example" name="user_id">
|
||||||
|
<option value="0">Choisir un utilisateur</option>
|
||||||
|
{foreach from=$arrUserToDisplay item=user}
|
||||||
|
<option value="{$user->getId()}">{$user->getName()} {$user->getFirstname()}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
<select class="form-select" aria-label="Default select example" name="new_status">
|
||||||
|
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
||||||
|
{foreach from=$arrAuthorisationToDisplay item=arrDetAuthorisation}
|
||||||
|
<option value="{$arrDetAuthorisation->getId()}">{$arrDetAuthorisation->getName()}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-2">
|
||||||
|
<button type="submit" name="action" value="update_status" class="btn bg-success text-light"> Valider</button>
|
||||||
|
<button type="submit" name="action" value="delete_user" class="btn bg-danger text-light">Supprimer l'utilisateur</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- Navbar - User-->
|
|
||||||
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
|
|
||||||
<li class="nav-item dropdown">
|
|
||||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
|
|
||||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
|
||||||
<li><a class="dropdown-item" href="/option.php">Paramètre</a></li>
|
|
||||||
<li><hr class="dropdown-divider" /></li>
|
|
||||||
<li><a class="dropdown-item" href="/deconnexion.php">Déconnexion</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<!-- SideNav Infos -->
|
|
||||||
<div id="layoutSidenav">
|
|
||||||
<div id="layoutSidenav_nav">
|
|
||||||
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
|
|
||||||
<div class="sb-sidenav-menu">
|
|
||||||
<div class="nav">
|
|
||||||
<div class="sb-sidenav-menu-heading"></div>
|
|
||||||
<a class="nav-link" href="index.html">
|
|
||||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
|
||||||
Rafraichir la page
|
|
||||||
</a>
|
|
||||||
<div class="sb-sidenav-menu-heading"></div>
|
|
||||||
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form action="post">
|
|
||||||
<div class="container-fluid ps-2">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox1">Par date</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_date" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox2">Par date de creation de compte</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_creationdate" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-6">
|
|
||||||
<label for="checkbox3">Recherche par date</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 text-center">
|
|
||||||
<input type="checkbox" name="search_date" id="">
|
|
||||||
</div>
|
|
||||||
<div class="col-12 text-center">
|
|
||||||
<button type="submit" class="btn mt-3 bg-primary text-light">Recherche</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="sb-sidenav-footer">
|
|
||||||
<div class="small">Connecté avec le compte :</div>
|
|
||||||
{$smarty.session.user.user_name}
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- catégorie modif -->
|
||||||
<div id="layoutSidenav_content">
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||||
<main>
|
<div class="container-fluid pt-2">
|
||||||
<div class="container-fluid px-4">
|
<h2>Gestion des catégories</h2>
|
||||||
<h1 class="mt-4">Dashboard</h1>
|
<div class="row">
|
||||||
<div class="container-fluid px-4">
|
<div class="col-6">
|
||||||
<!-- USER MODIF -->
|
<form method="post">
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
<p>Modifier une catégorie existante</p>
|
||||||
<div class="container-fluid pt-2">
|
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||||
<div class="row">
|
<option value="0">Choix de la catégorie</option>
|
||||||
<div class="col-4">
|
{foreach from=$arrCategoryToDisplay item=category}
|
||||||
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
<option value="{$category->getId()}">{$category->getName()}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<div class="form-floating mb-3">
|
||||||
|
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||||
|
<label for="floatingInput">Nouveau nom de la catégorie</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
<select class="form-select" aria-label="Default select example">
|
</form>
|
||||||
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
<div>
|
||||||
{foreach from=$arrStatusToDisplay item=arrDetStatus}
|
</div>
|
||||||
<option value="{$arrDetStatus->getId()}">{$arrDetStatus->getStatusName()}</option>
|
<br>
|
||||||
{/foreach}
|
<br>
|
||||||
</select>
|
<div class="row">
|
||||||
|
<!-- creation cat-->
|
||||||
|
<div class="col-6">
|
||||||
|
<form method="POST">
|
||||||
|
<p>Créer une nouvelle catégorie</p>
|
||||||
|
<div class="form-floating mb-3">
|
||||||
|
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||||
|
<label for="floatingInput">Nom de la nouvelle catégorie</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-2">
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- catégorie modif -->
|
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
|
||||||
<form method="post">
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-6">
|
|
||||||
<select class="form-select" aria-label="Default select example">
|
|
||||||
<option value="0" selected >Modifier un catégorie existante</option>
|
|
||||||
|
|
||||||
{foreach from=$arrCategoryToDisplay item=arrDetCategory}
|
|
||||||
<option value="{$arrDetCategory->getId()}" >
|
|
||||||
{$arrDetCategory->getName()}
|
|
||||||
</option>
|
|
||||||
{/foreach}
|
|
||||||
</select>
|
|
||||||
<br>
|
|
||||||
<input type="text" class="form-control" id="floatingInput" name="edit_category">
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div class="row">
|
|
||||||
<!-- creation cat-->
|
|
||||||
<div class="col-6">
|
|
||||||
<label>Créer une nouvelle catégorie</label>
|
|
||||||
<div class="form-floating mb-3">
|
|
||||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
|
||||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="small">Connecté avec le compte : {$smarty.session.user.user_name} {$smarty.session.user.user_firstname}
|
||||||
|
</section>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
@ -9,6 +9,19 @@
|
||||||
directement en contact avec les entreprises.</p>
|
directement en contact avec les entreprises.</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||||
|
<div class="mb-4">
|
||||||
|
<form method="GET" action="index.php">
|
||||||
|
<input type="hidden" name="ctrl" value="project">
|
||||||
|
<input type="hidden" name="action" value="home">
|
||||||
|
<button type="submit" name="filter_cat" value="1" class="btn btn-primary">Design</button>
|
||||||
|
<button type="submit" name="filter_cat" value="2" class="btn btn-primary">Développement Web</button>
|
||||||
|
<button type="submit" name="filter_old" value="true" class="btn btn-primary">Plus de 6 mois</button>
|
||||||
|
<a href="index.php?ctrl=project&action=home" class="btn btn-primary">Tout</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="container" 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">
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<main class="container py-5">
|
<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 position-relative">
|
||||||
<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 -->
|
||||||
|
|
@ -20,7 +20,13 @@
|
||||||
<p class="text-secondary mb-4">
|
<p class="text-secondary mb-4">
|
||||||
Créez votre compte utilisateur.
|
Créez votre compte utilisateur.
|
||||||
</p>
|
</p>
|
||||||
|
{if (isset($arrError) && count($arrError) > 0) }
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
{foreach $arrError as $strError}
|
||||||
|
<p>{$strError}</p>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
<!-- Formulaire d'inscription -->
|
<!-- Formulaire d'inscription -->
|
||||||
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
|
|
@ -98,6 +104,19 @@
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Champ : confirmer le mot de passe -->
|
||||||
|
<div class="col-12">
|
||||||
|
<label class="form-label" for="pwd_confirm">
|
||||||
|
Confirmer le Mot de passe *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="password"
|
||||||
|
id="pwd_confirm"
|
||||||
|
name="pwd_confirm"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
</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">
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
|
|
||||||
{* Affichage d'un formulaire en cas d'appuie sur le bouton "+" *}
|
{* Affichage d'un formulaire en cas d'appuie sur le bouton "+" *}
|
||||||
{if isset($smarty.post.showForm) || isset($smarty.post.showFormContinue)}
|
{if isset($smarty.post.showForm) || isset($smarty.post.showFormContinue)}
|
||||||
<form method="post" enctype="multipart/form-data" onsubmit="return confirm('Voulez-vous vraiment envoyer le formulaire ?')">
|
{if isset($smarty.session.user)}
|
||||||
|
<form class="m-2" method="post" enctype="multipart/form-data" onsubmit="return confirm('Voulez-vous vraiment envoyer le formulaire ?')">
|
||||||
<div>
|
<div>
|
||||||
<label>Titre</label>
|
<label>Titre</label>
|
||||||
<input type="text" name="titleProject">
|
<input type="text" name="titleProject">
|
||||||
|
|
@ -28,11 +29,23 @@
|
||||||
<input type="text" name="textProject">
|
<input type="text" name="textProject">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<h3>Image thumbnail</h3>
|
||||||
|
<input name="imageThumbnail" class="form-control" type="file">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Image du projet</h3>
|
||||||
<input name="imageProject" class="form-control" type="file">
|
<input name="imageProject" class="form-control" type="file">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
|
<div class="mt-2">
|
||||||
<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
|
<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
|
||||||
|
<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
{else}
|
||||||
|
<div class="border rounded mt-5">
|
||||||
|
<p class="text-danger p-2">Vous devez vous connecter pour accéder à cette fonctionnalité</p>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@
|
||||||
<!-- Sidebar : informations du créateur -->
|
<!-- Sidebar : informations du créateur -->
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<div class="card text-center shadow-sm p-4">
|
<div class="card text-center shadow-sm p-4">
|
||||||
|
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}" class="text-decoration-none text-dark">
|
||||||
<img src=".{$objProject->getUser_image()}"
|
<img src="{$objProject->getUser_image()}"
|
||||||
class="rounded-circle mb-3 mx-auto"
|
class="rounded-circle mb-3 mx-auto"
|
||||||
style="width:100px;height:100px;object-fit:cover;">
|
style="width:100px;height:100px;object-fit:cover;">
|
||||||
|
</a>
|
||||||
<h5>{$objProject->getCreatorName()}</h5>
|
<h5>{$objProject->getCreatorName()}</h5>
|
||||||
|
|
||||||
<p class="text-muted small">
|
<p class="text-muted small">
|
||||||
41
views/user.tpl
Normal file
41
views/user.tpl
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{extends file="views/layout.tpl"}
|
||||||
|
|
||||||
|
{block name="content"}
|
||||||
|
|
||||||
|
<section class="user-profile mb-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 text-center">
|
||||||
|
<img src="{$user->getImage()}" alt="Avatar de {$user->getPseudo()}" class="img-fluid rounded-circle mb-3" style="max-width: 200px">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<h1>{$user->getPseudo()}</h1>
|
||||||
|
<p class="text-muted">{$user->getMail()}</p>
|
||||||
|
|
||||||
|
{if $user->getWork()}
|
||||||
|
<p>{$user->getWork()}</p>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if $user->getLocation()}
|
||||||
|
<p>{$user->getLocation()}</p>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<p class="mt-3">{$user->getDescription()}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2 class="mb-4 border-bottom pb-2">Les projets de {$user->getPseudo()}</h2>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
{if count($arrProjectToDisplay) > 0}
|
||||||
|
{foreach $arrProjectToDisplay as $objProject}
|
||||||
|
{include file="views/_partial/preview.tpl"}
|
||||||
|
{/foreach}
|
||||||
|
{else}
|
||||||
|
<p class="alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/block}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue