modif pompiers pas finis

This commit is contained in:
pierre renaudot
2023-10-05 11:53:36 +02:00
parent 438ab2f077
commit ea3ea7cb5f
7 changed files with 201 additions and 154 deletions

View File

@@ -78,9 +78,31 @@ class PdoBD
*/
public function getInfosPompier($login, $mdp)
{
/*
$req = "SELECT pCis, pId as id, pNom as nom, pPrenom as prenom, pStatut, pMail, pLogin, pMdp, pGrade, pAdresse, pCp, pVille, pBip, pCommentaire,
'la caserne' as cNom, 'adresse' as cAdresse, 'telephone' as cTel, 'le groupement' as cGroupement, 'le grade' as wGrade, 'le statut' as wStatut, 'le type' as wType
FROM pompier";
'la caserne' as cNom, 'adresse' as cAdresse, 'telephone' as cTel, 'le groupement' as cGroupement, 'le grade' as wGrade, 'le statut' as wStatut, 'le type' as wType
FROM pompier";
*/
$req = "SELECT
pCis,
pId as id,
pNom as nom,
pPrenom as prenom,
pStatut, pMail,
pLogin, pMdp,
pAdresse,
pCp, pVille,
pBip, pCommentaire,
a.pLibelle AS wType,
b.pLibelle AS wGrade,
c.pLibelle AS wStatut,
cNom, cAdresse,
cTel, cGroupement
FROM pompier
INNER JOIN caserne ON pompier.pCis = caserne.cId
INNER JOIN parametre AS a ON a.pType = 'typePer' AND pompier.pType = a.pIndice
INNER JOIN parametre AS b ON b.pType = 'grade' AND pompier.pGrade = b.pIndice
INNER JOIN parametre AS c ON c.pType = 'statAgt' AND pompier.pStatut = c.pIndice;";
if ($login === "*") {
$req .= " WHERE pCis=" . $_SESSION['cis'] . " AND pId = $mdp";
} else {
@@ -233,8 +255,8 @@ class PdoBD
$req = "SELECT pId, pNom, pPrenom, DATE_FORMAT(aDateGarde,'%d/%m/%Y') as wDate, aTranche, aDisponibilite, aGarde, d.pValeur as dCouleur
FROM (activite
INNER JOIN parametre t ON t.pType='tranche'AND aTranche=t.pIndice
INNER JOIN parametre d ON d.pType='dispo' AND aDisponibilite=d.pIndice
INNER JOIN parametre t ON t.pType='tranche'AND aTranche = t.pIndice
INNER JOIN parametre d ON d.pType='dispo' AND aDisponibilite = d.pIndice
)
RIGHT OUTER JOIN pompier ON aCis = pCis AND aPompier=pId
WHERE aCis=" . $_SESSION['cis'];