partie front et recup data (newFiche)
This commit is contained in:
@@ -12,30 +12,46 @@ class Class_newFiche
|
||||
|
||||
public function listFraisForfaitaires(): array
|
||||
{
|
||||
$req = 'SELECT "fLibelle", round("fMontant", 2) AS "fMontant", "fId" FROM forfait';
|
||||
$req = 'SELECT "fLibelle", NULL AS "lfQuantite", round("fMontant", 2) AS "fMontant", 0 AS "fTotal", "fId" FROM forfait';
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->execute();
|
||||
|
||||
return $result->fetchAll();
|
||||
}
|
||||
|
||||
public function listFraisHF():array
|
||||
public function listFraisForfaitForU(string $idUser, int $month): array
|
||||
{
|
||||
//
|
||||
$req = 'SELECT "fLibelle", "lfQuantite", ROUND("fMontant", 2) AS "fMontant", ROUND("lfQuantite" * "fMontant", 2) AS "fTotal", "fId"
|
||||
FROM remboursement
|
||||
INNER JOIN "ligne_forfait" ON "rVisiteur" = "lfVisiteur" AND "rMois" = "lfMois"
|
||||
INNER JOIN "forfait" ON "fId" = "lfForfait"
|
||||
WHERE "rVisiteur" = :idUser AND "rMois" = :monthF;';
|
||||
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam('idUser', $idUser);
|
||||
$result->bindParam('monthF', $month);
|
||||
$result->execute();
|
||||
|
||||
return $result->fetchAll();
|
||||
}
|
||||
|
||||
public function endInter(string $id)
|
||||
public function listFraisHF(string $idVisiteur, int $month): array
|
||||
{
|
||||
$req = "UPDATE intervention
|
||||
SET iHeureFin = NOW()
|
||||
WHERE iCis = :cis AND iId = :idInter AND iHeureFin IS NULL";
|
||||
$req = 'SELECT to_char("lhDate", \'YYYY-mm-dd\') AS "lhDate",
|
||||
"lhLibelle", ROUND("lhMontant",2) as "lhMontant",
|
||||
"lhJustificatif", "lhRefus"
|
||||
FROM remboursement
|
||||
inner join "ligne_hors_forfait" on "rVisiteur" = "lhVisiteur"
|
||||
AND "rMois" = "lhMois"
|
||||
|
||||
WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois
|
||||
ORDER BY "lhDate";';
|
||||
|
||||
$cis = explode('-', $id)[0];
|
||||
$idInter = explode('-', $id)[1];
|
||||
|
||||
$result = PdoBD::$monPdo->prepare($req);
|
||||
$result->bindParam(':cis', $cis);
|
||||
$result->bindParam(':idInter', $idInter);
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam(':idVisiteur', $idVisiteur);
|
||||
$result->bindParam(':mois', $month);
|
||||
$result->execute();
|
||||
|
||||
return $result->fetchAll();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user