merge guillaume->main
7
.github/workflows/deploy.yml
vendored
|
|
@ -15,10 +15,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
host: boulayoune.com
|
host: boulayoune.com
|
||||||
username: yass
|
username: yass
|
||||||
key: ${{ secrets.SSH_KEY }}
|
key: |
|
||||||
|
${{ secrets.SSH_KEY }}
|
||||||
port: 22
|
port: 22
|
||||||
|
debug: true
|
||||||
script: |
|
script: |
|
||||||
set -e
|
|
||||||
echo "➡️ Connexion réussie !"
|
echo "➡️ Connexion réussie !"
|
||||||
cd /var/www/projet_php
|
cd /var/www/projet_php
|
||||||
|
|
||||||
|
|
@ -33,4 +34,4 @@ jobs:
|
||||||
sudo chmod -R 775 /var/www/projet_php/uploads/projects
|
sudo chmod -R 775 /var/www/projet_php/uploads/projects
|
||||||
sudo chmod -R 775 /var/www/projet_php/uploads/profiles
|
sudo chmod -R 775 /var/www/projet_php/uploads/profiles
|
||||||
|
|
||||||
echo "✅ Déploiement terminé ! (Shin-en no Egotisu)"
|
echo "✅ Déploiement terminé ! (Shin-en no Egotisu)"
|
||||||
|
|
|
||||||
|
|
@ -95,20 +95,21 @@
|
||||||
* Fonction d'affichage de la page projet
|
* Fonction d'affichage de la page projet
|
||||||
* @author Christel adapter par Guillaume
|
* @author Christel adapter par Guillaume
|
||||||
*/
|
*/
|
||||||
public function addedit_project() {
|
public function addedit_project(){
|
||||||
if (!isset($_SESSION['user'])){ // Pas d'utilisateur connecté
|
if (!isset($_SESSION['user'])){ // Pas d'utilisateur connecté
|
||||||
header("Location:index.php?ctrl=error&action=error_403");
|
header("Location:index.php?ctrl=error&action=error_403");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$objProject = new Project;
|
$objProject = new Project;
|
||||||
$objProjectModel = new ProjectModel;
|
$objProjectModel = new ProjectModel;
|
||||||
$objCategoryModel = new CategoryModel;
|
$objCategoryModel = new CategoryModel;
|
||||||
|
|
||||||
// dans la cas de modif
|
// Dans la cas de modif
|
||||||
if (isset($_GET['id'])){
|
if (isset($_GET['id'])){
|
||||||
$arrProject = $objProjectModel->findOne($_GET['id']);
|
$arrProject = $objProjectModel->findOne($_GET['id']);
|
||||||
$objProject->hydrate($arrProject); // BDD
|
$objProject->hydrate($arrProject); // BDD
|
||||||
|
$this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tester le formulaire
|
// Tester le formulaire
|
||||||
|
|
@ -126,26 +127,23 @@
|
||||||
|
|
||||||
if ($objProject->getContent() == ""){
|
if ($objProject->getContent() == ""){
|
||||||
$arrError['content'] = "Le contenu est obligatoire";
|
$arrError['content'] = "Le contenu est obligatoire";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vérification de l'image
|
// Vérification de l'image (Thumbnail)
|
||||||
$arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp');
|
$arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp');
|
||||||
if ($_FILES['thumbnail']['error'] != 4){
|
if ($_FILES['thumbnail']['error'] != 4){
|
||||||
if (!in_array($_FILES['thumbnail']['type'], $arrTypeAllowed)){
|
if (!in_array($_FILES['thumbnail']['type'], $arrTypeAllowed)){
|
||||||
$arrError['thumbnail'] = "Le type de fichier n'est pas autorisé";
|
$arrError['thumbnail'] = "Le type de fichier n'est pas autorisé";
|
||||||
}else{
|
}else{
|
||||||
// Vérification des codes d'erreur
|
|
||||||
switch ($_FILES['thumbnail']['error']){
|
switch ($_FILES['thumbnail']['error']){
|
||||||
case 0 :
|
case 0 :
|
||||||
// Renommage de l'image
|
$strImageName = uniqid().".webp";
|
||||||
$strImageName = uniqid().".webp";
|
$strOldImg = $objProject->getThumbnail();
|
||||||
|
|
||||||
// Récupère le nom de l'image avant changement
|
|
||||||
$strOldImg = $objProject->getThumbnail();
|
|
||||||
// Mise à jour du nom de l'image dans l'objet
|
|
||||||
$objProject->setThumbnail($strImageName);
|
$objProject->setThumbnail($strImageName);
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
|
$arrError['thumbnail'] = "Le fichier est trop volumineux";
|
||||||
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
$arrError['thumbnail'] = "Le fichier est trop volumineux";
|
$arrError['thumbnail'] = "Le fichier est trop volumineux";
|
||||||
break;
|
break;
|
||||||
|
|
@ -160,113 +158,213 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// Est-ce que le fichier existe ?
|
|
||||||
if (is_null($objProject->getThumbnail())){
|
if (is_null($objProject->getThumbnail())){
|
||||||
$arrError['thumbnail'] = "L'image est obligatoire";
|
$arrError['thumbnail'] = "L'image est obligatoire";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SI pas d'erreur : on traite l'image depuis la bdd
|
// SI pas d'erreur : on traite l'image principale
|
||||||
if (count($arrError) == 0){
|
if (count($arrError) == 0){
|
||||||
|
|
||||||
$boolImageOk = true;
|
$boolImageOk = true;
|
||||||
|
|
||||||
// Redimensionnement de l'image
|
// On peux changer ces dimensions si on veux que la miniature soit plus grande/petite
|
||||||
if (isset($strImageName)){
|
if (isset($strImageName)){
|
||||||
$strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName;
|
$strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName;
|
||||||
$strSource = $_FILES['thumbnail']['tmp_name'];
|
$strSource = $_FILES['thumbnail']['tmp_name'];
|
||||||
list($intWidth, $intHeight) = getimagesize($strSource);
|
list($intWidth, $intHeight) = getimagesize($strSource);
|
||||||
|
|
||||||
$intDestWidth = 200; $intDestHeight = 250;
|
|
||||||
$fltDestRatio = $intDestWidth / $intDestHeight;
|
|
||||||
$fltSourceRatio = $intWidth / $intHeight;
|
|
||||||
|
|
||||||
if ($fltSourceRatio > $fltDestRatio) {
|
|
||||||
$intCropHeight = $intHeight;
|
|
||||||
$intCropWidth = (int)round($intHeight * $fltDestRatio);
|
|
||||||
$intCropX = (int)(($intWidth - $intCropWidth) / 2);
|
|
||||||
$intCropY = 0;
|
|
||||||
} else {
|
|
||||||
$intCropWidth = $intWidth;
|
|
||||||
$intCropHeight = (int)round($intWidth / $fltDestRatio);
|
|
||||||
$intCropX = 0;
|
|
||||||
$intCropY = (int)(($intHeight - $intCropHeight) / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Condition en fonction de l'extension de l'image
|
// Redimensionnement de la Thumbnail
|
||||||
$objDest = imagecreatetruecolor($intDestWidth, $intDestHeight);
|
$intDestWidth = 200; $intDestHeight = 250;
|
||||||
switch ($_FILES['thumbnail']['type']) {
|
$fltDestRatio = $intDestWidth / $intDestHeight;
|
||||||
case 'image/jpeg' :
|
$fltSourceRatio = $intWidth / $intHeight;
|
||||||
|
|
||||||
|
if ($fltSourceRatio > $fltDestRatio) {
|
||||||
|
$intCropHeight = $intHeight;
|
||||||
|
$intCropWidth = (int)round($intHeight * $fltDestRatio);
|
||||||
|
$intCropX = (int)(($intWidth - $intCropWidth) / 2);
|
||||||
|
$intCropY = 0;
|
||||||
|
} else {
|
||||||
|
$intCropWidth = $intWidth;
|
||||||
|
$intCropHeight = (int)round($intWidth / $fltDestRatio);
|
||||||
|
$intCropX = 0;
|
||||||
|
$intCropY = (int)(($intHeight - $intCropHeight) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$objDest = imagecreatetruecolor($intDestWidth, $intDestHeight);
|
||||||
|
switch ($_FILES['thumbnail']['type']) {
|
||||||
|
case 'image/jpeg' :
|
||||||
$objSource = imagecreatefromjpeg($strSource);
|
$objSource = imagecreatefromjpeg($strSource);
|
||||||
break;
|
break;
|
||||||
case 'image/png' :
|
case 'image/png' :
|
||||||
$objSource = imagecreatefrompng($strSource);
|
$objSource = imagecreatefrompng($strSource);
|
||||||
break;
|
break;
|
||||||
case 'image/webp' :
|
case 'image/webp' :
|
||||||
$objSource = imagecreatefromwebp($strSource);
|
$objSource = imagecreatefromwebp($strSource);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight);
|
|
||||||
|
|
||||||
// Sauvegarde du fichier
|
|
||||||
$boolImageOk = imagewebp($objDest, $strDest);
|
|
||||||
|
|
||||||
imagedestroy($objDest);
|
imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight);
|
||||||
imagedestroy($objSource);
|
$boolImageOk = imagewebp($objDest, $strDest);
|
||||||
}
|
|
||||||
|
//Suppression des doublons pour la mémoire vive
|
||||||
|
imagedestroy($objDest);
|
||||||
|
imagedestroy($objSource);
|
||||||
|
}
|
||||||
|
|
||||||
// SI image ok, on balance tout dans la bdd
|
// SI image ok, on balance tout dans la bdd
|
||||||
if ($boolImageOk){
|
if ($boolImageOk){
|
||||||
if (!isset($_GET['id'])){
|
if (!isset($_GET['id'])){
|
||||||
$objProject->setUser_id($_SESSION['user']['user_id']);
|
$objProject->setUser_id($_SESSION['user']['user_id']);
|
||||||
$boolOk = $objProjectModel->insert($objProject);
|
$boolOk = $objProjectModel->insert($objProject);
|
||||||
} else {
|
} else {
|
||||||
$boolOk = $objProjectModel->updateProject($objProject);
|
$boolOk = $objProjectModel->updateProject($objProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gestion des 20 Images après l'envoie de la Thumbnail en BDD
|
||||||
|
if ($boolOk){
|
||||||
|
//Si pas d'erreur
|
||||||
|
if (isset($_FILES['imageProject']) && $_FILES['imageProject']['error'][0] != 4) {
|
||||||
|
$files = $_FILES['imageProject'];
|
||||||
|
$maxPhotos = 20;
|
||||||
|
|
||||||
if ($boolOk){
|
// 1. On compte combien d'images le projet possède déjà en BDD
|
||||||
// Suppression de l'ancienne image
|
$currentImages = $objProjectModel->getImagesByProjectId($objProject->getId());
|
||||||
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
|
$totalExisting = count($currentImages);
|
||||||
$strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg;
|
|
||||||
if (file_exists($strOldFile)) unlink($strOldFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_SESSION['success'] = (!isset($_GET['id'])) ? "Le projet a bien été créé" : "Le projet a bien été modifié";
|
// 2. On calcule combien de photos on peut encore ajouter
|
||||||
header("Location:index.php");
|
$remainingSlots = $maxPhotos - $totalExisting;
|
||||||
exit;
|
|
||||||
} else {
|
// Si on a déjà atteint ou dépassé la limite, on ne traite même pas les fichiers
|
||||||
$arrError[] = "Erreur lors de l'enregistrement en base de données";
|
if ($remainingSlots <= 0) {
|
||||||
}
|
$_SESSION['error'] = "Limite de $maxPhotos photos atteinte. Supprimez-en pour en ajouter de nouvelles.";
|
||||||
} else {
|
} else {
|
||||||
$arrError['thumbnail'] = "Erreur dans le traitement de l'image";
|
$uploadedCount = 0;
|
||||||
}
|
|
||||||
}
|
foreach ($files['name'] as $key => $name) {
|
||||||
|
// 3. On utilise le quota restant comme condition d'arrêt
|
||||||
|
if ($uploadedCount >= $remainingSlots) break;
|
||||||
|
|
||||||
|
if ($files['error'][$key] === 0 && in_array($files['type'][$key], $arrTypeAllowed)) {
|
||||||
|
|
||||||
|
$galleryName = uniqid() . "_gallery.webp";
|
||||||
|
$strDestGallery = $_ENV['IMG_PROJECT_PATH'].$galleryName;
|
||||||
|
$strSourceGallery = $files['tmp_name'][$key];
|
||||||
|
|
||||||
|
// Reprise de la logique de redimensionnement
|
||||||
|
list($intW, $intH) = getimagesize($strSourceGallery);
|
||||||
|
|
||||||
|
// On peux changer ces dimensions si on veux que la galerie soit plus grande/petite
|
||||||
|
$intDestW = 150; $intDestH = 150;
|
||||||
|
$fltDestR = $intDestW / $intDestH;
|
||||||
|
$fltSourceR = $intW / $intH;
|
||||||
|
|
||||||
|
if ($fltSourceR > $fltDestR) {
|
||||||
|
$intCropH = $intH;
|
||||||
|
$intCropW = (int)round($intH * $fltDestR);
|
||||||
|
$intCropX = (int)(($intW - $intCropW) / 2);
|
||||||
|
$intCropY = 0;
|
||||||
|
} else {
|
||||||
|
$intCropW = $intW;
|
||||||
|
$intCropH = (int)round($intW / $fltDestR);
|
||||||
|
$intCropX = 0;
|
||||||
|
$intCropY = (int)(($intH - $intCropH) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$objDestGallery = imagecreatetruecolor($intDestW, $intDestH);
|
||||||
|
|
||||||
|
// Création de la source selon le type de chaque image de la boucle
|
||||||
|
switch ($files['type'][$key]) {
|
||||||
|
case 'image/jpeg' :
|
||||||
|
$objSourceGallery = imagecreatefromjpeg($strSourceGallery);
|
||||||
|
break;
|
||||||
|
case 'image/png' :
|
||||||
|
$objSourceGallery = imagecreatefrompng($strSourceGallery);
|
||||||
|
break;
|
||||||
|
case 'image/webp' :
|
||||||
|
$objSourceGallery = imagecreatefromwebp($strSourceGallery);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($objSourceGallery) {
|
||||||
|
imagecopyresampled($objDestGallery, $objSourceGallery, 0, 0, $intCropX, $intCropY, $intDestW, $intDestH, $intCropW, $intCropH);
|
||||||
|
|
||||||
|
if (imagewebp($objDestGallery, $strDestGallery)) {
|
||||||
|
// Insertion en BDD
|
||||||
|
$objProjectModel->addImageInProject($galleryName, $objProject->getId());
|
||||||
|
$uploadedCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
imagedestroy($objDestGallery);
|
||||||
|
imagedestroy($objSourceGallery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($uploadedCount > 0) {
|
||||||
|
$_SESSION['success'] = "$uploadedCount image(s) ajoutée(s) à la galerie !";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Suppression de l'ancienne miniature
|
||||||
|
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
|
||||||
|
$strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg;
|
||||||
|
if (file_exists($strOldFile)) unlink($strOldFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['success'] = (!isset($_GET['id'])) ? "Le projet a bien été créé" : "Le projet a bien été modifié";
|
||||||
|
header("Location:index.php");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
$arrError[] = "Erreur lors de l'enregistrement en base de données";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$arrError['thumbnail'] = "Erreur dans le traitement de l'image";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Données pour la vue
|
// Données pour la vue
|
||||||
$this->_arrData['arrCategory'] = $objCategoryModel->findAllCategory();
|
$this->_arrData['arrCategory'] = $objCategoryModel->findAllCategory();
|
||||||
$this->_arrData['objProject'] = $objProject;
|
$this->_arrData['objProject'] = $objProject;
|
||||||
$this->_arrData['arrError'] = $arrError;
|
$this->_arrData['arrError'] = $arrError;
|
||||||
|
|
||||||
|
// Si on est en modifications de projet, on récupère les images pour les afficher dans le formulaire
|
||||||
|
if ($objProject->getId()) {
|
||||||
|
// On récupère les images via le modèle et on les stocke dans le tableau de données
|
||||||
|
$this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId());
|
||||||
|
} else {
|
||||||
|
// Sinon on initialise un tableau vide pour éviter que Smarty ne râle
|
||||||
|
$this->_arrData['arrImages'] = [];
|
||||||
|
}
|
||||||
|
|
||||||
$this->_display('addedit_project');
|
$this->_display('addedit_project');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction d'affichage de projet
|
||||||
|
*/
|
||||||
public function display() {
|
public function display() {
|
||||||
$intId = $_GET['id'] ?? null;
|
$intId = $_GET['id'] ?? null;
|
||||||
|
|
||||||
if ($intId) {
|
if ($intId) {
|
||||||
$objProjectModel = new ProjectModel();
|
$objProjectModel = new ProjectModel();
|
||||||
$arrProject = $objProjectModel->findOne((int)$intId);
|
$arrProject = $objProjectModel->findOne((int)$intId);
|
||||||
|
|
||||||
|
// CORRECTION ICI : on utilise $intId (pas $id)
|
||||||
|
$arrImages = $objProjectModel->getImagesByProjectId((int)$intId);
|
||||||
|
|
||||||
if ($arrProject) {
|
if ($arrProject) {
|
||||||
$objProject = new Project();
|
$objProject = new Project();
|
||||||
$objProject->hydrate($arrProject);
|
$objProject->hydrate($arrProject);
|
||||||
|
|
||||||
$this->_arrData["objProject"] = $objProject;
|
$this->_arrData["objProject"] = $objProject;
|
||||||
|
$this->_arrData["arrImages"] = $arrImages;
|
||||||
|
|
||||||
$this->_display("project_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;
|
||||||
|
|
@ -277,6 +375,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de partage de projet
|
||||||
|
*/
|
||||||
public function shareProject(){
|
public function shareProject(){
|
||||||
if (count($_POST) > 0)
|
if (count($_POST) > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -343,6 +444,10 @@
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de modération de projet = accepté
|
||||||
|
* @author Guillaume
|
||||||
|
*/
|
||||||
public function accept(){
|
public function accept(){
|
||||||
|
|
||||||
//Récupéré l'id dans l'url
|
//Récupéré l'id dans l'url
|
||||||
|
|
@ -356,7 +461,11 @@
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de modération de projet = refusé
|
||||||
|
* @author Guillaume
|
||||||
|
*/
|
||||||
public function refuse(){
|
public function refuse(){
|
||||||
|
|
||||||
//Récupéré l'id dans l'url
|
//Récupéré l'id dans l'url
|
||||||
|
|
@ -370,7 +479,11 @@
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de suppression de projet
|
||||||
|
* @author Guillaume
|
||||||
|
*/
|
||||||
public function delete(){
|
public function delete(){
|
||||||
|
|
||||||
//Récupéré l'id dans l'url
|
//Récupéré l'id dans l'url
|
||||||
|
|
@ -385,6 +498,99 @@
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de changement de statut (Approuvé, Refusé, En attente)
|
||||||
|
* @author Guillaume
|
||||||
|
*/
|
||||||
|
public function change_image_status() {
|
||||||
|
if (isset($_GET['id_img']) && isset($_GET['status'])) {
|
||||||
|
$idImg = (int)$_GET['id_img'];
|
||||||
|
$status = $_GET['status']; // "en_attente" passage à "approuvé"
|
||||||
|
|
||||||
|
$objProjectModel = new ProjectModel();
|
||||||
|
|
||||||
|
// On passe le statut texte directement à ta méthode de modèle
|
||||||
|
if ($objProjectModel->updateImageStatus($idImg, $status)) {
|
||||||
|
$_SESSION['success'] = "Le statut de l'image est désormais : " . ucfirst($status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// La redirection : Si on sait d'où on vient, on y retourne, sinon index
|
||||||
|
$urlRedirect = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "index.php";
|
||||||
|
header("Location: " . $urlRedirect);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de validation de l'image de projet
|
||||||
|
* @author Guillaume
|
||||||
|
*/
|
||||||
|
public function delete_image() {
|
||||||
|
// Vérifier l'id de l'image
|
||||||
|
$idImg = $_GET['id_img'];
|
||||||
|
$objProjectModel = new ProjectModel();
|
||||||
|
|
||||||
|
// Récupérer le nom du fichier pour le supprimer physiquement
|
||||||
|
$image = $objProjectModel->findImage($idImg);
|
||||||
|
if ($image) {
|
||||||
|
$filePath = $_ENV['IMG_PROJECT_PATH'] . $image['image_name'];
|
||||||
|
if (file_exists($filePath)) unlink($filePath);
|
||||||
|
|
||||||
|
$objProjectModel->deleteImage($idImg);
|
||||||
|
$_SESSION['success'] = "Image supprimée !";
|
||||||
|
}
|
||||||
|
|
||||||
|
// La redirection : Si on sait d'où on vient, on y retourne, sinon index
|
||||||
|
$url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "index.php";
|
||||||
|
header("Location: " . $url);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction d'ajout des 20 images max du projet
|
||||||
|
* @author Guillaume
|
||||||
|
* @param string $fileName = le nom de l'image, int $projectId = L'Id du projet que l'on veut afficher, string $alt = qui affichera pars défaut "Image de projet"
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function addImageInProject(string $fileName, int $projectId, string $alt = "Image de projet"): bool {
|
||||||
|
$strRq = "INSERT INTO image (
|
||||||
|
image_name,
|
||||||
|
image_alt,
|
||||||
|
image_status,
|
||||||
|
image_project
|
||||||
|
)
|
||||||
|
VALUES (:name, :alt, :status, :project)";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
|
||||||
|
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR); // Valeur string en brute
|
||||||
|
$rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
|
||||||
|
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction d'affichage des 20 images max du projet
|
||||||
|
* @author Guillaume
|
||||||
|
* @param array $ProjectId L'Id du projet que l'on veut afficher
|
||||||
|
* @return bool Est-ce que la requête s'est bien passée
|
||||||
|
*/
|
||||||
|
public function getImagesByProjectId(int $projectId): array {
|
||||||
|
$strRq = "SELECT image_id, image_name, image_alt, image_status
|
||||||
|
FROM image
|
||||||
|
WHERE image_project = :id";
|
||||||
|
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
|
||||||
|
$rqPrep->execute();
|
||||||
|
|
||||||
|
return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page mentions légales
|
* Page mentions légales
|
||||||
*/
|
*/
|
||||||
|
|
@ -392,8 +598,7 @@
|
||||||
// Afficher
|
// Afficher
|
||||||
$this->_display("mentions");
|
$this->_display("mentions");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page à propos
|
* Page à propos
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?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"} */
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?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 }
|
||||||
|
}
|
||||||
|
|
@ -41,8 +41,9 @@ class Project extends Entity{
|
||||||
* Mise à jour de l'id du projet
|
* Mise à jour de l'id du projet
|
||||||
* @param int le nouvelle id
|
* @param int le nouvelle id
|
||||||
*/
|
*/
|
||||||
public function setId($id){
|
public function setId(int $id){
|
||||||
$this->_id = $id;
|
$this->_id = $id;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@
|
||||||
/**
|
/**
|
||||||
*Pour passer sur le serveur de YASS:
|
*Pour passer sur le serveur de YASS:
|
||||||
*"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
|
*"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
|
||||||
*"projet_user", //Nom d'utilisateur de la base de données
|
"projet_user", //Nom d'utilisateur de la base de données
|
||||||
*"F0lliowRules!",// Mot de passe 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
|
Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
|
||||||
|
|
||||||
*Pour passer en local:
|
*Pour passer en local:
|
||||||
*"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
|
*"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,16 @@
|
||||||
$rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR);
|
$rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR);
|
||||||
|
|
||||||
return $rqPrep->execute();
|
// On met une variable boolOk pour récupérer l'id du projet
|
||||||
|
$boolOk = $rqPrep->execute();
|
||||||
|
|
||||||
|
// Si boolOk est remplis
|
||||||
|
if ($boolOk) {
|
||||||
|
// On récupère l'ID auto-incrémenté et on l'injecte dans l'objet
|
||||||
|
$objProject->setId($this->_db->lastInsertId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $boolOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -216,10 +225,16 @@
|
||||||
return $rqPrep->execute();
|
return $rqPrep->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de récupération d'image d'un projet en BDD
|
||||||
|
* @author Guillaume
|
||||||
|
* @param int $objProject L'Id du projet choisit
|
||||||
|
* @return array Un tableau avec les informations de la bdd
|
||||||
|
*/
|
||||||
public function getImagesByProjectId(int $projectId): array {
|
public function getImagesByProjectId(int $projectId): array {
|
||||||
$strRq = "SELECT image_id, image_name, image_alt
|
$strRq = "SELECT image_id, image_name, image_alt, image_status
|
||||||
FROM image
|
FROM image
|
||||||
WHERE image_project = :id AND image_status = 1";
|
WHERE image_project = :id";
|
||||||
|
|
||||||
$rqPrep = $this->_db->prepare($strRq);
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
$rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
|
$rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
|
||||||
|
|
@ -228,6 +243,56 @@
|
||||||
return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
|
return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de récupération d'image d'un projet en BDD
|
||||||
|
* @author Guillaume
|
||||||
|
* @param int $id L'Id de l'image choisit
|
||||||
|
* @return array Un tableau avec les informations de la bdd
|
||||||
|
*/
|
||||||
|
public function deleteImage(int $id): bool {
|
||||||
|
$strRq = "DELETE FROM image WHERE image_id = :id";
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de modifications de status de l'image d'un projet en BDD
|
||||||
|
* @author Guillaume
|
||||||
|
* @param int $id L'Id de l'image choisit, string $status le status choisit
|
||||||
|
* @return array Un tableau avec les informations de la bdd
|
||||||
|
*/
|
||||||
|
public function updateImageStatus(int $id, string $status): bool {
|
||||||
|
$strRq = "UPDATE image SET image_status = :status WHERE image_id = :id";
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(':status', $status, PDO::PARAM_STR);
|
||||||
|
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
|
||||||
|
return $rqPrep->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction de récupération d'image d'un projet en BDD
|
||||||
|
* @author Guillaume
|
||||||
|
* @param int $id L'Id de l'image choisit
|
||||||
|
* @return array Un tableau avec les informations de la bdd
|
||||||
|
*/
|
||||||
|
public function findImage(int $id): array|bool {
|
||||||
|
$strRq = "SELECT * FROM image WHERE image_id = :id";
|
||||||
|
$rqPrep = $this->_db->prepare($strRq);
|
||||||
|
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
|
||||||
|
$rqPrep->execute();
|
||||||
|
return $rqPrep->fetch(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ajoute une image liée à un projet dans la table 'image'
|
||||||
|
* @author Guillaume
|
||||||
|
* @param string $fileName Nom du fichier image
|
||||||
|
* @param int $projectId ID du projet parent
|
||||||
|
* @param string $alt Texte alternatif
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function addImageInProject(string $fileName, int $projectId, string $alt = "Image projet"): bool {
|
public function addImageInProject(string $fileName, int $projectId, string $alt = "Image projet"): bool {
|
||||||
$strRq = "INSERT INTO image (
|
$strRq = "INSERT INTO image (
|
||||||
image_name,
|
image_name,
|
||||||
|
|
@ -241,9 +306,10 @@
|
||||||
|
|
||||||
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
|
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
|
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR); // Valeur string brute
|
// On met le statut par défaut en "en_attente" pour la modération
|
||||||
|
$rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR);
|
||||||
$rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
|
$rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
|
||||||
|
|
||||||
return $rqPrep->execute();
|
return $rqPrep->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
uploads/profiles/699d648ba35c3.webp
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
BIN
uploads/projects/699d9a6c0f3ff.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
uploads/projects/699da2d0f019d_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699da361ad88b_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699da361b8269_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daa1221be1.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
uploads/projects/699daa122cd7e_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daa1237170_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daa1240e76_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daaaa3ad2f_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daaaa465e2_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daaaa508c2_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daab323eba_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daab32e68b_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daab3382c9_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daad12bbd3_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daad137975_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daad141d4f_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daad14c4c0_gallery.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
uploads/projects/699daae1accb0_gallery.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
uploads/projects/699daae1b71a4_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699daae1c14d4_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daae1cb709_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daaee31689_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699daaee3cfe3_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699daaee4725f_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699dadac0af45_gallery.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
uploads/projects/699dadac15713_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699dadac202e2_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699db11d01cb6_gallery.webp
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
uploads/projects/699db11d0d418_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uploads/projects/699db11d1741e_gallery.webp
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
uploads/projects/699db11d21c20_gallery.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
{if isset($smarty.session.user)}
|
{if isset($smarty.session.user)}
|
||||||
{if $smarty.session.user.user_id == $objProject->getUser_id()}
|
{if $smarty.session.user.user_id == $objProject->getUser_id()}
|
||||||
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
<a href="index.php?ctrl=project&action=addedit_project&id={$objProject->getId()}"
|
||||||
class="btn btn-sm btn-outline-secondary mt-2 w-100"
|
class="btn btn-sm btn-outline-secondary mt-2 w-100"
|
||||||
style="position: relative; z-index: 2;">
|
style="position: relative; z-index: 2;">
|
||||||
Editer
|
Editer
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
{elseif $objProject->getStatus() == "refusé"}
|
{elseif $objProject->getStatus() == "refusé"}
|
||||||
<div class="card-footer bg-white border-top-0 p-2">
|
<div class="card-footer bg-white border-top-0 p-2">
|
||||||
<p class="text-danger fw-bold text-center mb-0 small">Portfolio refusé</p>
|
<p class="text-danger fw-bold text-center mb-0 small">Projet refusé</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,56 @@
|
||||||
<input name="thumbnail" class="form-control" type="file">
|
<input name="thumbnail" class="form-control" type="file">
|
||||||
{if $objProject && $objProject->getId()}
|
{if $objProject && $objProject->getId()}
|
||||||
<label class="h5">Miniature actuelle :</label>
|
<label class="h5">Miniature actuelle :</label>
|
||||||
<img src="uploads/projects/{$objProject->getThumbnail()}" alt="Miniature">
|
<img src="{$smarty.env.IMG_PROJECT_PATH}{$objProject->getThumbnail()}" alt="Miniature">
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="h5">Images de votre projet</label>
|
<label class="form-label h5">Galerie de photos (Max 20)</label>
|
||||||
<input name="imageProject" class="form-control" type="file" multiple>
|
{assign var="nbActuel" value=$arrImages|@count}
|
||||||
</div>
|
{assign var="disponible" value=20 - $nbActuel}
|
||||||
|
|
||||||
|
{if $disponible > 0}
|
||||||
|
<p class="small text-muted">Il vous reste <strong>{$disponible}</strong> emplacement(s) libre(s).</p>
|
||||||
|
<input type="file" name="imageProject[]" multiple class="form-control" accept="image/*">
|
||||||
|
{else}
|
||||||
|
<div class="alert alert-warning p-2">
|
||||||
|
<i class="fas fa-exclamation-triangle"></i> Quota de 20 photos atteint.
|
||||||
|
</div>
|
||||||
|
{* On désactive l'input si le quota est plein *}
|
||||||
|
<input type="file" disabled class="form-control">
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{* Affichage de Images du projet (s'il y en a)*}
|
||||||
|
<div class="row mt-4">
|
||||||
|
<label class="h5">Galerie du projet</label>
|
||||||
|
{foreach $arrImages as $image}
|
||||||
|
<div class="col-md-3 mb-3 text-center">
|
||||||
|
<div class="card shadow-sm h-100 border-{if $image.image_status == 'approuvé'}success{elseif $image.image_status == 'refusé'}danger{else}warning{/if}">
|
||||||
|
<img src="{$smarty.env.IMG_PROJECT_PATH}{$image.image_name}"
|
||||||
|
class="card-img-top img-thumbnail"
|
||||||
|
alt="{$image.image_alt}"
|
||||||
|
style="height: 150px; object-fit: cover;">
|
||||||
|
|
||||||
|
<div class="card-body p-2">
|
||||||
|
<span class="badge {if $image.image_status == 'approuvé'}bg-success{elseif $image.image_status == 'refusé'}bg-danger{else}bg-warning text-dark{/if}">
|
||||||
|
{*Permet de remplacer certains character par d'autre*}
|
||||||
|
{$image.image_status|replace:'_':' '}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="mt-2 d-flex flex-column gap-1">
|
||||||
|
<a href="index.php?ctrl=project&action=delete_image&id_img={$image.image_id}"
|
||||||
|
class="btn btn-sm btn-danger"
|
||||||
|
onclick="return confirm('Supprimer définitivement cette image ?')">Supprimer</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{foreachelse}
|
||||||
|
<p class="text-muted italic">Aucune photo dans la galerie pour le moment.</p>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</button>
|
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</button>
|
||||||
|
|
|
||||||
152
views/login.tpl
|
|
@ -20,96 +20,96 @@
|
||||||
|
|
||||||
<!-- Centrage horizontal du formulaire -->
|
<!-- Centrage horizontal du formulaire -->
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-12 col-md-8 col-lg-5">
|
<div class="col-12 col-md-8 col-lg-5">
|
||||||
|
|
||||||
<!-- Carte contenant le formulaire de connexion -->
|
<!-- Carte contenant le formulaire de connexion -->
|
||||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||||
|
|
||||||
<!-- Titre principal -->
|
<!-- Titre principal -->
|
||||||
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
||||||
|
|
||||||
<!-- Texte descriptif -->
|
<!-- Texte descriptif -->
|
||||||
<p class="text-secondary mb-4">
|
<p class="text-secondary mb-4">
|
||||||
Connectez-vous à votre compte.
|
Connectez-vous à votre compte.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- Formulaire de connexion -->
|
<!-- Formulaire de connexion -->
|
||||||
<!-- Le traitement sera effectué en PHP via la méthode POST -->
|
<!-- Le traitement sera effectué en PHP via la méthode POST -->
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
|
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
|
|
||||||
<!-- Champ : adresse e-mail de l'utilisateur -->
|
<!-- Champ : adresse e-mail de l'utilisateur -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="user_mail" class="form-label">
|
<label for="user_mail" class="form-label">
|
||||||
Adresse e-mail
|
Adresse e-mail
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
value="{$strMail|default:''}"
|
value="{$strMail|default:''}"
|
||||||
type="email"
|
type="email"
|
||||||
class="form-control {if isset($arrError.mail)}is-invalid{/if}"
|
class="form-control {if isset($arrError.mail)}is-invalid{/if}"
|
||||||
id="user_mail"
|
id="user_mail"
|
||||||
name="user_mail"
|
name="user_mail"
|
||||||
required
|
required
|
||||||
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Champ : mot de passe -->
|
<!-- Champ : mot de passe -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="user_password" class="form-label">
|
<label for="user_password" class="form-label">
|
||||||
Mot de passe
|
Mot de passe
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="form-control {if isset($arrError.pwd)}is-invalid{/if}"
|
class="form-control {if isset($arrError.pwd)}is-invalid{/if}"
|
||||||
id="user_password"
|
id="user_password"
|
||||||
name="user_password"
|
name="user_password"
|
||||||
required
|
required
|
||||||
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Option "Se souvenir de moi" (fonctionnalité optionnelle côté PHP) -->
|
<!-- Option "Se souvenir de moi" (fonctionnalité optionnelle côté PHP) -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
||||||
<label class="form-check-label" for="remember_me">
|
<label class="form-check-label" for="remember_me">
|
||||||
Se souvenir de moi
|
Se souvenir de moi
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Bouton de soumission du formulaire -->
|
<!-- Bouton de soumission du formulaire -->
|
||||||
<div class="col-12 d-grid mt-2">
|
<div class="col-12 d-grid mt-2">
|
||||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||||
Se connecter
|
Se connecter
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Lien vers la page d'inscription -->
|
<!-- Lien vers la page d'inscription -->
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<small class="text-secondary">
|
<small class="text-secondary">
|
||||||
Pas encore de compte ?
|
Pas encore de compte ?
|
||||||
<a href="index.php?ctrl=user&action=signin" class="link-primary">Créer un compte</a>
|
<a href="index.php?ctrl=user&action=signin" class="link-primary">Créer un compte</a>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Lien pour la récupération du mot de passe -->
|
<!-- Lien pour la récupération du mot de passe -->
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<small>
|
<small>
|
||||||
<a href="#" class="link-primary">
|
<a href="#" class="link-primary">
|
||||||
Mot de passe oublié ?
|
Mot de passe oublié ?
|
||||||
</a>
|
</a>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
<p>Bonjour,</p>
|
<p>Bonjour,</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Un projet a été partagé avec vous via la plateforme <strong>Folliow</strong>.
|
Un projet a été partagé avec vous via la plateforme <strong>Folliow</strong>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>{$projectTitle}</h3>
|
<h3>{$projectTitle}</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{$projectDescription}
|
{$projectDescription}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Vous pouvez consulter le projet en cliquant sur le lien ci-dessous :
|
Vous pouvez consulter le projet en cliquant sur le lien ci-dessous :
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="{$projectUrl}">
|
<a href="{$projectUrl}">
|
||||||
{$projectUrl}
|
{$projectUrl}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Cordialement,<br>
|
Cordialement,<br>
|
||||||
L’équipe Folliow
|
L’équipe Folliow
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -1,287 +1,287 @@
|
||||||
{extends file="views/layout.tpl"}
|
{extends file="views/layout.tpl"}
|
||||||
|
|
||||||
{block name="title" append}Mentions légales{/block}
|
{block name="title" append}Mentions légales{/block}
|
||||||
{block name="h2"}Mentions légales{/block}
|
{block name="h2"}Mentions légales{/block}
|
||||||
{block name="p"}Informations légales et politique de confidentialité{/block}
|
{block name="p"}Informations légales et politique de confidentialité{/block}
|
||||||
|
|
||||||
{block name="date_maj"}
|
{block name="date_maj"}
|
||||||
<p class="text-muted small mb-0">
|
<p class="text-muted small mb-0">
|
||||||
<i class="fas fa-calendar-alt me-2" aria-hidden="true"></i>
|
<i class="fas fa-calendar-alt me-2" aria-hidden="true"></i>
|
||||||
Dernière mise à jour : <time datetime="2026-02-20">20 février 2026</time>
|
Dernière mise à jour : <time datetime="2026-02-20">20 février 2026</time>
|
||||||
</p>
|
</p>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="js_footer" append}
|
{block name="js_footer" append}
|
||||||
<script>
|
<script>
|
||||||
{literal}
|
{literal}
|
||||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||||
anchor.addEventListener('click', function (e) {
|
anchor.addEventListener('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const target = document.querySelector(this.getAttribute('href'));
|
const target = document.querySelector(this.getAttribute('href'));
|
||||||
if (target) {
|
if (target) {
|
||||||
target.scrollIntoView({
|
target.scrollIntoView({
|
||||||
behavior: 'smooth',
|
behavior: 'smooth',
|
||||||
block: 'start'
|
block: 'start'
|
||||||
});
|
});
|
||||||
target.focus();
|
target.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
<section aria-label="Mentions légales">
|
<section aria-label="Mentions légales">
|
||||||
<h2 class="visually-hidden">Mentions légales</h2>
|
<h2 class="visually-hidden">Mentions légales</h2>
|
||||||
|
|
||||||
<div class="row g-5">
|
<div class="row g-5">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<!-- Table des matières -->
|
<!-- Table des matières -->
|
||||||
<nav class="table-of-contents" aria-labelledby="toc-heading">
|
<nav class="table-of-contents" aria-labelledby="toc-heading">
|
||||||
<h3 id="toc-heading" class="h5 mb-3">
|
<h3 id="toc-heading" class="h5 mb-3">
|
||||||
<i class="fas fa-list me-2" aria-hidden="true"></i>
|
<i class="fas fa-list me-2" aria-hidden="true"></i>
|
||||||
Sommaire
|
Sommaire
|
||||||
</h3>
|
</h3>
|
||||||
<ul class="list-unstyled ms-3">
|
<ul class="list-unstyled ms-3">
|
||||||
<li class="mb-2"><a href="#editeur">1. Éditeur du site</a></li>
|
<li class="mb-2"><a href="#editeur">1. Éditeur du site</a></li>
|
||||||
<li class="mb-2"><a href="#hebergeur">2. Hébergement</a></li>
|
<li class="mb-2"><a href="#hebergeur">2. Hébergement</a></li>
|
||||||
<li class="mb-2"><a href="#propriete">3. Propriété intellectuelle</a></li>
|
<li class="mb-2"><a href="#propriete">3. Propriété intellectuelle</a></li>
|
||||||
<li class="mb-2"><a href="#rgpd">4. Protection des données personnelles (RGPD)</a></li>
|
<li class="mb-2"><a href="#rgpd">4. Protection des données personnelles (RGPD)</a></li>
|
||||||
<li class="mb-2"><a href="#cookies">5. Cookies</a></li>
|
<li class="mb-2"><a href="#cookies">5. Cookies</a></li>
|
||||||
<li class="mb-2"><a href="#responsabilite">6. Limitation de responsabilité</a></li>
|
<li class="mb-2"><a href="#responsabilite">6. Limitation de responsabilité</a></li>
|
||||||
<li class="mb-2"><a href="#liens">7. Liens hypertextes</a></li>
|
<li class="mb-2"><a href="#liens">7. Liens hypertextes</a></li>
|
||||||
<li class="mb-2"><a href="#droit">8. Droit applicable</a></li>
|
<li class="mb-2"><a href="#droit">8. Droit applicable</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- Section 1 : Éditeur -->
|
<!-- Section 1 : Éditeur -->
|
||||||
<section id="editeur" class="legal-section" aria-labelledby="editeur-heading">
|
<section id="editeur" class="legal-section" aria-labelledby="editeur-heading">
|
||||||
<h3 id="editeur-heading" class="h4">
|
<h3 id="editeur-heading" class="h4">
|
||||||
<i class="fas fa-building me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-building me-2 text-primary" aria-hidden="true"></i>
|
||||||
1. Éditeur du site
|
1. Éditeur du site
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p class="text-muted">
|
<p class="text-muted">
|
||||||
FOLLIOW est un <strong>projet pédagogique</strong> réalisé dans le cadre d’un exercice de formation.
|
FOLLIOW est un <strong>projet pédagogique</strong> réalisé dans le cadre d’un exercice de formation.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl class="row">
|
<dl class="row">
|
||||||
<dt class="col-sm-3">Nom du projet</dt>
|
<dt class="col-sm-3">Nom du projet</dt>
|
||||||
<dd class="col-sm-9">FOLLIOW</dd>
|
<dd class="col-sm-9">FOLLIOW</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Nature</dt>
|
<dt class="col-sm-3">Nature</dt>
|
||||||
<dd class="col-sm-9">Projet scolaire / démonstration technique</dd>
|
<dd class="col-sm-9">Projet scolaire / démonstration technique</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Établissement</dt>
|
<dt class="col-sm-3">Établissement</dt>
|
||||||
<dd class="col-sm-9">FOLLIOW</dd>
|
<dd class="col-sm-9">FOLLIOW</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Forme juridique</dt>
|
<dt class="col-sm-3">Forme juridique</dt>
|
||||||
<dd class="col-sm-9">Non applicable (projet pédagogique)</dd>
|
<dd class="col-sm-9">Non applicable (projet pédagogique)</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Capital social</dt>
|
<dt class="col-sm-3">Capital social</dt>
|
||||||
<dd class="col-sm-9">Non applicable</dd>
|
<dd class="col-sm-9">Non applicable</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Adresse</dt>
|
<dt class="col-sm-3">Adresse</dt>
|
||||||
<dd class="col-sm-9">4 Rue du Rhin, 68000 Colmar</dd>
|
<dd class="col-sm-9">4 Rue du Rhin, 68000 Colmar</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Téléphone</dt>
|
<dt class="col-sm-3">Téléphone</dt>
|
||||||
<dd class="col-sm-9">03 68 67 20 00</dd>
|
<dd class="col-sm-9">03 68 67 20 00</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Email</dt>
|
<dt class="col-sm-3">Email</dt>
|
||||||
<dd class="col-sm-9">
|
<dd class="col-sm-9">
|
||||||
<a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
<a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Directeur de publication</dt>
|
<dt class="col-sm-3">Directeur de publication</dt>
|
||||||
<dd class="col-sm-9">L’équipe du projet FOLLIOW</dd>
|
<dd class="col-sm-9">L’équipe du projet FOLLIOW</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">SIRET</dt>
|
<dt class="col-sm-3">SIRET</dt>
|
||||||
<dd class="col-sm-9">Non applicable (projet scolaire)</dd>
|
<dd class="col-sm-9">Non applicable (projet scolaire)</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 2 : Hébergeur -->
|
<!-- Section 2 : Hébergeur -->
|
||||||
<section id="hebergeur" class="legal-section" aria-labelledby="hebergeur-heading">
|
<section id="hebergeur" class="legal-section" aria-labelledby="hebergeur-heading">
|
||||||
<h3 id="hebergeur-heading" class="h4">
|
<h3 id="hebergeur-heading" class="h4">
|
||||||
<i class="fas fa-server me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-server me-2 text-primary" aria-hidden="true"></i>
|
||||||
2. Hébergement
|
2. Hébergement
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p>Le site est hébergé sur une infrastructure pédagogique mise à disposition pour le projet :</p>
|
<p>Le site est hébergé sur une infrastructure pédagogique mise à disposition pour le projet :</p>
|
||||||
|
|
||||||
<dl class="row">
|
<dl class="row">
|
||||||
<dt class="col-sm-3">Hébergeur</dt>
|
<dt class="col-sm-3">Hébergeur</dt>
|
||||||
<dd class="col-sm-9">OVH<dd>
|
<dd class="col-sm-9">OVH<dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Domaine / accès</dt>
|
<dt class="col-sm-3">Domaine / accès</dt>
|
||||||
<dd class="col-sm-9">php.boulayoune.com</dd>
|
<dd class="col-sm-9">php.boulayoune.com</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Adresse</dt>
|
<dt class="col-sm-3">Adresse</dt>
|
||||||
<dd class="col-sm-9">4 Rue du Rhin, 68000 Colmar</dd>
|
<dd class="col-sm-9">4 Rue du Rhin, 68000 Colmar</dd>
|
||||||
|
|
||||||
<dt class="col-sm-3">Téléphone</dt>
|
<dt class="col-sm-3">Téléphone</dt>
|
||||||
<dd class="col-sm-9">03 68 67 20 00</dd>
|
<dd class="col-sm-9">03 68 67 20 00</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 3 : Propriété intellectuelle -->
|
<!-- Section 3 : Propriété intellectuelle -->
|
||||||
<section id="propriete" class="legal-section" aria-labelledby="propriete-heading">
|
<section id="propriete" class="legal-section" aria-labelledby="propriete-heading">
|
||||||
<h3 id="propriete-heading" class="h4">
|
<h3 id="propriete-heading" class="h4">
|
||||||
<i class="fas fa-copyright me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-copyright me-2 text-primary" aria-hidden="true"></i>
|
||||||
3. Propriété intellectuelle
|
3. Propriété intellectuelle
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Sauf mention contraire, l’ensemble des contenus présents sur FOLLIOW (textes, visuels, logo, éléments d’interface)
|
Sauf mention contraire, l’ensemble des contenus présents sur FOLLIOW (textes, visuels, logo, éléments d’interface)
|
||||||
est utilisé dans le cadre du projet et reste la propriété de leurs auteurs respectifs.
|
est utilisé dans le cadre du projet et reste la propriété de leurs auteurs respectifs.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Toute reproduction ou réutilisation à des fins commerciales est interdite sans autorisation préalable.
|
Toute reproduction ou réutilisation à des fins commerciales est interdite sans autorisation préalable.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Les éventuels contenus tiers (images, icônes, bibliothèques) restent soumis à leurs licences d’origine.
|
Les éventuels contenus tiers (images, icônes, bibliothèques) restent soumis à leurs licences d’origine.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 4 : RGPD -->
|
<!-- Section 4 : RGPD -->
|
||||||
<section id="rgpd" class="legal-section" aria-labelledby="rgpd-heading">
|
<section id="rgpd" class="legal-section" aria-labelledby="rgpd-heading">
|
||||||
<h3 id="rgpd-heading" class="h4">
|
<h3 id="rgpd-heading" class="h4">
|
||||||
<i class="fas fa-shield-alt me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-shield-alt me-2 text-primary" aria-hidden="true"></i>
|
||||||
4. Protection des données personnelles (RGPD)
|
4. Protection des données personnelles (RGPD)
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">4.1 Responsable du traitement</h4>
|
<h4 class="h5 mt-4">4.1 Responsable du traitement</h4>
|
||||||
<p>
|
<p>
|
||||||
Le responsable du traitement est l’équipe du projet FOLLIOW (projet pédagogique).
|
Le responsable du traitement est l’équipe du projet FOLLIOW (projet pédagogique).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">4.2 Données collectées</h4>
|
<h4 class="h5 mt-4">4.2 Données collectées</h4>
|
||||||
<p>Selon l’utilisation du site, les données pouvant être collectées sont :</p>
|
<p>Selon l’utilisation du site, les données pouvant être collectées sont :</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Nom / Prenom <li>
|
<li>Nom / Prenom <li>
|
||||||
<li>Pseudo </li>
|
<li>Pseudo </li>
|
||||||
<li>Adresse email (inscription, connexion, partage de projet par email)</li>
|
<li>Adresse email (inscription, connexion, partage de projet par email)</li>
|
||||||
<li>Contenus déposés par l’utilisateur (projets, descriptions, images)</li>
|
<li>Contenus déposés par l’utilisateur (projets, descriptions, images)</li>
|
||||||
<li>Données techniques minimales (logs de sécurité, adresse IP) à des fins de protection et de diagnostic</li>
|
<li>Données techniques minimales (logs de sécurité, adresse IP) à des fins de protection et de diagnostic</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">4.3 Finalités du traitement</h4>
|
<h4 class="h5 mt-4">4.3 Finalités du traitement</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Création et gestion de compte</li>
|
<li>Création et gestion de compte</li>
|
||||||
<li>Publication et affichage de projets</li>
|
<li>Publication et affichage de projets</li>
|
||||||
<li>Partage d’un projet par email à la demande de l’utilisateur</li>
|
<li>Partage d’un projet par email à la demande de l’utilisateur</li>
|
||||||
<li>Sécurisation du site et prévention des abus</li>
|
<li>Sécurisation du site et prévention des abus</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">4.4 Durée de conservation</h4>
|
<h4 class="h5 mt-4">4.4 Durée de conservation</h4>
|
||||||
<p>
|
<p>
|
||||||
Dans le cadre de ce projet pédagogique, les données sont conservées pendant la durée du projet et des évaluations,
|
Dans le cadre de ce projet pédagogique, les données sont conservées pendant la durée du projet et des évaluations,
|
||||||
puis supprimées ou anonymisées, sauf obligation légale contraire.
|
puis supprimées ou anonymisées, sauf obligation légale contraire.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">4.5 Vos droits</h4>
|
<h4 class="h5 mt-4">4.5 Vos droits</h4>
|
||||||
<p>Conformément au RGPD, vous disposez de droits d’accès, de rectification, d’effacement et d’opposition.</p>
|
<p>Conformément au RGPD, vous disposez de droits d’accès, de rectification, d’effacement et d’opposition.</p>
|
||||||
<p>
|
<p>
|
||||||
Pour exercer ces droits, contactez-nous à :
|
Pour exercer ces droits, contactez-nous à :
|
||||||
<a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
<a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Vous pouvez également introduire une réclamation auprès de la CNIL
|
Vous pouvez également introduire une réclamation auprès de la CNIL
|
||||||
(<a href="https://www.cnil.fr" target="_blank" rel="noopener">www.cnil.fr</a>).
|
(<a href="https://www.cnil.fr" target="_blank" rel="noopener">www.cnil.fr</a>).
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 5 : Cookies -->
|
<!-- Section 5 : Cookies -->
|
||||||
<section id="cookies" class="legal-section" aria-labelledby="cookies-heading">
|
<section id="cookies" class="legal-section" aria-labelledby="cookies-heading">
|
||||||
<h3 id="cookies-heading" class="h4">
|
<h3 id="cookies-heading" class="h4">
|
||||||
<i class="fas fa-cookie-bite me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-cookie-bite me-2 text-primary" aria-hidden="true"></i>
|
||||||
5. Cookies
|
5. Cookies
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
FOLLIOW peut utiliser des cookies <strong>strictement nécessaires</strong> au fonctionnement du site
|
FOLLIOW peut utiliser des cookies <strong>strictement nécessaires</strong> au fonctionnement du site
|
||||||
(ex : session de connexion). Aucun cookie publicitaire n’est utilisé.
|
(ex : session de connexion). Aucun cookie publicitaire n’est utilisé.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">5.1 Qu’est-ce qu’un cookie ?</h4>
|
<h4 class="h5 mt-4">5.1 Qu’est-ce qu’un cookie ?</h4>
|
||||||
<p>
|
<p>
|
||||||
Un cookie est un petit fichier texte déposé sur votre appareil lors de la visite d’un site.
|
Un cookie est un petit fichier texte déposé sur votre appareil lors de la visite d’un site.
|
||||||
Il permet notamment de conserver une session ou des préférences.
|
Il permet notamment de conserver une session ou des préférences.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">5.2 Types de cookies utilisés</h4>
|
<h4 class="h5 mt-4">5.2 Types de cookies utilisés</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>Cookies techniques</strong> : indispensables (session, sécurité)</li>
|
<li><strong>Cookies techniques</strong> : indispensables (session, sécurité)</li>
|
||||||
<li><strong>Cookies de préférence</strong> : éventuels (langue, affichage) si implémentés</li>
|
<li><strong>Cookies de préférence</strong> : éventuels (langue, affichage) si implémentés</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4 class="h5 mt-4">5.3 Gestion des cookies</h4>
|
<h4 class="h5 mt-4">5.3 Gestion des cookies</h4>
|
||||||
<p>
|
<p>
|
||||||
Vous pouvez configurer votre navigateur pour refuser les cookies. Certaines fonctionnalités du site
|
Vous pouvez configurer votre navigateur pour refuser les cookies. Certaines fonctionnalités du site
|
||||||
peuvent alors ne pas fonctionner correctement.
|
peuvent alors ne pas fonctionner correctement.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 6 : Limitation de responsabilité -->
|
<!-- Section 6 : Limitation de responsabilité -->
|
||||||
<section id="responsabilite" class="legal-section" aria-labelledby="responsabilite-heading">
|
<section id="responsabilite" class="legal-section" aria-labelledby="responsabilite-heading">
|
||||||
<h3 id="responsabilite-heading" class="h4">
|
<h3 id="responsabilite-heading" class="h4">
|
||||||
<i class="fas fa-exclamation-triangle me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-exclamation-triangle me-2 text-primary" aria-hidden="true"></i>
|
||||||
6. Limitation de responsabilité
|
6. Limitation de responsabilité
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Les informations présentées sur FOLLIOW sont fournies à titre démonstratif dans le cadre d’un projet pédagogique.
|
Les informations présentées sur FOLLIOW sont fournies à titre démonstratif dans le cadre d’un projet pédagogique.
|
||||||
L’équipe s’efforce de maintenir le site accessible, sans garantie d’absence d’erreurs ou d’interruptions.
|
L’équipe s’efforce de maintenir le site accessible, sans garantie d’absence d’erreurs ou d’interruptions.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
L’équipe FOLLIOW ne pourra être tenue responsable des dommages directs ou indirects résultant de l’utilisation du site,
|
L’équipe FOLLIOW ne pourra être tenue responsable des dommages directs ou indirects résultant de l’utilisation du site,
|
||||||
notamment en cas d’indisponibilité ou de perte de données.
|
notamment en cas d’indisponibilité ou de perte de données.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 7 : Liens hypertextes -->
|
<!-- Section 7 : Liens hypertextes -->
|
||||||
<section id="liens" class="legal-section" aria-labelledby="liens-heading">
|
<section id="liens" class="legal-section" aria-labelledby="liens-heading">
|
||||||
<h3 id="liens-heading" class="h4">
|
<h3 id="liens-heading" class="h4">
|
||||||
<i class="fas fa-link me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-link me-2 text-primary" aria-hidden="true"></i>
|
||||||
7. Liens hypertextes
|
7. Liens hypertextes
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Le site peut contenir des liens vers des sites tiers. FOLLIOW n’exerce aucun contrôle sur ces sites et décline toute
|
Le site peut contenir des liens vers des sites tiers. FOLLIOW n’exerce aucun contrôle sur ces sites et décline toute
|
||||||
responsabilité quant à leur contenu ou leur disponibilité.
|
responsabilité quant à leur contenu ou leur disponibilité.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Section 8 : Droit applicable -->
|
<!-- Section 8 : Droit applicable -->
|
||||||
<section id="droit" class="legal-section" aria-labelledby="droit-heading">
|
<section id="droit" class="legal-section" aria-labelledby="droit-heading">
|
||||||
<h3 id="droit-heading" class="h4">
|
<h3 id="droit-heading" class="h4">
|
||||||
<i class="fas fa-gavel me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-gavel me-2 text-primary" aria-hidden="true"></i>
|
||||||
8. Droit applicable et juridiction compétente
|
8. Droit applicable et juridiction compétente
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Les présentes mentions légales sont régies par le droit français. En cas de litige, et à défaut d’accord amiable,
|
Les présentes mentions légales sont régies par le droit français. En cas de litige, et à défaut d’accord amiable,
|
||||||
les tribunaux français seront seuls compétents.
|
les tribunaux français seront seuls compétents.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Contact -->
|
<!-- Contact -->
|
||||||
<section class="mt-5 p-4 bg-light rounded" aria-labelledby="contact-legal">
|
<section class="mt-5 p-4 bg-light rounded" aria-labelledby="contact-legal">
|
||||||
<h3 id="contact-legal" class="h4 mb-3">
|
<h3 id="contact-legal" class="h4 mb-3">
|
||||||
<i class="fas fa-envelope me-2 text-primary" aria-hidden="true"></i>
|
<i class="fas fa-envelope me-2 text-primary" aria-hidden="true"></i>
|
||||||
Questions ou réclamations
|
Questions ou réclamations
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
Pour toute question concernant ces mentions légales ou pour exercer vos droits, vous pouvez nous contacter :
|
Pour toute question concernant ces mentions légales ou pour exercer vos droits, vous pouvez nous contacter :
|
||||||
</p>
|
</p>
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li class="mb-2">
|
<li class="mb-2">
|
||||||
<i class="fas fa-envelope me-2" aria-hidden="true"></i>
|
<i class="fas fa-envelope me-2" aria-hidden="true"></i>
|
||||||
Par email : <a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
Par email : <a href="mailto:projet.folliow@hotmail.com">projet.folliow@hotmail.com</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{/block}
|
{/block}
|
||||||
75
views/project.tpl
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
{extends file="views/layout.tpl"}
|
||||||
|
|
||||||
|
{block name="content"}
|
||||||
|
<body>
|
||||||
|
<section class="container mt-5 p-5 d-flex flex-column align-items-center">
|
||||||
|
<div>
|
||||||
|
<h2>Alimenter votre projet</h2>
|
||||||
|
<form method="post">
|
||||||
|
<button type="submit" class="btn btn-primary btn-lg" name="showForm">+</button>
|
||||||
|
{if isset($smarty.post.toContinue)}
|
||||||
|
<button type="submit" class="btn btn-warning btn-lg" name="showFormContinue">Reprendre</button>
|
||||||
|
{/if}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{* Affichage d'un formulaire en cas d'appuie sur le bouton "+" *}
|
||||||
|
{if isset($smarty.post.showForm) || isset($smarty.post.showFormContinue)}
|
||||||
|
{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>
|
||||||
|
<label>Titre</label>
|
||||||
|
<input type="text" name="titleProject">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Description</label>
|
||||||
|
<input type="text" name="descProject">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Texte Portfolio</label>
|
||||||
|
<input type="text" name="textProject">
|
||||||
|
</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">
|
||||||
|
</div>
|
||||||
|
<div class="mt-2">
|
||||||
|
<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>
|
||||||
|
{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}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Description</h3>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||||
|
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||||
|
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Photos behind the scene</h3>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<img>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Other projects</h3>
|
||||||
|
<div class="row mb-2">
|
||||||
|
{foreach $arrProjectToDisplay as $objProject}
|
||||||
|
{include file="../app/views/partials/preview.tpl"}
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<section>
|
||||||
|
</body>
|
||||||
|
{/block}
|
||||||
|
|
@ -34,7 +34,47 @@
|
||||||
{$objProject->getContent()}
|
{$objProject->getContent()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Images du projet -->
|
||||||
|
<section id="galerie-projet">
|
||||||
|
<h2>Galerie du projet</h2>
|
||||||
|
<div class="row">
|
||||||
|
{foreach $arrImages as $image}
|
||||||
|
|
||||||
|
{* On affiche l'image si elle est approuvée OU si l'utlilisateur possède le projet OU si l'utlilisateur est Modérateur*}
|
||||||
|
{if ($image.image_status == 'approuvé') ||
|
||||||
|
(isset($smarty.session.user) && $smarty.session.user.user_status == 2) ||
|
||||||
|
(isset($smarty.session.user) && $smarty.session.user.user_id == $objProject->getUser_id())}
|
||||||
|
|
||||||
|
<div class="col-md-4 mb-4">
|
||||||
|
<div class="card {if $image.image_status != 'approuvé'}border-warning shadow-none opacity-75{/if}">
|
||||||
|
|
||||||
|
<img src="{$smarty.env.IMG_PROJECT_PATH}{$image.image_name}" class="card-img-top" alt="{$image.image_alt}">
|
||||||
|
|
||||||
|
{* Visible uniquement par le modérateur *}
|
||||||
|
{if isset($smarty.session.user.user_status) && $smarty.session.user.user_status == 2}
|
||||||
|
<div class="moderator-tools border-top pt-2 mt-2">
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<a href="index.php?ctrl=project&action=change_image_status&id_img={$image.image_id}&status=approuvé"
|
||||||
|
class="btn btn-sm btn-success">Valider</a>
|
||||||
|
|
||||||
|
<a href="index.php?ctrl=project&action=delete_image&id_img={$image.image_id}"
|
||||||
|
class="btn btn-sm btn-outline-danger"
|
||||||
|
onclick="return confirm('Supprimer définitivement ?')">Supprimer</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{foreachelse}
|
||||||
|
<p>Aucune image disponible pour ce projet.</p>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<!-- Formulaire qui envoie la demande au contrôleur (shareProject) -->
|
<!-- Formulaire qui envoie la demande au contrôleur (shareProject) -->
|
||||||
<div class="card shadow-sm p-4 mb-5">
|
<div class="card shadow-sm p-4 mb-5">
|
||||||
<form method="post" action="index.php?ctrl=project&action=shareProject">
|
<form method="post" action="index.php?ctrl=project&action=shareProject">
|
||||||
|
|
@ -67,7 +107,6 @@
|
||||||
|
|
||||||
<p class="text-muted small">
|
<p class="text-muted small">
|
||||||
Publié le {$objProject->getCreation_date()}
|
Publié le {$objProject->getCreation_date()}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button class="btn btn-primary">Contacter le talent</button>
|
<button class="btn btn-primary">Contacter le talent</button>
|
||||||
|
|
@ -97,7 +136,6 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
|
||||||