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.
-_arrData['arrError'] = $arrError;
-
-
-
$this->_display("login");
-
}
@@ -125,7 +123,6 @@ class UserCtrl extends MotherCtrl {
// Si pas d'erreurs => insertion
if (count($arrError) === 0) {
$objUserModel = new UserModel();
- $boolInsert = $objUserModel->insert($objUser);
if ($objUserModel->mailExists($objUser->getMail())) {
@@ -145,9 +142,47 @@ class UserCtrl extends MotherCtrl {
}
// Affichage de la vue inscription
+ $this->_arrData["arrError"] = $arrError;
$this->_display("inscription");
}
+ /**
+ * le controlleur affichage de la page user
+ */
+ public function user(){
+ $intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
+ if ($intId <= 0) {
+ header("Location:index.php");
+ exit;
+ }
+
+ //affichage info utilisateur
+ $objUserModel = new UserModel;
+ $arrUserData = $objUserModel->findUserById($intId);
+
+ if ($arrUserData === false) {
+ header("Location:index.php");
+ exit;
+ }
+ $objUser = new User;
+ $objUser->hydrate($arrUserData);
+
+ //affichage projet de l'utilisateur
+ $objProjectModel = new ProjectModel;
+ $arrProjects = $objProjectModel->findAll(0,'',$intId);
+
+ $arrProjectToDisplay = array();
+ foreach($arrProjects as $projectData) {
+ $objProject = new Project();
+ $objProject->hydrate($projectData);
+ $arrProjectToDisplay[] = $objProject;
+ }
+
+ $this->_arrData['user'] = $objUser;
+ $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
+ $this->_display("user");
+ }
+
}
diff --git a/entities/authorisation_entity.php b/entities/authorisation_entity.php
new file mode 100644
index 0000000..d072d01
--- /dev/null
+++ b/entities/authorisation_entity.php
@@ -0,0 +1,28 @@
+_prefix = 'authorisation_';
+ }
+
+ public function getId():int{
+ return $this->_id;
+ }
+ public function setId(int $id){
+ $this->_id = $id;
+ }
+
+ public function getName():string{
+ return $this->_name;
+ }
+
+ public function setName(string $name){
+ $this->_name = $name;
+ }
+
+ }
\ No newline at end of file
diff --git a/entities/image_entity.php b/entities/image_entity.php
index b919d67..29588a1 100644
--- a/entities/image_entity.php
+++ b/entities/image_entity.php
@@ -2,11 +2,11 @@
require_once("mother_entity.php");
-/**
- * Classe d'un objet Projet
- * @author Laura
- */
+ /**
+ * Classe d'un objet Projet
+ * @author Laura
+ */
class Image extends Entity{
private int $_id;
diff --git a/entities/project_entity.php b/entities/project_entity.php
index ab9047e..83fadf3 100644
--- a/entities/project_entity.php
+++ b/entities/project_entity.php
@@ -7,13 +7,13 @@ require_once("mother_entity.php");
class Project extends Entity{
- private int $_id;
- private string $_title;
- private string $_description;
- private string $_thumbnail;
- private string $_content;
+ private ?int $_id = null;
+ private string $_title = "";
+ private string $_description = "";
+ private ?string $_thumbnail = null;
+ private string $_content = "";
private string $_creation_date;
- private string $_status;
+ private string $_status = "en_attente";
private int $_user;
private int $_category;
private string $_creatorname;
@@ -33,7 +33,7 @@ class Project extends Entity{
* Récuperation de l'id du Projet
* @return int l'id du projet
*/
- public function getId():int{
+ public function getId():?int{
return $this->_id;
}
@@ -110,7 +110,6 @@ class Project extends Entity{
$this->_content = $content;
}
-
/**
* Récupération de la date de création
* @param string lang de formatage de la date (par défaut = "fr_FR")
@@ -157,7 +156,7 @@ class Project extends Entity{
* Récupération de l'utilisateur
* @return int id de l'utilisateur
*/
- public function getUser(){
+ public function getUser_id(){
return $this->_user;
}
@@ -165,7 +164,7 @@ class Project extends Entity{
* Mise à jour de l'utilisateur
* @param int id de l'utilisateur
*/
- public function setUser($user){
+ public function setUser_id($user){
$this->_user = $user;
}
@@ -173,7 +172,7 @@ class Project extends Entity{
* Récupération de la catégorie
* @return int id de la catégorie
*/
- public function getCategory(){
+ public function getCategory():?int{
return $this->_category;
}
@@ -200,6 +199,7 @@ class Project extends Entity{
public function setCreatorName($creatorname){
$this->_creatorname = $creatorname;
}
+
/**
* Récupération du chemin photo profil
* @return string nom du chemin photo profil
diff --git a/entities/user_entity.php b/entities/user_entity.php
index 0d4a9e8..a034835 100644
--- a/entities/user_entity.php
+++ b/entities/user_entity.php
@@ -6,12 +6,12 @@
private string $_name = '';
private string $_firstname = '';
private string $_pseudo = '';
- private string $_image = '';
+ private ?string $_image = null;
private string $_mail = '';
private string $_pwd;
private string $_phone = '';
private string $_work = '';
- private string $_birth = '';
+ private ?string $_birth = null;
private string $_location = '';
private string $_description = '';
private string $_account_creation = '';
@@ -49,10 +49,10 @@
$this->_pseudo = $pseudo;
}
- public function getImage():string{
+ public function getImage():?string{
return $this->_image;
}
- public function setImage(string $image){
+ public function setImage(?string $image){
$this->_image = $image;
}
@@ -87,10 +87,10 @@
$this->_work = $work;
}
- public function getBirth():string{
+ public function getBirth():?string{
return $this->_birth;
}
- public function setBirth(string $birth){
+ public function setBirth(?string $birth){
$this->_birth = $birth;
}
diff --git a/env b/env
new file mode 100644
index 0000000..af95f41
--- /dev/null
+++ b/env
@@ -0,0 +1,7 @@
+# config BDD
+
+DB_CONNECTION=mysql
+DB_HOSTNAME=boulayoune.com
+DB_DATABASE=projet_folliow
+DB_USERNAME=
+DB_PASSWORD=
\ No newline at end of file
diff --git a/index.php b/index.php
index f7890b4..ae6424c 100644
--- a/index.php
+++ b/index.php
@@ -2,9 +2,13 @@
session_start();
require("./vendor/autoload.php");
+
+ //environnement
+ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
+ $dotenv->safeLoad();
+
$strCtrl = $_GET['ctrl']??'project';
$strMethod = $_GET['action']??'home';
- $intId = $_GET['id']??null;
$boolError = false;
$strFileName = "./controllers/".$strCtrl."_controller.php";
diff --git a/models/authorisation_model.php b/models/authorisation_model.php
new file mode 100644
index 0000000..010660b
--- /dev/null
+++ b/models/authorisation_model.php
@@ -0,0 +1,28 @@
+_db->query($strRq)->fetchAll();
+ }
+
+ }
\ No newline at end of file
diff --git a/models/category_model.php b/models/category_model.php
index 6432a9a..6c48379 100644
--- a/models/category_model.php
+++ b/models/category_model.php
@@ -10,6 +10,7 @@
/**
* Fonction de récupération des catégories
+ * @param int $intLimit
* @return array
*/
@@ -27,21 +28,56 @@
/**
* fonction d'insertion d'une nouvelle catégorie dans la bdd
- * @param object $objUser L'objet utilisateur
- * @return bool Est-ce que la requête s'est bien passée (true/false)
+ * @param object $objCategory l'objet catégorie
+ * @return bool Est-ce que la requête s'est bien passée
*/
+ public function insertCategory(object $objCategory):bool{
- public function insert(object $objCategory):bool{
-
- $strRq = "INSERT INTO category (category_name, category_parent)
- VALUES (:name, :parent)";
+ $strRq = "INSERT INTO category (category_name)
+ VALUES (:name)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
- $rqPrep->bindValue(":parent", $objCategory->getParent(), PDO::PARAM_STR);
return $rqPrep->execute();
}
- }
\ No newline at end of file
+
+ /**
+ * fonction de suppression d'une catégorie dans la bdd
+ * @param object $objCategory l'objet catégorie
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function deleteCategory(object $objCategory):bool{
+
+ $strRq = "DELETE FROM category
+ WHERE category_id= :id";
+
+ $rqPrep = $this->_db->prepare($strRq);
+
+ $rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
+
+ return $rqPrep->execute();
+ }
+
+ /**
+ * fonction de modification d'une catégorie dans la bdd
+ * @param object $objCategory l'objet catégorie
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function editCategory(object $objCategory):bool{
+
+ $strRq = "UPDATE category
+ SET category_name = :name
+ WHERE category_id = :id";
+
+ $rqPrep = $this->_db->prepare($strRq);
+
+ $rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
+ $rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
+
+ return $rqPrep->execute();
+ }
+ }
+
\ No newline at end of file
diff --git a/models/image_model.php b/models/image_model.php
index 2511f06..39e8158 100644
--- a/models/image_model.php
+++ b/models/image_model.php
@@ -11,6 +11,7 @@
/**
* Fonction de récupération des images
+ * @param int $intLimit
* @return array
*/
diff --git a/models/mother_model.php b/models/mother_model.php
index c259719..59eea4f 100644
--- a/models/mother_model.php
+++ b/models/mother_model.php
@@ -7,9 +7,9 @@
try{
// Connexion à la base de données
$this->_db = new PDO(
- "mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
- "projet_user", //Nom d'utilisateur de la base de données
- "F0lliowRules!",// Mot de passe de la base de données
+ "mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD "mysql:host=localhost;dbname=projet_folliow",
+ "projet_user", //Nom d'utilisateur de la base de données root
+ "F0lliowRules!",// 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 d’encodage
@@ -20,4 +20,17 @@
echo "Échec : " . $e->getMessage();
}
}
- }
\ No newline at end of file
+ }
+
+ /**
+ Pour passer sur le serveur de YASS:
+ *"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
+ "projet_user", //Nom d'utilisateur de la base de données
+ "F0lliowRules!",// Mot de passe de la base de données
+ Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
+
+ Pour passer en local:
+ "mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
+ "root", //Nom d'utilisateur de la base de données
+ "",// Mot de passe de la base de données
+ */
\ No newline at end of file
diff --git a/models/project_model.php b/models/project_model.php
index d88e02d..4cf0d90 100644
--- a/models/project_model.php
+++ b/models/project_model.php
@@ -8,23 +8,32 @@
*/
class ProjectModel extends Connect{
-
+
+
+ /**
+ * Fonction de recherche des projets
+ * @param type string, int et bool
+ * @return array
+ */
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
int $intPeriod=0, string $strDate='', string $strStartDate='',
- string $strEndDate='', int $intCategory=0):array{
+ string $strEndDate='', int $intCategory=0, bool $bool6Months=false):array{
- // Ecrire la requête
$strRq = "SELECT project.*,
CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname',
user_image
FROM project
- INNER JOIN users ON user_id = project_user";
+ INNER JOIN users ON user_id = project_user_id";
$strWhere = " WHERE ";
- // Recherche par mot clé
+
+ // Recherche par mot clé avec quote pour éviter bug du '
if ($strKeywords != '') {
- $strRq .= " WHERE (project_title LIKE '%".$strKeywords."%'
- OR project_content LIKE '%".$strKeywords."%') ";
+
+ $strSafeKeywords = $this->_db->quote("%" . $strKeywords . "%");
+
+ $strRq .= " WHERE (project_title LIKE ".$strSafeKeywords."
+ OR project_content LIKE ".$strSafeKeywords.") ";
//$boolWhere = true;
$strWhere = " AND ";
@@ -41,23 +50,25 @@
$strRq .= $strWhere." project_category = ".$intCategory;
$strWhere = " AND ";
}
+
+ //recherche par ancienneté
+ if ($bool6Months === true) {
+ $strRq .= $strWhere . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) ";
+ $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 != ''){
$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."'";
}
}
@@ -65,44 +76,48 @@
$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();
}
- //Fonction d'insertion d'information dans la BDD (Repris de la partie BLOG vu en cours..)
+ /**
+ * Fonction d'insertion d'un nouveau projet dans la bdd
+ * @param object $objProject l'objet projet
+ * @return bool Est-ce que la requête s'est bien passée
+ */
public function insert(object $objProject):bool{
- //Construire la requête
- $strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date)
- VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()))";
+ $strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date, project_user_id, project_category)
+ VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()), :project_user_id, :project_category)";
- // Préparer la requête
$rqPrep = $this->_db->prepare($strRq);
- // Donne les informations
+
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
$rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
$rqPrep->bindValue(":status", $objProject->getStatus(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR);
- //Executer la requête
- //var_dump($strRq);die;
- //return $db->exec($strRq);
return $rqPrep->execute();
}
- public function findOne(int $intId) {
+ /**
+ * Fonction de recherche d'un seul projet
+ * @param int $intId
+ * @return array
+ */
+ public function findOne(int $intId) :array{
$strRq = "SELECT project.*,
CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname',
users.user_image,
category.category_name
FROM project
- INNER JOIN users ON users.user_id = project.project_user
+ INNER JOIN users ON users.user_id = project.project_user_id
LEFT JOIN category ON category.category_id = project.project_category
WHERE project.project_id = :id";
@@ -112,4 +127,107 @@
return $rqPrep->fetch();
}
+
+ /**
+ * Fonction de changement de status (accepter) d'un projet en BDD
+ * @author Guillaume
+ * @param int $id l'id du projet
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function accept(int $id){
+
+ //SQL pour changer le status en accept
+ $strRq = "UPDATE project
+ SET project_status= 'publié'
+ WHERE project_id =".$id;
+
+ //retourne la commande
+ return $this->_db->query($strRq);
+ }
+
+ /**
+ * Fonction de changement de status (refusé) d'un projet en BDD
+ * @author Guillaume
+ * @param int $id l'id du projet
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function refuse(int $id){
+
+ $strRq = "UPDATE project
+ SET project_status= 'refusé'
+ WHERE project_id =".$id;
+
+ return $this->_db->query($strRq);
+ }
+
+ /**
+ * Fonction de suppression d'un projet en BDD
+ * @author Guillaume
+ * @param int $id l'id du projet
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function delete(int $id){
+
+ $strRq = "DELETE FROM project
+ WHERE project_id =".$id;
+
+ return $this->_db->query($strRq);
+ }
+
+ /**
+ * Fonction de mise à jour d'un projet en BDD
+ * @author Guillaume
+ * @param object $objProject L'objet utilisateur
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function updateProject(object $objProject):bool{
+
+ $strRq = "UPDATE project
+ SET project_title = :title,
+ project_description = :description,
+ project_content = :content,
+ project_thumbnail = :thumbnail
+ WHERE project_id = :id";
+
+ $rqPrep = $this->_db->prepare($strRq);
+
+ $rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":id", $objProject->getId(), PDO::PARAM_INT);
+
+ return $rqPrep->execute();
+ }
+
+ public function getImagesByProjectId(int $projectId): array {
+ $strRq = "SELECT image_id, image_name, image_alt
+ FROM image
+ WHERE image_project = :id AND image_status = 1";
+
+ $rqPrep = $this->_db->prepare($strRq);
+ $rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
+ $rqPrep->execute();
+
+ return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
+ }
+
+ public function addImageInProject(string $fileName, int $projectId, string $alt = "Image 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 brute
+ $rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
+
+ return $rqPrep->execute();
+ }
}
\ No newline at end of file
diff --git a/models/user_model.php b/models/user_model.php
index 72f1ada..baa46dd 100644
--- a/models/user_model.php
+++ b/models/user_model.php
@@ -5,66 +5,58 @@
/**
* Traitement des requêtes pour les utilisateurs
* @author : meilleurGroup
- * @version : V0.5
*/
+
class UserModel extends Connect{
- // Attributs
-
-
- // Méthodes
+
public function __construct(){
parent::__construct();
}
/**
+ * Fonction de recherche des utilisateurs et leur niveau d'autorisation
* @return array
*/
public function findAllUsers():array{
- // Ecrire la requête
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name
- FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status";
- // Lancer la requête et récupérer les résultats
+ FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
+ WHERE user_deleted_at IS NULL";
return $this->_db->query($strRq)->fetchAll();
}
/**
+ * Fonction de vérification des utilisateurs
* @param string $strMail
* @param string $strPwd
* @return array|bool
*/
public function verifUser(string $strMail, string $strPwd):array|bool{
- // 2. Construire la requête
+
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_mail = '".$strMail."'";
- // Récupère mon utilisateur
- // Executer la requête et récupérer les résultats
+
$arrUser = $this->_db->query($strRq)->fetch();
- // Vérification du mot de passe haché
if (password_verify($strPwd, $arrUser['user_password'])){
- // Renvoi l'utilisateur
- unset($arrUser['user_password']); // on enlève le pwd
+ unset($arrUser['user_password']);
return $arrUser;
}else{
return false;
}
}
- //public function insert(string $strName, string $strFirstname, string $strMail, string $strPwd):int{
/**
* Fonction d'insertion d'un utilisateur en BDD
* @param object $objUser L'objet utilisateur
- * @return bool Est-ce que la requête s'est bien passée (true/false)
+ * @return bool Est-ce que la requête s'est bien passée
*/
public function insert(object $objUser):bool{
-
- // 2. Construire la requête
$strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description)
VALUES (:name, :firstname, :pseudo,:mail, :pwd, :phone, :work, :location,:description)";
- // Préparer la requête
+
$rqPrep = $this->_db->prepare($strRq);
- // Donne les informations
+
$rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
$rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
$rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR);
@@ -75,19 +67,70 @@
$rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR);
-
-
- // 3. Executer la requête
- //var_dump($strRq);die;
- //return $db->exec($strRq);
return $rqPrep->execute();
}
- public function mailExists(string $mail): bool
- {
+
+ /**
+ * Fonction de vérification de mail
+ * @param string $mail
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function mailExists(string $mail): bool{
+
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_mail = :mail LIMIT 1");
$rq->bindValue(":mail", $mail);
$rq->execute();
return (bool)$rq->fetchColumn();
}
+
+ /**
+ * Fonction de changement de status d'un utilisateur
+ * @param object $objUser L'objet utilisateur
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+
+ public function editStatus(object $objUser):bool{
+
+ $strRq = "UPDATE users
+ SET user_status = :status
+ WHERE user_id = :id";
+
+ $rqPrep = $this->_db->prepare($strRq);
+ $rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT);
+ $rqPrep->bindValue(":status", $objUser->getStatus(), PDO::PARAM_INT);
+ return $rqPrep->execute();
+ }
+
+ /**
+ * Fonction permettant de supprimer un utilisateur avec une date de suppression
+ * @param int $intId L'identifiant de l'utilisateur
+ * @return bool Est-ce que la requête s'est bien passée
+ */
+ public function delete_soft(int $intId):bool{
+
+ $strRq = "UPDATE users
+ SET user_deleted_at = NOW()
+ WHERE user_id = :id";
+
+ $rqPrep = $this->_db->prepare($strRq);
+ $rqPrep->bindValue(":id", $intId, PDO::PARAM_INT);
+ return $rqPrep->execute();
+ }
+
+ /**
+ * Récupère les informations d'un utilisateur par son ID
+ * @param int $intId L'identifiant de l'utilisateur
+ * @return array Tableau associatif (ou false si pas trouvé)
+ */
+ public function findUserById(int $intId): array|bool {
+
+ $strRq = "SELECT * FROM users WHERE user_id = :id";
+
+ $prep = $this->_db->prepare($strRq);
+ $prep->bindValue(':id', $intId, PDO::PARAM_INT);
+ $prep->execute();
+
+ return $prep->fetch();
+ }
}
diff --git a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php
deleted file mode 100644
index 76d88b5..0000000
--- a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php
+++ /dev/null
@@ -1,71 +0,0 @@
-getCompiled()->isFresh($_smarty_tpl, array (
- 'version' => '5.7.0',
- 'unifunc' => 'content_6989b403135214_06797903',
- 'has_nocache_code' => false,
- 'file_dependency' =>
- array (
- '0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68' =>
- array (
- 0 => 'views/home.tpl',
- 1 => 1770579251,
- 2 => 'file',
- ),
- ),
- 'includes' =>
- array (
- 'file:views/_partial/preview.tpl' => 1,
- ),
-))) {
-function content_6989b403135214_06797903 (\Smarty\Template $_smarty_tpl) {
-$_smarty_current_dir = 'D:\\projetphp\\views';
-$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
-?>
-
-
-getInheritance()->instanceBlock($_smarty_tpl, 'Block_8519413186989b403131000_39935260', "content");
-?>
-
-getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
-}
-/* {block "content"} */
-class Block_8519413186989b403131000_39935260 extends \Smarty\Runtime\Block
-{
-public function callBlock(\Smarty\Template $_smarty_tpl) {
-$_smarty_current_dir = 'D:\\projetphp\\views';
-?>
-
-
-
Folliow
-
Là où les talents rencontrent leur avenir
-
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.