Function de validation des fiches et reversement des frais HF

This commit is contained in:
pierre renaudot
2024-01-29 14:06:39 +01:00
parent e4574d7ff4
commit 2819759da7
5 changed files with 76 additions and 4 deletions

View File

@@ -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();
}
}