ça commence doucement

hehehe c b1 de kodé
This commit is contained in:
Yasder5 2026-01-13 22:21:32 +01:00
parent 2255eafc08
commit 28f57e9835
8 changed files with 517 additions and 11 deletions

View file

@ -0,0 +1,72 @@
<?php
require(__DIR__ . '/../../config/database.php');
/**
* Traitement des requêtes pour les project
* @author : Yass
* @version : V0.01
*/
class ProjectModel extends Connect{
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
int $intPeriod=0, string $strDate='', string $strStartDate='',
string $strEndDate=''):array{
// Ecrire la requête
$strRq = "SELECT project.*,
CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname'
FROM project
INNER JOIN users ON user_id = project_user";
// Pour le where (un seul)
//$boolWhere = false; // flag
$strWhere = " WHERE ";
// Recherche par mot clé
if ($strKeywords != '') {
$strRq .= " WHERE (project_title LIKE '%".$strKeywords."%'
OR project_content LIKE '%".$strKeywords."%') ";
//$boolWhere = true;
$strWhere = " AND ";
}
// Recherche par auteur
if ($intAuthor > 0){
/*if ($boolWhere){
$strRq .= " AND ";
}else{
$strRq .= " WHERE ";
}*/
$strRq .= $strWhere." project_creator = ".$intAuthor;
$strWhere = " AND ";
}
// Recherche par dates
if ($intPeriod == 0){
// Par date exacte
if ($strDate != ''){
$strRq .= $strWhere." project_creation_date = '".$strDate."'";
}
}else{
// Par période de dates
if ($strStartDate != '' && $strEndDate != ''){
//if ( ($strStartDate != '') && ($strEndDate != '') ){ Parethèses selon le développeur - pas de changement si que des && - Attention ||
$strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'";
}else{
if ($strStartDate != ''){
// A partir de
$strRq .= $strWhere." project_creation_date >= '".$strStartDate."'";
}else if ($strEndDate != ''){
// Avant le
$strRq .= $strWhere." project_creation_date <= '".$strEndDate."'";
}
}
}
$strRq .= " ORDER BY project_creation_date DESC";
if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit;
}
// Lancer la requête et récupérer les résultats
return $this->_db->query($strRq)->fetchAll();
}
}

View file

@ -0,0 +1,5 @@
<h2>coucou c'est le footer</h2>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
</body>
</html>

View file

@ -0,0 +1,59 @@
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assests/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<title>Folliow</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<!-- Logo -->
<a class="navbar-brand d-flex align-items-center" href="#">
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
</a>
<!-- Toggler pour mobile -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Menu de navigation -->
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="#">Découvrir</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Customisation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Orientation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">À propos</a>
</li>
</ul>
<!-- Menu secondaire -->
<ul class="navbar-nav ms-auto align-items-center">
<li class="nav-item">
<i class="fas fa-bell notification-bell"></i>
</li>
<li class="nav-item">
<button class="btn btn-login">Se connecter</button>
</li>
<li class="nav-item">
<button class="btn btn-signup">S'inscrire</button>
</li>
</ul>
</div>
</div>
</nav>

23
config/database.php Normal file
View file

@ -0,0 +1,23 @@
<?php
class Connect {
protected $_db;
public function __construct(){
try{
// Connexion à la base de données
$this->_db = new PDO(
"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
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
);
// Pour résoudre les problèmes dencodage
$this->_db->exec("SET CHARACTER SET utf8");
// Configuration des exceptions
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException$e) {
echo "Échec : " . $e->getMessage();
}
}
}

253
database/database.sql Normal file
View file

@ -0,0 +1,253 @@
CREATE DATABASE IF NOT EXISTS `projet_folliow`
DEFAULT CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
USE `projet_folliow`;
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: projet_folliow
-- ------------------------------------------------------
-- Server version 10.11.14-MariaDB-0+deb12u2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `authorisation`
--
DROP TABLE IF EXISTS `authorisation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `authorisation` (
`authorisation_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique des autorisations',
`authorisation_name` varchar(30) NOT NULL COMMENT 'Administrateur, modérateur, utilisateur',
PRIMARY KEY (`authorisation_id`),
UNIQUE KEY `uk_authorisation_name` (`authorisation_name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `authorisation`
--
LOCK TABLES `authorisation` WRITE;
/*!40000 ALTER TABLE `authorisation` DISABLE KEYS */;
INSERT INTO `authorisation` VALUES
(1,'Administrateur'),
(2,'Modérateur'),
(3,'Utilisateur');
/*!40000 ALTER TABLE `authorisation` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `category` (
`category_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique des catégorie du projet',
`category_name` varchar(150) NOT NULL COMMENT 'Nom de chaque catégorie',
`category_parent` int(10) unsigned DEFAULT NULL COMMENT 'ID de la catégorie parente (NULL = catégorie principale)',
PRIMARY KEY (`category_id`),
UNIQUE KEY `uk_category_name_parent` (`category_name`,`category_parent`),
KEY `fk_category_parent` (`category_parent`),
CONSTRAINT `fk_category_parent` FOREIGN KEY (`category_parent`) REFERENCES `category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `category`
--
LOCK TABLES `category` WRITE;
/*!40000 ALTER TABLE `category` DISABLE KEYS */;
INSERT INTO `category` VALUES
(32,'3D',4),
(34,'Aquarelle',4),
(5,'Architecture',NULL),
(36,'Architecture d\'Intérieur',5),
(35,'Architecture Moderne',5),
(24,'Backend',2),
(33,'Bande Dessinée',4),
(1,'Design',NULL),
(2,'Développement Web',NULL),
(31,'Digital Art',4),
(30,'Événementiel',3),
(23,'Frontend',2),
(25,'Full-Stack',2),
(4,'Illustration',NULL),
(20,'Logo & Identité Visuelle',1),
(39,'Marketing',NULL),
(46,'Marketing',NULL),
(26,'Mobile',2),
(21,'Motion Design',1),
(38,'Patrimoine',5),
(28,'Paysage',3),
(3,'Photographie',NULL),
(27,'Portrait',3),
(22,'Print Design',1),
(40,'Rédaction',NULL),
(47,'Rédaction',NULL),
(29,'Sport',3),
(19,'UI/UX Design',1),
(37,'Urbanisme',5),
(41,'Vidéo',NULL),
(48,'Vidéo',NULL);
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `image`
--
DROP TABLE IF EXISTS `image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `image` (
`image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'identifiant unique des images',
`image_name` varchar(150) NOT NULL COMMENT 'Chemin de l''image enregistrée',
`image_alt` varchar(255) DEFAULT NULL COMMENT 'Alt de l''image',
`image_status` varchar(50) NOT NULL DEFAULT 'en_attente' COMMENT 'Statut de modération de l''image',
`image_project` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant du projet où se trouve l''image',
PRIMARY KEY (`image_id`),
KEY `fk_image_project` (`image_project`),
CONSTRAINT `fk_image_project` FOREIGN KEY (`image_project`) REFERENCES `project` (`project_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `chk_image_status` CHECK (`image_status` in ('en_attente','approuvé','rejeté'))
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `image`
--
LOCK TABLES `image` WRITE;
/*!40000 ALTER TABLE `image` DISABLE KEYS */;
INSERT INTO `image` VALUES
(1,'/uploads/projects/ecommerce-01.jpg','Page d\'accueil du site e-commerce refondu','approuvé',1),
(2,'/uploads/projects/ecommerce-02.jpg','Interface mobile du processus de commande','approuvé',1),
(3,'/uploads/projects/taskmanager-01.jpg','Vue kanban de l\'application','approuvé',2),
(4,'/uploads/projects/urban-01.jpg','Architecture moderne à La Défense','en_attente',3);
/*!40000 ALTER TABLE `image` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `project`
--
DROP TABLE IF EXISTS `project`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `project` (
`project_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique du projet',
`project_title` varchar(150) NOT NULL COMMENT 'Titre du projet',
`project_description` text DEFAULT NULL COMMENT 'Description du projet',
`project_thumbnail` varchar(150) DEFAULT NULL COMMENT 'Image miniature du projet',
`project_content` text DEFAULT NULL COMMENT 'Contenu du projet',
`project_creation_date` date NOT NULL COMMENT 'Date de création du projet',
`project_status` varchar(30) NOT NULL DEFAULT 'brouillon' COMMENT 'Statut du projet : brouillon, publié, en_attente',
`project_user` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant de l''user',
`project_category` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant de la catégorie',
PRIMARY KEY (`project_id`),
KEY `fk_project_user` (`project_user`),
KEY `fk_project_category` (`project_category`),
KEY `idx_project_status` (`project_status`),
KEY `idx_project_creation_date` (`project_creation_date`),
CONSTRAINT `fk_project_category`
FOREIGN KEY (`project_category`)
REFERENCES `category` (`category_id`)
ON DELETE SET NULL
ON UPDATE CASCADE,
CONSTRAINT `fk_project_user`
FOREIGN KEY (`project_user`)
REFERENCES `users` (`user_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `project`
--
LOCK TABLES `project` WRITE;
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
INSERT INTO `project` VALUES
(1,'Refonte du site e-commerce','Refonte complète de l\'interface utilisateur d\'une boutique en ligne avec focus sur l\'expérience mobile','/uploads/projects/ecommerce-thumb.jpg','Ce projet visait à moderniser entièrement l\'interface d\'un site e-commerce existant. Les principales améliorations incluent une navigation simplifiée, un processus de commande optimisé et une interface responsive.','2025-12-01','publié',1,1),
(2,'Application de gestion de tâches','Développement d\'une application web pour la gestion collaborative de projets','/uploads/projects/taskmanager-thumb.jpg','Application web développée en React et Node.js permettant aux équipes de gérer leurs projets de manière collaborative. Fonctionnalités : kanban, calendrier, notifications en temps réel.','2025-12-15','publié',2,2),
(3,'Série photo urbaine','Collection de photographies capturant l\'architecture moderne de Paris','/uploads/projects/urban-thumb.jpg','Série de 30 photographies prises dans différents quartiers de Paris, mettant en valeur le contraste entre architecture classique et moderne. Travail sur la lumière naturelle et les perspectives.','2026-01-05','en_attente',3,3);
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique de l''utilisateur',
`user_name` varchar(100) NOT NULL COMMENT 'Nom de l''utilisateur',
`user_firstname` varchar(100) NOT NULL COMMENT 'Prénom de l''utilisateur',
`user_pseudo` varchar(30) NOT NULL COMMENT 'Pseudo de l''utilisateur',
`user_image` varchar(150) DEFAULT NULL COMMENT 'Photo de profil de l''utilisateur',
`user_mail` varchar(100) NOT NULL COMMENT 'Mail de l''utilisateur',
`user_password` varchar(255) NOT NULL COMMENT 'Mot de passe de l''utilisateur',
`user_phone` varchar(20) DEFAULT NULL COMMENT 'Téléphone de l''utilisateur',
`user_work` varchar(50) DEFAULT NULL COMMENT 'Profession de l''utilisateur',
`user_birth` date DEFAULT NULL COMMENT 'Date de naissance de l''utilisateur',
`user_location` varchar(150) DEFAULT NULL COMMENT 'Localisation de l''utilisateur',
`user_description` varchar(255) DEFAULT NULL COMMENT 'Phrase d''accroche de l''utilisateur',
`user_account_creation` datetime NOT NULL DEFAULT current_timestamp() COMMENT 'Date et heure de création du compte',
`user_status` int(10) unsigned DEFAULT NULL COMMENT 'identifiant de niveau d''autorisation',
PRIMARY KEY (`user_id`),
UNIQUE KEY `uk_user_mail` (`user_mail`),
UNIQUE KEY `uk_user_pseudo` (`user_pseudo`),
KEY `fk_users_authorisation` (`user_status`),
KEY `idx_user_mail` (`user_mail`),
CONSTRAINT `fk_users_authorisation` FOREIGN KEY (`user_status`) REFERENCES `authorisation` (`authorisation_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES
(1,'Dupont','Marie','marie_design','/uploads/users/marie.jpg','marie.dupont@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0612345678','Designer UI/UX','1995-03-15','Paris, France','Passionnée de design et d\'expérience utilisateur','2024-01-15 10:30:00',1),
(2,'Martin','Thomas','thomas_dev','/uploads/users/thomas.jpg','thomas.martin@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0623456789','Développeur Full-Stack','1992-07-22','Lyon, France','Créateur d\'applications web modernes','2024-02-20 14:45:00',2),
(3,'Dubois','Sophie','sophie_photo','/uploads/users/sophie.jpg','sophie.dubois@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0634567890','Photographe','1998-11-08','Marseille, France','Capturer l\'instant présent est ma passion','2024-03-10 09:15:00',3);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2026-01-09 17:33:08

View file

@ -0,0 +1,75 @@
body {
background-color: #f5f5f5;
}
.navbar {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
padding: 0.8rem 2rem;
}
.navbar-brand {
font-size: 1.5rem;
font-weight: bold;
color: #0d6efd !important;
}
.navbar-brand span {
color: #6c757d;
}
.navbar-nav .nav-link {
color: #333;
font-weight: 500;
padding: 0.5rem 1rem;
margin: 0 0.2rem;
transition: color 0.3s;
}
.navbar-nav .nav-link:hover {
color: #0d6efd;
}
.btn-login {
color: #333;
background-color: transparent;
border: none;
font-weight: 500;
padding: 0.5rem 1rem;
}
.btn-login:hover {
color: #0d6efd;
}
.btn-signup {
background-color: #0d6efd;
color: white;
border: none;
border-radius: 25px;
padding: 0.5rem 2rem;
font-weight: 500;
transition: background-color 0.3s;
}
.btn-signup:hover {
background-color: #0b5ed7;
}
.notification-bell {
font-size: 1.2rem;
color: #6c757d;
margin-right: 1rem;
cursor: pointer;
transition: color 0.3s;
}
.notification-bell:hover {
color: #0d6efd;
}
.logo-image {
height: 30px;
width: auto;
margin-right: 0.5rem;
}

BIN
public/assests/img/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View file

@ -1,11 +1,30 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
COUCOU
</body>
</html>
<?php
require_once '../app/views/partials/header.php' ;
require "../app/models/project_model.php";
$objProjectModel = new ProjectModel;
$arrArticle = $objProjectModel->findAll(4);
var_dump($arrArticle);
?>
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
<h1>Folliow</h1>
<h2> 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 aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">
</section>
<?php
require_once '../app/views/partials/footer.php' ;