derniers details

This commit is contained in:
Theo 2024-01-18 11:57:40 +01:00
parent db1c54c442
commit e4574d7ff4
4 changed files with 21 additions and 7 deletions

View File

@ -109,18 +109,19 @@ class Class_newFiche
/** /**
* RETOURNE LE STATUS DE LA FICHE * RETOURNE LE STATUS DE LA FICHE
*/ */
public function getStatus(): string public function getStatus(): array
{ {
$req = 'select etat."eId" from remboursement $req = 'SELECT etat."eId" , etat."eLibelle"
from remboursement
INNER JOIN etat on etat."eId" = remboursement."rEtat" INNER JOIN etat on etat."eId" = remboursement."rEtat"
WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois ;'; WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois;';
$result = $this->pdo->prepare($req); $result = $this->pdo->prepare($req);
$result->bindParam(':idVisiteur', $this->userId); $result->bindParam(':idVisiteur', $this->userId);
$result->bindParam(':mois', $this->month); $result->bindParam(':mois', $this->month);
$result->execute(); $result->execute();
return $result->fetch()['eId']; return $result->fetch();
} }
/** /**

View File

@ -81,6 +81,14 @@ $totalFraisFiche = $newFiche->getMontantValide();
* ETAT DE LA FICHE * ETAT DE LA FICHE
*/ */
$status = $newFiche->getStatus(); $status = $newFiche->getStatus();
$disabled = ($status !== 'CR') ? 'disabled' : ''; if (
($status['eId'] == 'CL' && $typeUser == 'comptable')
|| ($status['eId'] == 'CR' && $typeUser == 'visiteur')
){
$disabled = '';
} else {
$disabled = 'disabled';
}
include(__DIR__ . '/../vues/v_newFiche.php'); include(__DIR__ . '/../vues/v_newFiche.php');

View File

@ -64,12 +64,12 @@
<ul class="collapse show nav flex-column ms-1" id="submenu2" data-bs-parent="#menu"> <ul class="collapse show nav flex-column ms-1" id="submenu2" data-bs-parent="#menu">
<li class="w-100"> <li class="w-100">
<a href="index.php?direction=gestionFiche" class="nav-link px-0"> <span <a href="index.php?direction=gestionFiche" class="nav-link px-0"> <span
class="d-none d-sm-inline">A valider</span> class="d-none d-sm-inline">gestion des fiches</span>
</a> </a>
</li> </li>
<li> <li>
<a href="index.php?direction=ficheAvalider" class="nav-link px-0"> <span <a href="index.php?direction=ficheAvalider" class="nav-link px-0"> <span
class="d-none d-sm-inline">fiches a vérifier</span> class="d-none d-sm-inline">fiches à valider</span>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -8,6 +8,11 @@
ID: ID:
<?= $userId . '-' . $date ?> <?= $userId . '-' . $date ?>
</p> </p>
<p class="color-grey" id='idFiche'>
Status:
<?= $status['eLibelle'] ?>
</p>
</center> </center>
<br> <br>
<!-- <!--