1 Commits

Author SHA1 Message Date
5b5e5cc28e liste des fraisForfaitaires 2023-12-21 11:54:30 +01:00
8 changed files with 138 additions and 101 deletions

View File

@ -1,21 +0,0 @@
<?php
class Class_gestionFiche
{
private $pdo = null;
public function __construct(PdoGsb $pDO)
{
$this->pdo = $pDO->getPdoGsb();
}
public function getLesUtilisateurs(): array
{
$req = 'SELECT "uId", "uNom", "uPrenom" FROM utilisateur WHERE "uStatut"!=0 ORDER BY "uNom" ASC;';
$result = $this->pdo->prepare($req);
$result ->execute();
return $result->fetchAll();
}
}

View File

@ -10,16 +10,20 @@ class Class_newFiche
$this->pdo = $pDO->getPdoGsb(); $this->pdo = $pDO->getPdoGsb();
} }
public function listFraisForfaitaires(): array public function listFraisForfaitaires(): array
{ {
$req = 'SELECT "fLibelle", "fMontant" FROM forfait'; $req = 'SELECT "fLibelle", round("fMontant", 2) AS "fMontant", "fId" FROM forfait';
$result = $this->pdo->prepare($req); $result = $this->pdo->prepare($req);
$result->execute(); $result->execute();
return $result->fetchAll(); return $result->fetchAll();
} }
public function listFraisHF():array
{
//
}
public function endInter(string $id) public function endInter(string $id)
{ {
$req = "UPDATE intervention $req = "UPDATE intervention

View File

@ -1,9 +1,15 @@
<?php <?php
session_start();
require_once(__DIR__ . '/../Class/class.gestionFiche.php');
$gestionFiche = new Class_gestionFiche($pdo);
$LesUtilisateurs = $gestionFiche->getLesUtilisateurs(); //RENVOIE LISTE USERS
$_SESSION['typeU'] = 'comptable'; $_SESSION['typeU'] = 'comptable';
include("../vues/v_gestionFiches.php"); include("../vues/v_gestionFiches.php");
?>

View File

@ -2,8 +2,6 @@
require_once(__DIR__ . '/../Class/class.newFiche.php'); require_once(__DIR__ . '/../Class/class.newFiche.php');
$newFiche = new Class_newFiche($pdo); $newFiche = new Class_newFiche($pdo);
$liste = $newFiche->listFraisForfaitaires(); $typesFraisForfaitaires = $newFiche->listFraisForfaitaires();
var_dump($liste);
include(__DIR__ . '/../vues/v_newFiche.php'); include(__DIR__ . '/../vues/v_newFiche.php');

View File

@ -21,11 +21,11 @@
</a> </a>
<ul class="collapse show nav flex-column ms-1" id="submenu1" data-bs-parent="#menu"> <ul class="collapse show nav flex-column ms-1" id="submenu1" data-bs-parent="#menu">
<li class="w-100"> <li class="w-100">
<a href="../controleurs/c_gestionFiche.php" class="nav-link px-0"> <span class="d-none d-sm-inline">Gérer ses fiches</span> <a href="index.php?direction=gestionFiche" class="nav-link px-0"> <span class="d-none d-sm-inline">Gérer ses fiches</span>
</a> </a>
</li> </li>
<li> <li>
<a href="../index.php?direction=nouvelleFiche" class="nav-link px-0"> <span class="d-none d-sm-inline">Nouvelle Fiche</span> <a href="index.php?direction=nouvelleFiche" class="nav-link px-0"> <span class="d-none d-sm-inline">Nouvelle Fiche</span>
</a> </a>
</li> </li>
</ul> </ul>
@ -44,7 +44,7 @@
</a> </a>
<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="../controleurs/c_gestionFiche.php" class="nav-link px-0"> <span class="d-none d-sm-inline">A valider</span> <a href="index.php?direction=gestionFiche" class="nav-link px-0"> <span class="d-none d-sm-inline">A valider</span>
</a> </a>
</li> </li>
<li> <li>

View File

@ -53,7 +53,7 @@ if (!isset($_REQUEST['direction'])) {
break; break;
case 'gestionFiche': case 'gestionFiche':
include("controleurs/c_gestionFiche.php"); include(__DIR__ . "/controleurs/c_gestionFiche.php");
break; break;
case 'home': case 'home':

View File

@ -1,63 +1,95 @@
<center> <?php
<div class="col-3 mb-4"> var_dump($_SESSION['test']);
<h3>Gerer mes fiches de frais</h3> ?>
<br> <!DOCTYPE html>
<?php <html lang="en">
if ($_SESSION['typeU'] == 'comptable') {
echo '<select class="form-select" name="selVisiteur" id=""> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page accueil</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid">
<div class="row flex-nowrap">
<?php include('../include/menu.php') ?>
<div class="col py-3">
<center>
<div class="col-3 mb-4">
<h3>Gerer mes fiches de frais</h3>
<br>
<?php
if ($_SESSION['typeU'] == 'comptable') {
echo '<select class="form-select" name="selVisiteur" id="">
<option value="visiteur1">Visiteur 1</option></select>'; <option value="visiteur1">Visiteur 1</option></select>';
} }
?> ?>
</div>
</center>
<div class="col-11 d-flex mx-auto">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Mois</th>
<th scope="col">Total</th>
<th scope="col">Statut</th>
<th scope="col">Détails</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Novembre</th>
<td>351 €</td>
<td>en cours...</td>
<td><a href="#">voir</a></td>
</tr>
<tr>
<th scope="row">Octobre</th>
<td>1458 €</td>
<td>en cours...</td>
<td><a href="#">voir</a></td>
</tr>
<tr>
<th scope="row">Septembre</th>
<td>1112 €</td>
<td>classé</td>
<td><a href="#">voir</a></td>
</tr>
</tbody>
</table>
</div>
<div class="col-4 d-flex mx-auto">
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
<a class="page-link">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item active" aria-current="page">
<a class="page-link" href="#">2</a>
</li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div> </div>
</center>
<div class="col-11 d-flex mx-auto"> </body>
<table class="table table-striped">
<thead> </html>
<tr>
<th scope="col">Mois</th>
<th scope="col">Total</th>
<th scope="col">Statut</th>
<th scope="col">Détails</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Novembre</th>
<td>351 €</td>
<td>en cours...</td>
<td><a href="#">voir</a></td>
</tr>
<tr>
<th scope="row">Octobre</th>
<td>1458 €</td>
<td>en cours...</td>
<td><a href="#">voir</a></td>
</tr>
<tr>
<th scope="row">Septembre</th>
<td>1112 €</td>
<td>classé</td>
<td><a href="#">voir</a></td>
</tr>
</tbody>
</table>
</div>
<div class="col-4 d-flex mx-auto">
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
<a class="page-link">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item active" aria-current="page">
<a class="page-link" href="#">2</a>
</li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>

View File

@ -4,6 +4,9 @@
<p>Mois de Novembre 2023</p> <p>Mois de Novembre 2023</p>
</center> </center>
<br> <br>
<!--
Liste des frais forfaitaires
-->
<h3 class="fw-bold offset-1">Frais forfaitaires</h3> <h3 class="fw-bold offset-1">Frais forfaitaires</h3>
<div class="col-11 d-flex mx-auto my-3"> <div class="col-11 d-flex mx-auto my-3">
<table class="table table-striped-columns align-middle"> <table class="table table-striped-columns align-middle">
@ -16,17 +19,32 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider border-secondary-subtle"> <tbody class="table-group-divider border-secondary-subtle">
<tr> <?php
<th scope="row">Hotel</th> foreach ($typesFraisForfaitaires as $key => $value):
<td><input type="text" class="form-control"></td> ?>
<td>20 </td> <tr>
<td>400</td> <th scope="row">
</tr> <?= $value['fLibelle'] ?>
</th>
<td><input type="text" name="fraisForfait-<?= $value['fId'] ?>" class="form-control"></td>
<td>
<?= $value['fMontant'] ?> €
</td>
<td>0€</td>
</tr>
<?php
endforeach;
?>
</tbody> </tbody>
</table> </table>
</div> </div>
<span class="border-3 border-bottom border-black col-10 mx-auto my-5 d-flex"></span> <span class="border-3 border-bottom border-black col-10 mx-auto my-5 d-flex"></span>
<!--
Listes des frais Hors Forfaits
-->
<h3 class="fw-bold offset-1">Hors forfait</h3> <h3 class="fw-bold offset-1">Hors forfait</h3>
<div class="col-11 d-flex mx-auto my-3"> <div class="col-11 d-flex mx-auto my-3">
<table class="table table-striped-columns align-middle"> <table class="table table-striped-columns align-middle">