Correction affichage recherche, maj bouton, suppression requêtes de controller, déplacer mention et about dans page_controller, nettoyage des commentaires pour ctrl, entities & models
This commit is contained in:
parent
8c89a6ec1b
commit
050c804d48
20 changed files with 244 additions and 282 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/**
|
||||
* Traitement des requêtes pour les projets
|
||||
* @author : Laura
|
||||
* @author Laura & Guillaume
|
||||
*/
|
||||
|
||||
class ProjectModel extends Connect{
|
||||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
$strAnd = " AND ";
|
||||
|
||||
// Recherche par mot clé avec quote pour éviter bug du '
|
||||
if ($strKeywords != '') {
|
||||
|
||||
$strSafeKeywords = $this->_db->quote("%" . $strKeywords . "%");
|
||||
|
|
@ -39,24 +38,17 @@
|
|||
OR project_content LIKE ".$strSafeKeywords.") ";
|
||||
|
||||
}
|
||||
|
||||
// Recherche par auteur
|
||||
|
||||
if ($intAuthor > 0){
|
||||
$strRq .= $strAnd." user_id = ".$intAuthor;
|
||||
|
||||
}
|
||||
|
||||
// Recherche par catégorie
|
||||
if ($intCategory > 0){
|
||||
$strRq .= $strAnd." project_category = ".$intCategory;
|
||||
}
|
||||
|
||||
//recherche par ancienneté
|
||||
if ($boolOlderThan6Months === true) {
|
||||
$strRq .= $strAnd . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) ";
|
||||
}
|
||||
|
||||
// Recherche par dates
|
||||
if ($intPeriod == 0){
|
||||
if ($strDate != ''){
|
||||
$strRq .= $strAnd." project_creation_date = '".$strDate."'";
|
||||
|
|
@ -103,12 +95,9 @@
|
|||
$rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR);
|
||||
$rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR);
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
|
|
@ -291,11 +280,10 @@
|
|||
|
||||
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
|
||||
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
|
||||
// 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);
|
||||
|
||||
return $rqPrep->execute();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue