Ajout de la page user fonctionnelle (ctrl, model associé etc) update des liens en display pour fonctionnement. Correction nom fichier project_display
This commit is contained in:
parent
48108f717f
commit
f4d5669e44
16 changed files with 471 additions and 364 deletions
|
|
@ -104,9 +104,9 @@
|
|||
/**
|
||||
* Fonction de recherche d'un seul projet
|
||||
* @param int $intId
|
||||
* @return
|
||||
* @return array
|
||||
*/
|
||||
public function findOne(int $intId) {
|
||||
public function findOne(int $intId) :array{
|
||||
$strRq = "SELECT project.*,
|
||||
CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname',
|
||||
users.user_image,
|
||||
|
|
@ -150,4 +150,26 @@
|
|||
|
||||
return $this->_db->query($strRq);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonction de mise à jour d'un projet en BDD
|
||||
* @param object $objProject L'objet utilisateur
|
||||
* @return bool Est-ce que la requête s'est bien passée
|
||||
*/
|
||||
public function updateProject(object $objProject):bool{
|
||||
|
||||
$strRq = "UPDATE project
|
||||
SET project_title = :title, project_description = :description, project_content = :content
|
||||
WHERE project_id = :id";
|
||||
|
||||
$rqPrep = $this->_db->prepare($strRq);
|
||||
|
||||
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
|
||||
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
|
||||
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
|
||||
|
||||
|
||||
// Executer la requête
|
||||
return $rqPrep->execute();
|
||||
}
|
||||
}
|
||||
|
|
@ -116,5 +116,21 @@
|
|||
$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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue