correctif pagination, disabled et maj remboursement
This commit is contained in:
@@ -70,12 +70,13 @@ class Class_gestionFiche
|
||||
public function get_Page(int $nPage, string $idUtilisateur): array
|
||||
{
|
||||
$decalage = ($nPage - 1) * $this::$NB_LIGNES_PAGINATION;
|
||||
|
||||
$req = 'SELECT "rMois", "rVisiteur", "rEtat", ROUND("rMontantValide", 2)
|
||||
as "rMontantValide", "eLibelle"
|
||||
FROM remboursement
|
||||
INNER JOIN etat ON etat."eId"=remboursement."rEtat"
|
||||
WHERE "rVisiteur"= :userId
|
||||
ORDER BY "rDateModif" DESC LIMIT :nbLignes offset :decalage;';
|
||||
ORDER BY "rMois" DESC LIMIT :nbLignes offset :decalage;';
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam('nbLignes', $this::$NB_LIGNES_PAGINATION);
|
||||
$result->bindParam('decalage', $decalage);
|
||||
|
@@ -26,7 +26,27 @@ class Class_user
|
||||
$result->bindParam('login', $login);
|
||||
$result->bindParam('pwd', $password);
|
||||
$result->execute();
|
||||
$result = $result->fetch();
|
||||
|
||||
return $result->fetch();
|
||||
if ($result['pLibelle'] == 'comptable') {
|
||||
$this->updateBdd();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateBdd(): void
|
||||
{
|
||||
$curMonth = date('Ym');
|
||||
$prevMonth = DateTime::createFromFormat('Ym', $curMonth);
|
||||
$prevMonth->modify('first day of last month');
|
||||
|
||||
$prevMonth = $prevMonth->format('Ym');
|
||||
|
||||
$req = 'SELECT updateEtat(:currentMonth, :previousMonth)';
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam('currentMonth', $curMonth);
|
||||
$result->bindParam('previousMonth', $prevMonth);
|
||||
$result->execute();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user