From e4574d7ff4035601b06c8ea438a0a214ee3e295b Mon Sep 17 00:00:00 2001
From: Theo
Date: Thu, 18 Jan 2024 11:57:40 +0100
Subject: [PATCH] derniers details
---
Class/class.newFiche.php | 9 +++++----
controleurs/c_nouvelleFiche.php | 10 +++++++++-
include/menu.php | 4 ++--
vues/v_newFiche.php | 5 +++++
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/Class/class.newFiche.php b/Class/class.newFiche.php
index 9fdf76c..03cbab4 100644
--- a/Class/class.newFiche.php
+++ b/Class/class.newFiche.php
@@ -109,18 +109,19 @@ class Class_newFiche
/**
* 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"
- WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois ;';
+ WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois;';
$result = $this->pdo->prepare($req);
$result->bindParam(':idVisiteur', $this->userId);
$result->bindParam(':mois', $this->month);
$result->execute();
- return $result->fetch()['eId'];
+ return $result->fetch();
}
/**
diff --git a/controleurs/c_nouvelleFiche.php b/controleurs/c_nouvelleFiche.php
index bc376a8..9e1760a 100644
--- a/controleurs/c_nouvelleFiche.php
+++ b/controleurs/c_nouvelleFiche.php
@@ -81,6 +81,14 @@ $totalFraisFiche = $newFiche->getMontantValide();
* ETAT DE LA FICHE
*/
$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');
diff --git a/include/menu.php b/include/menu.php
index 72efa41..da1f506 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -64,12 +64,12 @@
diff --git a/vues/v_newFiche.php b/vues/v_newFiche.php
index 247b0c0..237b2a9 100644
--- a/vues/v_newFiche.php
+++ b/vues/v_newFiche.php
@@ -8,6 +8,11 @@
ID:
= $userId . '-' . $date ?>
+
+ Status:
+ = $status['eLibelle'] ?>
+
+