Compare commits
17 Commits
v0.0.1c-pr
...
v0.0.1h-tg
Author | SHA1 | Date | |
---|---|---|---|
af3771e786 | |||
8aafdf565b | |||
a2201a4eb3 | |||
89273aced9 | |||
4eac346ff2 | |||
63eddbbc8b | |||
aa49401a47 | |||
fcf292e823 | |||
df7599ab9b | |||
f08b18fab5 | |||
9f245f6578 | |||
85c00fde0a | |||
d279249503 | |||
1db0ab4873 | |||
53179a0a85 | |||
fa1bacb404 | |||
e55df1b480 |
55
Class/class.gestionFiche.php
Normal file
55
Class/class.gestionFiche.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?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();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_ListesFiches(string $idUtilisateur): array
|
||||||
|
{
|
||||||
|
$req = 'SELECT "rMois", "rEtat", "rNbJustificatifs", ROUND("rMontantValide", 2) as "rMontantValide", "eLibelle"
|
||||||
|
FROM remboursement
|
||||||
|
INNER JOIN etat ON etat."eId"=remboursement."rEtat"
|
||||||
|
WHERE "rVisiteur"= :userId
|
||||||
|
ORDER BY "rMois" DESC';
|
||||||
|
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result ->bindParam("userId", $idUtilisateur);
|
||||||
|
$result ->execute();
|
||||||
|
|
||||||
|
return $result->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dateComplete(string $date) : string
|
||||||
|
{
|
||||||
|
return substr($date, 0, 4) . '-' . substr($date, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_ficheAvalider() : array
|
||||||
|
{
|
||||||
|
$req = 'SELECT "rMois", "rVisiteur", "rEtat", ROUND("rMontantValide", 2) as "rMontantValide", "eLibelle", "uNom", "uPrenom"
|
||||||
|
from remboursement
|
||||||
|
INNER JOIN utilisateur ON utilisateur."uId"=remboursement."rVisiteur"
|
||||||
|
INNER JOIN etat ON etat."eId"=remboursement."rEtat"
|
||||||
|
where "rEtat"=\'CL\'
|
||||||
|
ORDER BY "rMois" ASC';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result ->execute();
|
||||||
|
|
||||||
|
return $result->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,41 +1,218 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OBJECT QUI GERE LA PARTIE AFFICHAGE D'UNE FICHE
|
||||||
|
*/
|
||||||
|
|
||||||
class Class_newFiche
|
class Class_newFiche
|
||||||
{
|
{
|
||||||
private $pdo = null;
|
private $pdo = null;
|
||||||
|
private $month;
|
||||||
|
private $userId;
|
||||||
|
|
||||||
|
public function __construct(PdoGsb $pDO, string $userId, string $month)
|
||||||
public function __construct(PdoGsb $pDO)
|
|
||||||
{
|
{
|
||||||
$this->pdo = $pDO->getPdoGsb();
|
$this->pdo = $pDO->getPdoGsb();
|
||||||
|
$this->month = $month;
|
||||||
|
$this->userId = $userId;
|
||||||
|
|
||||||
|
$this->existingFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test et ajoute la fiche si elle n'existe pas dans remboursement
|
||||||
|
* et les ligneForfaitaires nulles liées
|
||||||
|
*/
|
||||||
|
private function existingFile(): void
|
||||||
|
{
|
||||||
|
$req = 'SELECT newremboursement(:idUser, :month); ';
|
||||||
|
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->bindParam('idUser', $this->userId);
|
||||||
|
$result->bindParam('month', $this->month);
|
||||||
|
$result->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste les frais forfaitaires
|
||||||
|
*/
|
||||||
public function listFraisForfaitaires(): array
|
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 = $this->pdo->prepare($req);
|
||||||
$result->execute();
|
$result->execute();
|
||||||
|
|
||||||
return $result->fetchAll();
|
return $result->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste les frais Forfetaires d'un user pour 1 mois
|
||||||
|
*/
|
||||||
|
public function listFraisForfaitForU(): 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', $this->userId);
|
||||||
|
$result->bindParam('monthF', $this->month);
|
||||||
|
$result->execute();
|
||||||
|
|
||||||
|
return $result->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste les frais hors forfait d'un user pour 1 mois
|
||||||
|
*/
|
||||||
public function listFraisHF(): array
|
public function listFraisHF(): array
|
||||||
{
|
{
|
||||||
//
|
$req = 'SELECT "lhId", 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"
|
||||||
|
|
||||||
public function endInter(string $id)
|
WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois
|
||||||
{
|
ORDER BY "lhDate";';
|
||||||
$req = "UPDATE intervention
|
|
||||||
SET iHeureFin = NOW()
|
|
||||||
WHERE iCis = :cis AND iId = :idInter AND iHeureFin IS NULL";
|
|
||||||
|
|
||||||
$cis = explode('-', $id)[0];
|
$result = $this->pdo->prepare($req);
|
||||||
$idInter = explode('-', $id)[1];
|
$result->bindParam(':idVisiteur', $this->userId);
|
||||||
|
$result->bindParam(':mois', $this->month);
|
||||||
$result = PdoBD::$monPdo->prepare($req);
|
|
||||||
$result->bindParam(':cis', $cis);
|
|
||||||
$result->bindParam(':idInter', $idInter);
|
|
||||||
$result->execute();
|
$result->execute();
|
||||||
|
|
||||||
|
return $result->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction qui renvoie le prix total validé d'une fiche de frais
|
||||||
|
*
|
||||||
|
* AJOUTER UNE FONCTION QUI CREE LA FICHE DE FRAIS LORS DU SELECT SI CELLE CI N'EXISTE PAS
|
||||||
|
*/
|
||||||
|
public function getMontantValide(): float
|
||||||
|
{
|
||||||
|
$req = 'SELECT "rMontantValide"
|
||||||
|
FROM remboursement
|
||||||
|
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()['rMontantValide'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RETOURNE LE STATUS DE LA FICHE
|
||||||
|
*/
|
||||||
|
public function getStatus(): string
|
||||||
|
{
|
||||||
|
$req = 'select etat."eId" from remboursement
|
||||||
|
INNER JOIN etat on etat."eId" = remboursement."rEtat"
|
||||||
|
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'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPDATE LES INFOS DE LA FICHE
|
||||||
|
*/
|
||||||
|
public function updateFile(int $nbJustif, float $mttValid): bool
|
||||||
|
{
|
||||||
|
$req = 'UPDATE remboursement
|
||||||
|
SET "rNbJustificatifs" = :nbJustif,
|
||||||
|
"rMontantValide" = :mttValid,
|
||||||
|
"rDateModif" = NOW()
|
||||||
|
WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois;';
|
||||||
|
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
|
||||||
|
$result->bindParam(':nbJustif', $nbJustif);
|
||||||
|
$result->bindParam(':mttValid', $mttValid);
|
||||||
|
$result->bindParam(':idVisiteur', $this->userId);
|
||||||
|
$result->bindParam(':mois', $this->month);
|
||||||
|
|
||||||
|
return $result->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AJOUTE LES LIGNES HF
|
||||||
|
*/
|
||||||
|
public function addFraisHF(string $libelle, string $date, float $montant): bool
|
||||||
|
{
|
||||||
|
$req = 'SELECT MAX("lhId")+1
|
||||||
|
FROM ligne_hors_forfait';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->execute();
|
||||||
|
$idLigne = $result->fetch()[0];
|
||||||
|
|
||||||
|
$req = 'INSERT INTO ligne_hors_forfait
|
||||||
|
VALUES (:idLigne, :userId, :monthF, :libelle, :dateL, :mttF, \'true\', \'false\');';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->bindParam(':idLigne', $idLigne);
|
||||||
|
$result->bindParam(':libelle', $libelle);
|
||||||
|
$result->bindParam(':dateL', $date);
|
||||||
|
$result->bindParam(':mttF', $montant);
|
||||||
|
$result->bindParam(':userId', $this->userId);
|
||||||
|
$result->bindParam(':monthF', $this->month);
|
||||||
|
|
||||||
|
return $result->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refuse ou accepte un frais HF
|
||||||
|
*/
|
||||||
|
public function accceptFrais(int $idFrais, bool $state)
|
||||||
|
{
|
||||||
|
$req = 'UPDATE ligne_hors_forfait
|
||||||
|
SET "lhRefus" = :stateF
|
||||||
|
WHERE "lhId" = :idFrais;';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$state = ($state) ? 'false' : 'true';
|
||||||
|
$result->bindParam(':stateF', $state);
|
||||||
|
$result->bindParam(':idFrais', $idFrais);
|
||||||
|
|
||||||
|
return $result->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UPDATE LA LIGNE FRAIS FORFAITAIRES
|
||||||
|
*/
|
||||||
|
public function updateFraisF(int $qttF, int $montant, string $idForfait): bool
|
||||||
|
{
|
||||||
|
$req = 'UPDATE ligne_forfait
|
||||||
|
SET "lfQuantite" = :qttF,
|
||||||
|
"lfMontant" = :mttF
|
||||||
|
WHERE "lfVisiteur" = :userId AND "lfMois" = :monthF AND "lfForfait" = :idForfait;';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->bindParam(':qttF', $qttF);
|
||||||
|
$result->bindParam(':mttF', $montant);
|
||||||
|
$result->bindParam(':idForfait', $idForfait);
|
||||||
|
$result->bindParam(':userId', $this->userId);
|
||||||
|
$result->bindParam(':monthF', $this->month);
|
||||||
|
|
||||||
|
return $result->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SUPPRIME LA LIGNE HF
|
||||||
|
*/
|
||||||
|
public function suprLigneHF(int $idLine): bool
|
||||||
|
{
|
||||||
|
$req = 'DELETE FROM ligne_hors_forfait
|
||||||
|
WHERE "lhId" = :idLine';
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->bindParam(':idLine', $idLine);
|
||||||
|
|
||||||
|
return $result->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
31
Class/class.user.php
Normal file
31
Class/class.user.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AJOUT COMPTABLE
|
||||||
|
* INSERT INTO utilisateur
|
||||||
|
* VALUES('cpt1', 'Renaudot', 'Pierre', 'pr07', 'pr', 'rue saint éloi', 21110, 'Marliens', NOW(), 3, 3, 4, 27, NOW(), NOW(), '120cv', 'essence')
|
||||||
|
*/
|
||||||
|
class Class_user
|
||||||
|
{
|
||||||
|
private $pdo = null;
|
||||||
|
|
||||||
|
public function __construct(PdoGsb $pDO)
|
||||||
|
{
|
||||||
|
$this->pdo = $pDO->getPdoGsb();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function connectUser(string $login, string $password): array|bool
|
||||||
|
{
|
||||||
|
$req = 'SELECT "uId", "uNom", "uPrenom", "uAdresse", "uCp", "uVille", "uSecteur", "uLabo", "parametre"."pLibelle"
|
||||||
|
FROM utilisateur
|
||||||
|
INNER JOIN parametre ON "parametre"."pType" = \'statUti\'
|
||||||
|
AND "utilisateur"."uStatut" = "parametre"."pIndice"
|
||||||
|
WHERE "uLogin" = :login AND "uMdp" = :pwd ;';
|
||||||
|
|
||||||
|
$result = $this->pdo->prepare($req);
|
||||||
|
$result->bindParam('login', $login);
|
||||||
|
$result->bindParam('pwd', $password);
|
||||||
|
$result->execute();
|
||||||
|
|
||||||
|
return $result->fetch();
|
||||||
|
}
|
||||||
|
}
|
46
controleurs/c_actionFiche.php
Normal file
46
controleurs/c_actionFiche.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//var_dump($_REQUEST['fraisHF']);
|
||||||
|
require_once(__DIR__ . '/../Class/class.pdo.php');
|
||||||
|
require_once(__DIR__ . '/../Class/class.newFiche.php');
|
||||||
|
|
||||||
|
|
||||||
|
$id = explode('-', $_GET['fiche']); //id de la fiche "userID-date"
|
||||||
|
$pdo = new PdoGsb;
|
||||||
|
$pdoNewFiche = new Class_newFiche($pdo, $id[0], $id[1]);
|
||||||
|
|
||||||
|
switch ($_GET['action']) {
|
||||||
|
case 'update':
|
||||||
|
//FRAIS FORFAITAIRES
|
||||||
|
foreach ($_REQUEST['fraisF'] as $value) {
|
||||||
|
$pdoNewFiche->updateFraisF(
|
||||||
|
$value['quantité'],
|
||||||
|
intval($value['montant']),
|
||||||
|
$value['id']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//FRAIS HORS FORFAIT
|
||||||
|
foreach ($_REQUEST['fraisHF'] as $value) {
|
||||||
|
if ($value['id'] == NULL) {
|
||||||
|
$pdoNewFiche->addFraisHF(
|
||||||
|
$value['libelle'],
|
||||||
|
$value['date'],
|
||||||
|
$value['montant']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'suprFraisHF':
|
||||||
|
$pdoNewFiche->suprLigneHF($_GET['idFrais']);
|
||||||
|
break;
|
||||||
|
case 'refusFraisHF':
|
||||||
|
$pdoNewFiche->accceptFrais(
|
||||||
|
$_GET['idFrais'],
|
||||||
|
boolval($_GET['state'])
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
# code...
|
||||||
|
break;
|
||||||
|
}
|
@ -1,12 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
// ***************************************'
|
require_once(__DIR__ . '/../Class/class.user.php');
|
||||||
// Le CASTEL-BTS SIO/ PROJET PPE4 GSB '
|
|
||||||
// Programme: c_connexion.php v2.0 '
|
$userClass = new Class_user($pdo);
|
||||||
// Objet : gestion remboursements frais'
|
if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||||
// Client : laboratoires GSB '
|
//Récupère les données de l'utilisateur
|
||||||
// Date : 03/05/2023 à 11H01 '
|
$data = $userClass->connectUser($_POST['login'], $_POST['password']);
|
||||||
// Auteur : pascal-blain@wanadoo.fr '
|
|
||||||
//****************************************'
|
if($data == false) {
|
||||||
|
header('location: index.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Si l'utilisateur existe ou pas
|
||||||
|
if (count($data) === 0) {
|
||||||
|
header('location: index.php?direction=connexion&msg=errorco');
|
||||||
|
} else {
|
||||||
|
$_SESSION['uId'] = $data['uId'];
|
||||||
|
$_SESSION['uNom'] = $data['uNom'];
|
||||||
|
$_SESSION['uPrenom'] = $data['uPrenom'];
|
||||||
|
$_SESSION['uAdresse'] = $data['uAdresse'];
|
||||||
|
$_SESSION['uCp'] = $data['uCp'];
|
||||||
|
$_SESSION['uVille'] = $data['uVille'];
|
||||||
|
$_SESSION['uSecteur'] = $data['uSecteur'];
|
||||||
|
$_SESSION['uLabo'] = $data['uLabo'];
|
||||||
|
$_SESSION['uType'] = $data['pLibelle'];
|
||||||
|
|
||||||
|
header('location: index.php?direction=home');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
include('vues/v_connexion.php');
|
||||||
|
}
|
||||||
|
die;
|
||||||
|
/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
header('location: index.php?direction=home');
|
header('location: index.php?direction=home');
|
||||||
|
|
||||||
if (!isset($_REQUEST['action'])) {
|
if (!isset($_REQUEST['action'])) {
|
||||||
@ -44,7 +72,7 @@ switch ($action) {
|
|||||||
$leMoisPrecedent = (date('Y') - 1) * 100 + 12;
|
$leMoisPrecedent = (date('Y') - 1) * 100 + 12;
|
||||||
}
|
}
|
||||||
//penser ici à faire la cloture du mois précédent !
|
//penser ici à faire la cloture du mois précédent !
|
||||||
if ($statut == 'V') /* si le remboursement pour le mois courant n'existe pas (=0) il faut le créer*/{
|
if ($statut == 'V') // si le remboursement pour le mois courant n'existe pas (=0) il faut le créer{
|
||||||
$leMois = date('Ym');
|
$leMois = date('Ym');
|
||||||
$leRemboursement = $pdo->existeRemboursement($id, $leMois);
|
$leRemboursement = $pdo->existeRemboursement($id, $leMois);
|
||||||
if ($leRemboursement == 0) {
|
if ($leRemboursement == 0) {
|
||||||
@ -62,3 +90,4 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
*/
|
||||||
|
5
controleurs/c_deconnexion.php
Normal file
5
controleurs/c_deconnexion.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
header('location: ../index.php');
|
@ -1,62 +0,0 @@
|
|||||||
<?php
|
|
||||||
// ***************************************'
|
|
||||||
// Le CASTEL-BTS SIO/ PROJET PPE4 GSB '
|
|
||||||
// Programme: c_etatFrais.php '
|
|
||||||
// Objet : consultations des frais '
|
|
||||||
// Client : laboratoires GSB '
|
|
||||||
// Version : 3.0 '
|
|
||||||
// Date : 03/05/2023 à 14H09 '
|
|
||||||
// Auteur : pascal-blain@wanadoo.fr '
|
|
||||||
//****************************************'
|
|
||||||
|
|
||||||
$action = $_REQUEST['action'];
|
|
||||||
switch($action) {
|
|
||||||
case 'voir':
|
|
||||||
{
|
|
||||||
$nbRemboursementsAValider=$pdo->getNbRemboursementsAValider();
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
|
|
||||||
if ($_SESSION['statut']!='1')
|
|
||||||
{
|
|
||||||
$lesVisiteurs=$pdo->getLesVisiteurs();
|
|
||||||
include("vues/v_choixVisiteur.php");
|
|
||||||
if ($_SESSION['idVisiteur']!=$visiteurChoisi) {unset($_REQUEST['lstMois']);$_SESSION['idVisiteur']=$visiteurChoisi;}
|
|
||||||
}
|
|
||||||
$idVisiteur = $_SESSION['idVisiteur'];
|
|
||||||
$lesMois=$pdo->getLesMoisDisponibles($idVisiteur);
|
|
||||||
include("vues/v_choixMois.php");
|
|
||||||
$_SESSION['leMois']= $moisChoisi;
|
|
||||||
|
|
||||||
$leMois=$_SESSION['leMois'];
|
|
||||||
$lesInfosRemboursement = $pdo->getInfosRemboursement($idVisiteur,$leMois);
|
|
||||||
$libEtat = $lesInfosRemboursement['libEtat'];
|
|
||||||
$montantValide = $lesInfosRemboursement['montantValide'];
|
|
||||||
$nbJustificatifs = $lesInfosRemboursement['nbJustificatifs'];
|
|
||||||
$dateModif = $lesInfosRemboursement['dateModif'];
|
|
||||||
$etatRemboursement = $lesInfosRemboursement['rEtat'];
|
|
||||||
|
|
||||||
$lesFraisForfait= $pdo->getLesFraisForfait($idVisiteur,$leMois);
|
|
||||||
$lesFraisHorsForfait = $pdo->getLesFraisHorsForfait($idVisiteur,$leMois);
|
|
||||||
|
|
||||||
$ajoutFraisPossible = $pdo->getAjoutFraisPossible($idVisiteur, $leMois, $etatRemboursement);
|
|
||||||
include("vues/v_etatFrais.php");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'validerEtat':
|
|
||||||
{
|
|
||||||
// code à rédiger ici ...
|
|
||||||
/*
|
|
||||||
// il faut actualiser le code etat, la date, le nombre de justificatifs et le montant valide
|
|
||||||
$pdo->valideRemboursement($idVisiteur,$leMois);
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
break;*/
|
|
||||||
}
|
|
||||||
default :
|
|
||||||
{
|
|
||||||
echo 'erreur d\'aiguillage !'.$action;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
23
controleurs/c_ficheAvalider.php
Normal file
23
controleurs/c_ficheAvalider.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
$_SESSION["typeU"] = "comptable";
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/../Class/class.gestionFiche.php');
|
||||||
|
$gestionFiche = new Class_gestionFiche($pdo);
|
||||||
|
|
||||||
|
$LesUtilisateurs = $gestionFiche->getLesUtilisateurs(); //RENVOIE LISTE USERS
|
||||||
|
|
||||||
|
if ($_SESSION["typeU"] == "comptable") {
|
||||||
|
if (isset($_REQUEST['selVisiteur'])) {
|
||||||
|
$userId = $_REQUEST['selVisiteur'];
|
||||||
|
} else {
|
||||||
|
$userId = $LesUtilisateurs[0]['uId'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$userId = $_SESSION['uId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$lesFiches = $gestionFiche->get_ficheAvalider();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include("vues/v_fichesAvalider.php");
|
@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
// *****************************************'
|
|
||||||
// Le CASTEL-BTS SIO/ PROJET PPE4 GSB '
|
|
||||||
// Programme: c_gererFraisForfaitaire.php '
|
|
||||||
// Objet : Ajout/modif/suppression frais'
|
|
||||||
// Client : laboratoires GSB '
|
|
||||||
// Version : 3.0 '
|
|
||||||
// Date : 03/05/2023 <20> 11H01 '
|
|
||||||
// Auteur : pascal-blain@wanadoo.fr '
|
|
||||||
//******************************************'
|
|
||||||
$idVisiteur = $_SESSION['idVisiteur'];
|
|
||||||
$leMois = $_SESSION['leMois'];
|
|
||||||
$action = $_REQUEST['action'];
|
|
||||||
//----------------------------------------- AJOUT
|
|
||||||
if ($action=='choix')
|
|
||||||
{
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
$lesForfaitsPossibles= $pdo->getLesForfaitsPossibles();
|
|
||||||
$prixKm=$pdo->getPrixKm($idVisiteur,$leMois);
|
|
||||||
include("vues/v_ajoutFraisForfaitaire.php");
|
|
||||||
}
|
|
||||||
if ($action=='valider')
|
|
||||||
{// enregistrement de la ligne et retour vers l'etat des frais
|
|
||||||
$qte = $_REQUEST['zQte'];
|
|
||||||
if ($qte>0)
|
|
||||||
{ $forfait = $_REQUEST['zForfait'];
|
|
||||||
$montant = str_replace(",",".",$_REQUEST['zPrix']);
|
|
||||||
$montant = str_replace(" ","",$montant);
|
|
||||||
$pdo->ajoutFraisForfait($idVisiteur, $leMois, $forfait, $qte, $montant); //insertion dans la table;
|
|
||||||
}
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
}
|
|
||||||
//----------------------------------------- MODIFICATION
|
|
||||||
if ($action=='editer')
|
|
||||||
{
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
$forfait = $_REQUEST['forfait'];
|
|
||||||
$unForfait = $pdo->getUnFraisForfait($idVisiteur, $leMois, $forfait);
|
|
||||||
include("vues/v_unFraisForfaitaire.php");
|
|
||||||
}
|
|
||||||
if ($action=='validerModifier')
|
|
||||||
{// mise <20> jour de la ligne et retour vers l'etat des frais
|
|
||||||
$qte = $_REQUEST['zQte'];
|
|
||||||
if ($qte>0)
|
|
||||||
{
|
|
||||||
$forfait = $_REQUEST['forfait'];
|
|
||||||
$pdo->majFraisForfait($idVisiteur, $leMois, $forfait, $qte); //mise <20> jour de la table;
|
|
||||||
}
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
}
|
|
||||||
//----------------------------------------- SUPPRESSION
|
|
||||||
if ($action=='supprimer')
|
|
||||||
{
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
$forfait = $_REQUEST['forfait'];
|
|
||||||
|
|
||||||
$unForfait = $pdo->getUnFraisForfait($idVisiteur, $leMois, $forfait);
|
|
||||||
include("vues/v_unFraisForfaitaire.php");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action=='validerSupprimer')
|
|
||||||
{// suppression de la ligne et retour vers l'etat des frais
|
|
||||||
$qte = $_REQUEST['zQte'];
|
|
||||||
if ($qte>0)
|
|
||||||
{
|
|
||||||
$forfait = $_REQUEST['forfait'];
|
|
||||||
$pdo->supprimerFraisForfait($idVisiteur, $leMois, $forfait); //suppession de la ligne dans la table;
|
|
||||||
}
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,75 +0,0 @@
|
|||||||
<?php
|
|
||||||
// *****************************************'
|
|
||||||
// Le CASTEL-BTS SIO/ PROJET PPE4 GSB '
|
|
||||||
// Programme: c_gererFraisHorsForfait.php '
|
|
||||||
// Objet : Ajout/modif/suppression frais'
|
|
||||||
// Client : laboratoires GSB '
|
|
||||||
// Version : 3.0 '
|
|
||||||
// Date : 03/05/2023 <20> 11H01 '
|
|
||||||
// Auteur v1: pascal-blain@wanadoo.fr '
|
|
||||||
//******************************************'
|
|
||||||
$idVisiteur = $_SESSION['idVisiteur'];
|
|
||||||
$leMois = $_SESSION['leMois'];
|
|
||||||
$action = $_REQUEST['action'];
|
|
||||||
//----------------------------------------- AJOUT
|
|
||||||
if ($action=='ajouter')
|
|
||||||
{
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
include("vues/v_ajoutFraisHorsForfait.php");
|
|
||||||
}
|
|
||||||
if ($action=='valider')
|
|
||||||
{// enregistrement de la ligne et retour vers l'etat des frais
|
|
||||||
$date = $_REQUEST['zDate'];
|
|
||||||
if ($date>0)
|
|
||||||
{ $libelle=addslashes($_REQUEST['zLibelle']);
|
|
||||||
$montant = str_replace(",",".",$_REQUEST['zMontant']);
|
|
||||||
$montant = str_replace(" ","",$montant);
|
|
||||||
$pdo->ajoutFraisHorsForfait($idVisiteur, $leMois, $date, $libelle, $montant); //insertion dans la table;
|
|
||||||
}
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
}
|
|
||||||
//----------------------------------------- MODIFICATION
|
|
||||||
if ($action=='editer')
|
|
||||||
{
|
|
||||||
include("vues/v_entete.php");
|
|
||||||
$idFrais = $_REQUEST['idFrais'];
|
|
||||||
$unFrais = $pdo->getUnFraisHorsForfait($idFrais);
|
|
||||||
include("vues/v_unFraisHorsForfait.php");
|
|
||||||
}
|
|
||||||
if ($action=='validerModifier')
|
|
||||||
{// mise <20> jour de la ligne et retour vers l'etat des frais
|
|
||||||
$montant = $_REQUEST['zMontant'];
|
|
||||||
if ($montant>0)
|
|
||||||
{
|
|
||||||
$idFrais = $_REQUEST['idFrais'];
|
|
||||||
$date = $_REQUEST['zDate'];
|
|
||||||
$libelle=addslashes($_REQUEST['zLibelle']);
|
|
||||||
$montant = str_replace(",",".",$_REQUEST['zMontant']);
|
|
||||||
$montant = str_replace(" ","",$montant);
|
|
||||||
$pdo->majFraisHorsForfait($idFrais, $date, $libelle, $montant); //mise <20> jour de la table;
|
|
||||||
}
|
|
||||||
$moisASelectionner = $leMois;
|
|
||||||
header ('location: index.php?uc=etatFrais&action=voir&lstMois='.$leMois);
|
|
||||||
}
|
|
||||||
//----------------------------------------- SUPPRESSION
|
|
||||||
if ($action=='supprimer')
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if ($action=='validerSupprimer')
|
|
||||||
{
|
|
||||||
$montant = $_REQUEST['zMontant'];
|
|
||||||
if ($montant>0)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,15 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
$_SESSION["typeU"] = "comptable";
|
||||||
$_SESSION['typeU'] = 'comptable';
|
|
||||||
|
|
||||||
|
require_once(__DIR__ . '/../Class/class.gestionFiche.php');
|
||||||
|
$gestionFiche = new Class_gestionFiche($pdo);
|
||||||
|
|
||||||
include("../vues/v_gestionFiches.php");
|
$LesUtilisateurs = $gestionFiche->getLesUtilisateurs(); //RENVOIE LISTE USERS
|
||||||
|
|
||||||
|
if ($_SESSION["typeU"] == "comptable") {
|
||||||
|
if (isset($_REQUEST['selVisiteur'])) {
|
||||||
|
$userId = $_REQUEST['selVisiteur'];
|
||||||
|
} else {
|
||||||
|
$userId = $LesUtilisateurs[0]['uId'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$userId = $_SESSION['uId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$lesFiches = $gestionFiche->get_ListesFiches($userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include("vues/v_gestionFiches.php");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
@ -1,7 +1,87 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* sudo date --set "YYYY-MM-DD HH:MM:SS"
|
||||||
|
*/
|
||||||
|
|
||||||
require_once(__DIR__ . '/../Class/class.newFiche.php');
|
require_once(__DIR__ . '/../Class/class.newFiche.php');
|
||||||
|
|
||||||
$newFiche = new Class_newFiche($pdo);
|
$typeUser = $_SESSION['uType']; //visiteur ou comptable
|
||||||
$typesFraisForfaitaires = $newFiche->listFraisForfaitaires();
|
$typeUser = 'visiteur';//$_SESSION['uType']; //visiteur ou comptable
|
||||||
|
$userId = $_SESSION['uId']; //exemple: 'b34'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gestion de la date selon la vue à afficher
|
||||||
|
*/
|
||||||
|
if (isset($_GET['currentList'])) {
|
||||||
|
|
||||||
|
//Date des req SQL et function
|
||||||
|
$date = date('Ym');
|
||||||
|
|
||||||
|
//Timestamp de la date
|
||||||
|
$dateTimeStamp = strtotime(date('Y-m-\01'));
|
||||||
|
|
||||||
|
//Date du formulaire HF
|
||||||
|
$dateFormHFMin = date('Y-m-\01');
|
||||||
|
$dateFormHFMax = date("Y-m-t", mktime(0, 0, 0, date('m'), 1, date('Y'))); // retourne le dernier jour du mois (30 ou 31)
|
||||||
|
|
||||||
|
} elseif (isset($_GET['dateListing'])) {
|
||||||
|
//Données pour nourire la vue
|
||||||
|
$userId = $_REQUEST['userId'];
|
||||||
|
$date = $_REQUEST['dateListing'];
|
||||||
|
|
||||||
|
//Timestamp de la date
|
||||||
|
$dateTimeStamp = strtotime(substr($date, 0, 4) . '-' . substr($date, 4) . '-01');
|
||||||
|
|
||||||
|
//Date du formulaire HF
|
||||||
|
$dateFormHFMin = substr($date, 0, 4) . '-' . substr($date, 4) . '-01';
|
||||||
|
$dateFormHFMax = date("Y-m-t", mktime(0, 0, 0, date('m', $dateTimeStamp), 1, date('Y', $dateTimeStamp))); // retourne le dernier jour du mois (30 ou 31)
|
||||||
|
|
||||||
|
}
|
||||||
|
//Date du header en français
|
||||||
|
try {
|
||||||
|
//sudo timedatectl set-local-rtc 1
|
||||||
|
$format = new IntlDateFormatter(
|
||||||
|
'fr_FR',
|
||||||
|
IntlDateFormatter::FULL,
|
||||||
|
IntlDateFormatter::FULL,
|
||||||
|
'Europe/Paris',
|
||||||
|
IntlDateFormatter::GREGORIAN,
|
||||||
|
'MMMM Y'
|
||||||
|
);
|
||||||
|
$dateHeader = $format->format($dateFormat);
|
||||||
|
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$dateHeader = date('F Y', $dateTimeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//$date = '202312'; //TESTVAR
|
||||||
|
|
||||||
|
//Instance de l'objet newFiche qui gère toute la partie bdd
|
||||||
|
$newFiche = new Class_newFiche($pdo, $userId, $date);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liste des frais forfaitaires du mois et de l'user :: sinon afficher les libelle
|
||||||
|
*/
|
||||||
|
$listeFraisForfaitaire = $newFiche->listFraisForfaitForU();
|
||||||
|
if (count($listeFraisForfaitaire) == 0) {
|
||||||
|
$listeFraisForfaitaire = $newFiche->listFraisForfaitaires();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listes des frais HF
|
||||||
|
*/
|
||||||
|
$listeFraisHf = $newFiche->listFraisHF();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TOTAL DE LA FICHE
|
||||||
|
*/
|
||||||
|
$totalFraisFiche = $newFiche->getMontantValide();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ETAT DE LA FICHE
|
||||||
|
*/
|
||||||
|
$status = $newFiche->getStatus();
|
||||||
|
$status = 'CR'; //créé
|
||||||
|
$disabled = ($status !== 'CR') ? 'disabled' : '';
|
||||||
|
|
||||||
include(__DIR__ . '/../vues/v_newFiche.php');
|
include(__DIR__ . '/../vues/v_newFiche.php');
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
stocker le nom d'utilisateur et le mot de passe dans la classe n'est pas une très bonne idée pour le code mis en production ... Une bonne solution consiste a stocker les paramètres de connexion à la base de données dans un fichier .ini et à en restreindre l'accès. Par exemple de cette façon:
|
stocker le nom d'utilisateur et le mot de passe dans la classe n'est pas une très bonne idée pour le code mis en
|
||||||
|
production ... Une bonne solution consiste a stocker les paramètres de connexion à la base de données dans un fichier
|
||||||
|
.ini et à en restreindre l'accès. Par exemple de cette façon:
|
||||||
|
|
||||||
private static $serveur='mysql:host=localhost';
|
private static $serveur='mysql:host=localhost';
|
||||||
private static $bdd='dbname=gsb2021';
|
private static $bdd='dbname=gsb2021';
|
||||||
@ -21,7 +23,8 @@ class MyPDO extends PDO
|
|||||||
{
|
{
|
||||||
public function __construct($file = 'gsb.ini')
|
public function __construct($file = 'gsb.ini')
|
||||||
{
|
{
|
||||||
if (!$settings = parse_ini_file($file, TRUE)) throw new exception('acces impossible ' . $file . '.');
|
if (!$settings = parse_ini_file($file, TRUE))
|
||||||
|
throw new exception('acces impossible ' . $file . '.');
|
||||||
|
|
||||||
$dns = $settings['database']['driver'] .
|
$dns = $settings['database']['driver'] .
|
||||||
':host=' . $settings['database']['host'] .
|
':host=' . $settings['database']['host'] .
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
Partie visiteur
|
Partie visiteur
|
||||||
-->
|
-->
|
||||||
<?php
|
<?php
|
||||||
if($_SESSION['typeU'] == 'visiteur'):
|
if($_SESSION['uType'] == 'visiteur'):
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<a href="#submenu1" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
<a href="#submenu1" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||||
@ -25,7 +25,7 @@
|
|||||||
</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¤tList" class="nav-link px-0"> <span class="d-none d-sm-inline">Fiche du mois</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<a href="#" class="nav-link px-0 align-middle">
|
<a href="#" class="nav-link px-0 align-middle">
|
||||||
<i class="fs-4 bi-table"></i> <span class="ms-1 d-none d-sm-inline">Visites</span></a>
|
<i class="fs-4 bi-table"></i> <span class="ms-1 d-none d-sm-inline">Visites</span></a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; if ($_SESSION['typeU'] == 'comptable'): ?>
|
<?php endif; if ($_SESSION['uType'] == 'comptable'): ?>
|
||||||
<!--
|
<!--
|
||||||
Partie comptable
|
Partie comptable
|
||||||
-->
|
-->
|
||||||
@ -48,7 +48,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="nav-link px-0"> <span class="d-none d-sm-inline">Historique</span>
|
<a href="index.php?direction=ficheAvalider" class="nav-link px-0"> <span class="d-none d-sm-inline">fiches a vérifier</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<hr class="dropdown-divider">
|
<hr class="dropdown-divider">
|
||||||
</li>
|
</li>
|
||||||
<li><a class="dropdown-item" href="#">Sign out</a></li>
|
<li><a class="dropdown-item" href="controleurs/c_deconnexion.php">Sign out</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
219
include/newFiche.js
Normal file
219
include/newFiche.js
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
calcPrixTotalFrsF();
|
||||||
|
calcPrixTotalFrsHorsF();
|
||||||
|
updatePrixTotal();
|
||||||
|
/**
|
||||||
|
* Partie enregistrement frais F
|
||||||
|
*/
|
||||||
|
$('.frsFrt').on('change', function (e) {
|
||||||
|
console.log($(this).val())
|
||||||
|
val = $(this).val();
|
||||||
|
val = val.replace(',', '.')
|
||||||
|
|
||||||
|
if ($.isNumeric(val)) {
|
||||||
|
/**
|
||||||
|
* Calcul le prix de la ligne
|
||||||
|
*/
|
||||||
|
id = $(this).attr('id')
|
||||||
|
formTotal = $('#totalFrs-' + id)
|
||||||
|
mttFrs = $('#mttFrs-' + id).attr('data-price')
|
||||||
|
formTotal.html((val * mttFrs).toFixed(2) + ' €');
|
||||||
|
|
||||||
|
calcPrixTotalFrsF();
|
||||||
|
updatePrixTotal();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enregistrement frais HF
|
||||||
|
*/
|
||||||
|
$('.validFraisHF').on('click', function () {
|
||||||
|
let date = $('#dateHf')
|
||||||
|
let libelle = $('#libelleHf')
|
||||||
|
let montant = $('#mttHf')
|
||||||
|
let canAdd = true;
|
||||||
|
|
||||||
|
if (date.val() == "") {
|
||||||
|
canAdd = false;
|
||||||
|
date.css("border-color", "red")
|
||||||
|
} else {
|
||||||
|
date.css("border-color", "var(--bs-border-color)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (libelle.val() == "") {
|
||||||
|
canAdd = false;
|
||||||
|
libelle.css("border-color", "red")
|
||||||
|
} else {
|
||||||
|
libelle.css("border-color", "var(--bs-border-color)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (montant.val() == "") {
|
||||||
|
canAdd = false;
|
||||||
|
montant.css("border-color", "red")
|
||||||
|
} else {
|
||||||
|
montant.css("border-color", "var(--bs-border-color)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canAdd == true) {
|
||||||
|
var line = $('tr.fraisHF:first').clone();
|
||||||
|
lastId = $('tr.fraisHF').length
|
||||||
|
|
||||||
|
line.find('.btn').attr('id', 'frsSup-' + lastId)
|
||||||
|
|
||||||
|
var line = $('<tr id="fraisHf-' + lastId + '" data-id="" class="fraisHF"></tr>');
|
||||||
|
var tdDate = $('<th scope="row" id="dateFrsHF"></th>');
|
||||||
|
tdDate.html(date.val());
|
||||||
|
var tdLibelle = $('<td id="LibelleFrsHF"></td>');
|
||||||
|
tdLibelle.html(libelle.val());
|
||||||
|
var tdMtt = $('<td id="MttFrsHF"></td>');
|
||||||
|
tdMtt.html(parseFloat(montant.val().replace(',', '.')).toFixed(2) + ' €');
|
||||||
|
var tdJust = $('<td></td>');
|
||||||
|
var btn = $('<td><button type="button" class="btn btn-outline-primary btnSuprFraisHf" id="frsSup-' + lastId + '">Supprimer</button></td>')
|
||||||
|
|
||||||
|
$(line).append(tdDate)
|
||||||
|
$(line).append(tdLibelle)
|
||||||
|
$(line).append(tdMtt)
|
||||||
|
$(line).append(tdJust)
|
||||||
|
$(line).append(btn)
|
||||||
|
|
||||||
|
line.insertBefore('.newFraisForm')
|
||||||
|
|
||||||
|
date.val('')
|
||||||
|
libelle.val('')
|
||||||
|
montant.val('')
|
||||||
|
}
|
||||||
|
|
||||||
|
calcPrixTotalFrsHorsF();
|
||||||
|
updatePrixTotal();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refus d'un frais HF pour un comptable
|
||||||
|
*/
|
||||||
|
$(document).on('click', '.btnRefuseFraisHf', function () {
|
||||||
|
idFrais = $(this).parent().parent().attr('data-id')
|
||||||
|
fiche = $('#idFiche').attr('data-id')
|
||||||
|
etatLigne = $(this).attr('data-status')
|
||||||
|
console.log(etatLigne)
|
||||||
|
//set on refus
|
||||||
|
$.ajax({
|
||||||
|
// url: "../controleurs/c_actionFiche.php?action=refusFraisHF&fiche=" + fiche + "&idFrais=" + idFrais + "&state=" + etatLigne,
|
||||||
|
url: "controleurs/c_actionFiche.php?action=refusFraisHF&fiche=" + fiche + "&idFrais=" + idFrais + "&state=" + etatLigne,
|
||||||
|
method: "POST",
|
||||||
|
}).done(function () {
|
||||||
|
location.reload();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
/**
|
||||||
|
* Supprimer fraisHf
|
||||||
|
*/
|
||||||
|
$(document).on('click', '.btnSuprFraisHf', function () {
|
||||||
|
id = $(this).attr('id').split('-')[1]
|
||||||
|
fiche = $('#idFiche').attr('data-id')
|
||||||
|
idFrais = $(this).parent().parent().attr('data-id')
|
||||||
|
//SUPPRIME DE LA BD
|
||||||
|
$.ajax({
|
||||||
|
url: "controleurs/c_actionFiche.php?action=suprFraisHF&fiche=" + fiche + "&idFrais=" + idFrais,
|
||||||
|
// url: "../controleurs/c_actionFiche.php?action=suprFraisHF&fiche=" + fiche + "&idFrais=" + idFrais,
|
||||||
|
method: "POST",
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#fraisHf-' + id).remove()
|
||||||
|
calcPrixTotalFrsHorsF();
|
||||||
|
updatePrixTotal();
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PARTIE ENVOIE DE LA FICHE
|
||||||
|
*/
|
||||||
|
$(document).on('click', '#sendFileBtn', function () {
|
||||||
|
|
||||||
|
//FRAIS FORFAITAIRES
|
||||||
|
var listeFraisF = []
|
||||||
|
$('tr.fraisForfaitaire').each(function () {
|
||||||
|
quantite = parseInt($(this).find('.frsFrt').val())
|
||||||
|
montant = parseFloat($(this).find('.mttFrsTotal').html())
|
||||||
|
id = $(this).attr('data-id')
|
||||||
|
|
||||||
|
tabData = {
|
||||||
|
'quantité': quantite,
|
||||||
|
'montant': montant,
|
||||||
|
'id': id
|
||||||
|
}
|
||||||
|
listeFraisF.push(tabData);
|
||||||
|
})
|
||||||
|
|
||||||
|
//FRAIS HF
|
||||||
|
var listeFraisHf = []
|
||||||
|
$('tr.fraisHF').each(function () {
|
||||||
|
date = $(this).find('#dateFrsHF').html()
|
||||||
|
libelle = $(this).find('#LibelleFrsHF').html()
|
||||||
|
montant = parseFloat($(this).find('#MttFrsHF').html())
|
||||||
|
id = $(this).attr('data-id')
|
||||||
|
|
||||||
|
tabData = {
|
||||||
|
'date': date,
|
||||||
|
'libelle': libelle,
|
||||||
|
'montant': montant,
|
||||||
|
'id': id
|
||||||
|
}
|
||||||
|
listeFraisHf.push(tabData);
|
||||||
|
})
|
||||||
|
data = {
|
||||||
|
fraisF: listeFraisF,
|
||||||
|
fraisHF: listeFraisHf
|
||||||
|
}
|
||||||
|
fiche = $('#idFiche').attr('data-id')
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "controleurs/c_actionFiche.php?action=update&fiche=" + fiche,
|
||||||
|
// url: "../controleurs/c_actionFiche.php?action=update&fiche=" + fiche,
|
||||||
|
method: "POST",
|
||||||
|
data: data,
|
||||||
|
}).done(function () {
|
||||||
|
location.reload();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calcul prix total frais forfaitaires
|
||||||
|
*/
|
||||||
|
function calcPrixTotalFrsF() {
|
||||||
|
|
||||||
|
var prixTotal = 0;
|
||||||
|
$('td.mttFrsTotal').each(function () {
|
||||||
|
prixTotal += parseFloat($(this).html().replace('€', ''))
|
||||||
|
})
|
||||||
|
$('.prixTotalFrsF').html('<strong>TOTAL :</strong> ' + prixTotal.toFixed(2) + ' €')
|
||||||
|
$('.prixTotalFrsF').attr('data-prix', prixTotal.toFixed(2))
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calcul prix total frais hors forfait
|
||||||
|
*/
|
||||||
|
function calcPrixTotalFrsHorsF() {
|
||||||
|
|
||||||
|
console.log($('td#MttFrsHF').length)
|
||||||
|
|
||||||
|
if ($('td#MttFrsHF').length == 0) {
|
||||||
|
vf
|
||||||
|
}
|
||||||
|
|
||||||
|
var prixTotal = 0;
|
||||||
|
$('td#MttFrsHF').each(function () {
|
||||||
|
prixTotal += parseFloat($(this).html().replace('€', ''))
|
||||||
|
})
|
||||||
|
$('#total-frais-HF').html('<strong>TOTAL :</strong> ' + prixTotal.toFixed(2) + ' €')
|
||||||
|
$('#total-frais-HF').attr('data-prix', prixTotal.toFixed(2))
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calcul prix total de la fiche
|
||||||
|
*/
|
||||||
|
function updatePrixTotal() {
|
||||||
|
var total = parseFloat($('#total-frais-HF').attr('data-prix'))
|
||||||
|
total += parseFloat($('.prixTotalFrsF').attr('data-prix'))
|
||||||
|
|
||||||
|
$('#total-fiche').html('<strong>TOTAL :</strong> ' + total.toFixed(2) + ' €')
|
||||||
|
}
|
25
index.php
25
index.php
@ -14,19 +14,20 @@ session_start();
|
|||||||
require_once("Class/class.pdo.php");
|
require_once("Class/class.pdo.php");
|
||||||
|
|
||||||
$pdo = new PdoGsb();
|
$pdo = new PdoGsb();
|
||||||
//$estConnecte = estConnecte();
|
|
||||||
$_SESSION['typeU'] = 'visiteur';
|
$_SESSION['typeU'] = 'visiteur';
|
||||||
/*
|
|
||||||
if (!isset($_SESSION['userId'])) {
|
/**
|
||||||
$_REQUEST['direction'] = 'connexion';
|
* Direction si non renseigné et non connecté
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
if (!isset($_REQUEST['direction'])) {
|
if (!isset($_REQUEST['direction']) && !isset($_SESSION['uId'])) {
|
||||||
$_REQUEST['direction'] = 'connexion';
|
$_REQUEST['direction'] = 'connexion';
|
||||||
|
} elseif (!isset($_REQUEST['direction']) && isset($_SESSION['uId'])) {
|
||||||
|
$_REQUEST['direction'] = 'home';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="fr">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@ -37,13 +38,19 @@ if (!isset($_REQUEST['direction'])) {
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
|
||||||
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.7.1.js"
|
||||||
|
integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<?php
|
<?php
|
||||||
|
if (!isset($_SESSION['uId'])) {
|
||||||
|
$_REQUEST['direction'] = 'connexion';
|
||||||
|
} else {
|
||||||
include('include/menu.php');
|
include('include/menu.php');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="col py-3">
|
<div class="col py-3">
|
||||||
<?php
|
<?php
|
||||||
@ -64,6 +71,10 @@ if (!isset($_REQUEST['direction'])) {
|
|||||||
include(__DIR__ . "/controleurs/c_nouvelleFiche.php");
|
include(__DIR__ . "/controleurs/c_nouvelleFiche.php");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'ficheAvalider':
|
||||||
|
include(__DIR__ . "/controleurs/c_ficheAvalider.php");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
include("controleurs/c_homePage.php");
|
include("controleurs/c_homePage.php");
|
||||||
break;
|
break;
|
||||||
|
55
sqlFunction.sql
Normal file
55
sqlFunction.sql
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
--Fonction pour créer une fiche si celle-ci n'existe pas
|
||||||
|
CREATE OR REPLACE FUNCTION newRemboursement(userId CHAR(10), monthFile CHAR(10)) RETURNS int AS $$
|
||||||
|
DECLARE
|
||||||
|
returnValue INT;
|
||||||
|
forfaitRecord RECORD;
|
||||||
|
BEGIN
|
||||||
|
SELECT COUNT(*) INTO returnValue
|
||||||
|
FROM remboursement
|
||||||
|
WHERE "rVisiteur" = userId AND "rMois" = monthFile;
|
||||||
|
|
||||||
|
IF returnValue = 0 THEN
|
||||||
|
-- Ajoute une nouvelle ligne à la table remboursement
|
||||||
|
INSERT INTO remboursement
|
||||||
|
VALUES(userId, monthFile, 0, 0, CURRENT_DATE, 'CR');
|
||||||
|
|
||||||
|
-- Parcours des lignes de la table forfait pour insérer dans ligne_hors_forfait
|
||||||
|
FOR forfaitRecord IN SELECT * FROM forfait LOOP
|
||||||
|
INSERT INTO ligne_forfait
|
||||||
|
VALUES(userId, monthFile, forfaitRecord."fId", 0, 0);
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
-- Mettre à jour la valeur de returnValue après l'insertion
|
||||||
|
returnValue := 1; -- Valeur pour indiquer qu'une ligne a été insérée
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN returnValue;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE 'plpgsql';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--AJOUTE LES LIGNES HF
|
||||||
|
INSERT ligne_hors_forfait
|
||||||
|
("lhVisiteur", "lhMois", "lhLibelle", "lhDate", "lhMontant", "lhJustificatif", "lhRefus")
|
||||||
|
VALUES (:userId, :monthF, :libelle, :dateL, :mttF, 'true', 'false');
|
||||||
|
|
||||||
|
--UPDATE LES LIGNES HF SI REFUS
|
||||||
|
UPDATE ligne_hors_forfait
|
||||||
|
SET "lhRefus" = 'true'
|
||||||
|
WHERE "rVisiteur" = '' AND "rMois" = '' AND "lhId" = '';
|
||||||
|
|
||||||
|
--UPDATE LES LIGNE FORFAIT
|
||||||
|
UPDATE ligne_forfait
|
||||||
|
SET "lfQuantite" = :qttF,
|
||||||
|
"lfMontant" = :mttF
|
||||||
|
WHERE "rVisiteur" = :userId AND "rMois" = :monthF AND "lfForfait" = :idForfait;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
|||||||
<!-- Derniere modification le 03/05/2023 à 11H01 -->
|
|
||||||
<div id="contenu">
|
|
||||||
<h2>AJOUT FRAIS FORFAITAIRE</h2>
|
|
||||||
<form name="nouveauFraisForfaitaire" action="index.php?uc=gererFraisForfaitaire&action=valider" method="POST">
|
|
||||||
<table class="listeLegere">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="date">Quantité</th>
|
|
||||||
<th class="eltForfait">Nature de la dépense</th>
|
|
||||||
<th class="montant">Prix</th>
|
|
||||||
<th class="montant">Montant</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><input type="hidden" name="zMois" value="<?PHP echo $leMois; ?>">
|
|
||||||
<input type="text" name="zQte" onkeyup="calculer()" style="text-align:right;"></td>
|
|
||||||
<td><select name="zForfait" onchange="calculer()">
|
|
||||||
<?PHP
|
|
||||||
foreach ($lesForfaitsPossibles as $unForfait)
|
|
||||||
{echo'<option value="'.$unForfait['fId'].'" size="1">'.$unForfait['fLibelle'].'</option>';}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td><input type="text" name="zPrix" style="text-align:right;" disabled></td>
|
|
||||||
<td><input type="text" name="zMontant" style="text-align:right;" disabled></td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?php echo 'Puissance du véhicule : '.$prixKm['aPuissance'].' - Carburant : '.$prixKm['aMotorisation'].' (tarif en vigueur depuis le : '.$prixKm['aDate'].')'; ?>
|
|
||||||
<p align="right"><input type="image" name="zValider" alt="Valider" src="images/valider.jpg" onclick="valider()"><input type="image" name="zAnnuler" alt="Annuler" src="images/annuler.jpg" onclick="annuler()"></p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="include/proceduresJava.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function calculer()
|
|
||||||
{
|
|
||||||
<?php
|
|
||||||
$tarif = 'var tarif = [';
|
|
||||||
foreach ($lesForfaitsPossibles as $unForfait)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$tarif .= $unForfait['fMontant'].',';
|
|
||||||
}
|
|
||||||
$tarif .='];';
|
|
||||||
echo $tarif."\n";
|
|
||||||
?>
|
|
||||||
var iLeChoix = document.nouveauFraisForfaitaire.zForfait.selectedIndex;
|
|
||||||
var quantite = document.nouveauFraisForfaitaire.zQte.value;
|
|
||||||
|
|
||||||
if (!isNaN(quantite))
|
|
||||||
{
|
|
||||||
document.nouveauFraisForfaitaire.zMontant.value = format_euro(quantite * (parseInt(parseFloat(tarif[iLeChoix])*1000))/1000);
|
|
||||||
}
|
|
||||||
document.nouveauFraisForfaitaire.zPrix.value = format_euro((parseInt(parseFloat(tarif[iLeChoix])*1000))/1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function valider()
|
|
||||||
{
|
|
||||||
document.nouveauFraisForfaitaire.zPrix.disabled=false;
|
|
||||||
document.nouveauFraisForfaitaire.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
function annuler()
|
|
||||||
{
|
|
||||||
document.nouveauFraisForfaitaire.reset();
|
|
||||||
document.nouveauFraisForfaitaire.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = function() { calculer(); };
|
|
||||||
</script>
|
|
@ -1,39 +0,0 @@
|
|||||||
<!-- ajout d'un frais hors forfaits / Derni<6E>re modification le 03/05/2023 <20> 11H01 par P. Blain -->
|
|
||||||
<div id="contenu">
|
|
||||||
<h2>AJOUT D'UN FRAIS HORS FORFAIT</h2>
|
|
||||||
<form name="unFraisHorsForfait" action="index.php?uc=gererFraisHorsForfait&action=valider" method="POST">
|
|
||||||
<table class="listeLegere">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="date">Date</th>
|
|
||||||
<th class="eltForfait">Nature de la dépense</th>
|
|
||||||
<th class="montant">Montant</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><input type="hidden" name="zMois" value="<?PHP echo $leMois; ?>">
|
|
||||||
<input type="text" name="zDate" style="text-align:center;border:0;"></td>
|
|
||||||
<td><input type="text" name="zLibelle" style="text-align:left;border:0;" size='80' maxlength='80' ></td>
|
|
||||||
<td><input type="text" name="zMontant" style="text-align:right;border:0;"></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p align="right"><input type="image" name="zValider" alt="Valider" src="images/valider.jpg" onclick="valider()"><input type="image" name="zAnnuler" alt="Annuler" src="images/annuler.jpg" onclick="annuler()"></p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function valider()
|
|
||||||
{
|
|
||||||
document.unFraisHorsForfait.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
function annuler()
|
|
||||||
{
|
|
||||||
document.unFraisHorsForfait.reset();
|
|
||||||
document.unFraisHorsForfait.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<!-- fin -->
|
|
@ -1,49 +0,0 @@
|
|||||||
<!-- choix d'un mois / Derniere modification le 03/05/2023 à 11H01 par Pascal Blain -->
|
|
||||||
<script src="include/proceduresJava.js" type="text/javascript"></script>
|
|
||||||
<?php
|
|
||||||
if ($_SESSION['statut']=="1") {
|
|
||||||
$nbM=count($lesMois);
|
|
||||||
echo '
|
|
||||||
<div id="contenu">
|
|
||||||
<form name="choixM" action="index.php?uc=etatFrais&action=voir" method="post">
|
|
||||||
<h2>Etat de frais de ';} ?>
|
|
||||||
|
|
||||||
<select id="lstMois" name="lstMois" onchange="submit();">
|
|
||||||
<?php
|
|
||||||
if (!isset($_REQUEST['lstMois']))
|
|
||||||
{$moisChoisi = 'premier';}
|
|
||||||
else
|
|
||||||
{$moisChoisi=$_REQUEST['lstMois'];
|
|
||||||
}
|
|
||||||
$i=1;
|
|
||||||
foreach ($lesMois as $unMois)
|
|
||||||
{
|
|
||||||
if($unMois['mois'] == $moisChoisi or $moisChoisi == 'premier')
|
|
||||||
{echo "<option selected value=\"".$unMois['mois']."\">".$unMois['numMois']." ".$unMois['numAnnee']."</option>\n ";
|
|
||||||
$moisChoisi = $unMois['mois'];
|
|
||||||
$noM=$i;}
|
|
||||||
else
|
|
||||||
{echo "<option value=\"".$unMois['mois']."\">".$unMois['numMois']." ".$unMois['numAnnee']."</option>\n ";
|
|
||||||
$i=$i+1;}
|
|
||||||
}
|
|
||||||
echo '
|
|
||||||
</select></h2>';
|
|
||||||
?>
|
|
||||||
<!-- ============================================================== navigation dans les listes visiteurs et mois -->
|
|
||||||
<div id="navigation">
|
|
||||||
<input type="image" id="zPremier" alt="premier" src="images/goPremier.gif" onclick="premier(<?php echo "'".$_SESSION['statut']."'"; ?>)">
|
|
||||||
<input type="image" id="zPrecedent" alt="précédent" src="images/goPrecedent.gif" onclick="precedent(<?php echo "'".$_SESSION['statut']."'"; ?>)">
|
|
||||||
<?php
|
|
||||||
echo '
|
|
||||||
<input type="text" id="zNumero" alt="indice" value="'.$noM.'/'.$nbM.'" disabled="true" size="5" style="text-align:center;vertical-align:top;">';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
<input type="image" id="zSuivant" alt="premier" src="images/goSuivant.gif" onclick="suivant(<?php echo "'".$_SESSION['statut']."'"; ?>)">
|
|
||||||
<input type="image" id="zDernier" alt="premier" src="images/goDernier.gif" onclick="dernier(<?php echo "'".$_SESSION['statut']."'"; ?>)">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<!-- fin liste de choix -->
|
|
@ -1,34 +0,0 @@
|
|||||||
<!-- Choix d'un visiteur / Derniere modification le 03/05/2023 à 11H01 par Pascal Blain -->
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if ($_SESSION['statut']!="1")
|
|
||||||
{
|
|
||||||
echo '
|
|
||||||
<div id="contenu">
|
|
||||||
<form name="choixV" action="index.php?uc=etatFrais&action=voir" method="post">
|
|
||||||
<h2>Etat de frais de
|
|
||||||
|
|
||||||
<select id="lstVisiteurs" name="lstVisiteurs" onchange="submit();">';
|
|
||||||
if (!isset($_REQUEST['lstVisiteurs']))
|
|
||||||
{$visiteurChoisi = 'premier';}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$visiteurChoisi=$_REQUEST['lstVisiteurs'];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '
|
|
||||||
</select>
|
|
||||||
Mois de ';
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,4 +1,51 @@
|
|||||||
<!-- 03/05/2023 à 11H01 -->
|
<!-- 03/05/2023 à 11H01 -->
|
||||||
|
<section class="vh-100 gradient-custom">
|
||||||
|
<div class="container py-5 h-100">
|
||||||
|
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||||
|
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
|
||||||
|
<div class="card bg-dark text-white" style="border-radius: 1rem;">
|
||||||
|
<div class="card-body p-5 text-center">
|
||||||
|
|
||||||
|
<div class="mb-md-5 mt-md-4 pb-5">
|
||||||
|
|
||||||
|
<h2 class="fw-bold mb-2 text-uppercase">GSB Laboratoire</h2>
|
||||||
|
<p class="text-white-50 mb-5">Entrez votre login et mot-de-passe</p>
|
||||||
|
<form action="index.php" method="POST">
|
||||||
|
<div class="form-outline form-white mb-4">
|
||||||
|
<input type="text" id="typeEmailX"
|
||||||
|
class="form-control form-control-lg" name="login"/>
|
||||||
|
<label class="form-label" for="typeEmailX">Login</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-outline form-white mb-4">
|
||||||
|
<input type="password" id="typePasswordX"
|
||||||
|
class="form-control form-control-lg" name="password"/>
|
||||||
|
<label class="form-label" for="typePasswordX">Mot-de-passe</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <p class="small mb-5 pb-lg-2"><a class="text-white-50" href="#!">Forgot password?</a></p> -->
|
||||||
|
|
||||||
|
<button class="btn btn-outline-light btn-lg px-5"
|
||||||
|
type="submit">Connexion</button>
|
||||||
|
</form>
|
||||||
|
<div class="d-flex justify-content-center text-center mt-4 pt-1">
|
||||||
|
<a href="#!" class="text-white"><i
|
||||||
|
class="fab fa-facebook-f fa-lg"></i></a>
|
||||||
|
<a href="#!" class="text-white"><i
|
||||||
|
class="fab fa-twitter fa-lg mx-4 px-2"></i></a>
|
||||||
|
<a href="#!" class="text-white"><i class="fab fa-google fa-lg"></i></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<!--
|
||||||
|
|
||||||
<div id="contenu">
|
<div id="contenu">
|
||||||
<h2>Identification utilisateur</h2>
|
<h2>Identification utilisateur</h2>
|
||||||
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
|
|
||||||
<head>
|
|
||||||
<title>Intranet du Laboratoire Galaxy-Swiss Bourdin</title>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
||||||
<link href="./styles/stylesGSB.css" rel="stylesheet" type="text/css" />
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="./images/favicon.ico" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="page">
|
|
||||||
<div id="entete">
|
|
||||||
<img src="./images/logo.jpg" id="logoGSB" alt="Laboratoire Galaxy-Swiss Bourdin" title="Laboratoire Galaxy-Swiss Bourdin" />
|
|
||||||
<?php if (isset($_SESSION['idUtilisateur']))
|
|
||||||
{echo '
|
|
||||||
<!-- affichage du menu / Derniere modification le 03/05/2023 à 11H01 par P. Blain -->
|
|
||||||
<div id="sommaire">
|
|
||||||
<ul>
|
|
||||||
<li><a href="" title=""> </a></li>
|
|
||||||
<li><a href="" title=""> </a>|</li>
|
|
||||||
<li><b>Bienvenue '.$_SESSION['prenom'].' '.strtoupper($_SESSION['nom']).'</b> ('.$_SESSION['typeUtilisateur'].')';
|
|
||||||
if ($_SESSION['statut']<>'1') {echo '<br /><i>Il y a '.$nbRemboursementsAValider.' demandes à valider</i>';}
|
|
||||||
echo ' </li>
|
|
||||||
<li><a href="index.php?uc=connexion&action=demandeConnexion" title="Se déconnecter"><img alt="déconnexion" src="images/deconnexion.png" border="0" height="26px"></a></li>
|
|
||||||
</ul>
|
|
||||||
</div>';} ?>
|
|
||||||
<br /><br /><h1>ÉTAT DES FRAIS ENGAGÉS</h1>
|
|
||||||
<p style="text-align=left;"><?php echo $_SESSION['adr1'].'<br />'.$_SESSION['adr2'].'</p>';?>
|
|
||||||
</div>
|
|
||||||
<!-- fin affichage du menu -->
|
|
@ -1,140 +0,0 @@
|
|||||||
|
|
||||||
<!-- affichage du detail de la fiche frais / Derniere modification le 03/05/2023 à 11H01 par Pascal BLAIN -->
|
|
||||||
<div class="encadre">
|
|
||||||
<!-- ============================================================== frais forfaitaires -->
|
|
||||||
<table class="listeLegere">
|
|
||||||
<caption><h3> Éléments forfaitisés
|
|
||||||
<?php
|
|
||||||
if ($ajoutFraisPossible['forfait']=="oui") echo '
|
|
||||||
<a href="index.php?uc=gererFraisForfaitaire&action=choix" title="ajout frais forfaitaire">
|
|
||||||
<img alt="Ajouter un frais forfaitaire" src="images/ajouter.jpg" border="0"> </a>
|
|
||||||
';?></h3>
|
|
||||||
</caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="date">Quantité</th>
|
|
||||||
<th class="eltForfait">Nature de la dépense</th>
|
|
||||||
<th class="montant">Prix</th>
|
|
||||||
<th class="montant">Montant</th>
|
|
||||||
<?php
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<th> </th>
|
|
||||||
<th> </th>';} ?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$totalFraisForfait=0;
|
|
||||||
foreach ( $lesFraisForfait as $unFraisForfait )
|
|
||||||
{ echo '
|
|
||||||
<tr>
|
|
||||||
<td align="right">'.$unFraisForfait['lfQuantite'].'</td>
|
|
||||||
<td>'.$unFraisForfait['fLibelle'].'</td>
|
|
||||||
<td align="right">'.number_format($unFraisForfait['lfMontant'],2,',','.').'</td>
|
|
||||||
<td align="right">'.number_format($unFraisForfait['totalLigne'],2,',','.').'</td>';
|
|
||||||
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") echo '
|
|
||||||
<td><a href="index.php?uc=gererFraisForfaitaire&action=editer&forfait='.$unFraisForfait['idfrais'].'"><img alt="modifier" src="images/editer.jpg" border="0"></a></td>
|
|
||||||
<td><a href="index.php?uc=gererFraisForfaitaire&action=supprimer&forfait='.$unFraisForfait['idfrais'].'"><img alt="supprimer" src="images/supprimer.jpg" border="0"></a></td>';
|
|
||||||
|
|
||||||
echo '
|
|
||||||
</tr>';
|
|
||||||
$totalFraisForfait=$totalFraisForfait + $unFraisForfait['totalLigne'];
|
|
||||||
}
|
|
||||||
echo '
|
|
||||||
<tr>
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
<td align="right"><b>Total</b></td>
|
|
||||||
<td align="right"><b>'.number_format($totalFraisForfait,2,',','.').'</b></td>';
|
|
||||||
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
</tr>';}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- ============================================================== rappel des elements du remboursement -->
|
|
||||||
<form name="autresfrais" action="index.php?uc=etatFrais&action=validerEtat" method="post">
|
|
||||||
<div id="menu">
|
|
||||||
<ul>
|
|
||||||
<li>Etat : <b><?php echo $libEtat;?> </b></li>
|
|
||||||
<li>depuis le :<br /><b><?php echo $dateModif;?></b> </li>
|
|
||||||
<li>Justificatifs : <b><?php echo $nbJustificatifs; ?></b></li>
|
|
||||||
<li>Montant validé : <br /><b><?php echo number_format($montantValide,2,',','.').' €';?></b> </li><br />
|
|
||||||
<?php
|
|
||||||
if ($ajoutFraisPossible['modifComptable']=="oui") { echo '
|
|
||||||
<li style="list-style-type:none;"><img alt="validation de la demande de remboursement" src="images/validation.jpg" onClick="document.autresfrais.submit();"></li>';}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ============================================================== frais hors forfaits -->
|
|
||||||
<table class="listeLegere">
|
|
||||||
<caption><h3> Autres dépenses (hors forfaits)
|
|
||||||
<?php
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui") echo '
|
|
||||||
<a href="index.php?uc=gererFraisHorsForfait&action=ajouter" title="ajout frais hors forfait">
|
|
||||||
<img alt="Ajouter un frais hors forfait" src="images/ajouter.jpg" border="0"> </a>
|
|
||||||
';?></h3>
|
|
||||||
</caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="date">Date</th>
|
|
||||||
<th class="libelle">Nature de la dépense</th>
|
|
||||||
<th class="montant">Montant</th>
|
|
||||||
<?php
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<th> </th>
|
|
||||||
<th> </th>';}
|
|
||||||
if ($ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<th><img name="zTous" alt="valider tous les justificatifs" src="images/cocheB.gif" width="20px" onClick="tousLesJustificatifs(document.autresfrais);" onMouseOver="src=\'images/cocheR.gif\'" onMouseOut="src=\'images/cocheB.gif\'">
|
|
||||||
<input type="hidden" name="zSens" value="on"></th>';}
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$totalFraisHorsForfait=0;
|
|
||||||
foreach ( $lesFraisHorsForfait as $unFraisHorsForfait )
|
|
||||||
{if (substr($unFraisHorsForfait['lhLibelle'],0,6)<>'REFUSE') {$td='<td style="text-decoration:none;"';} else {$td='<td style="text-decoration:line-through; color:red;"';}
|
|
||||||
echo '<tr>'.
|
|
||||||
$td.'>'.$unFraisHorsForfait['lhDate'].'</td>'.
|
|
||||||
$td.'>'.$unFraisHorsForfait['lhLibelle'].'</td>'.
|
|
||||||
$td.' align="right">'.number_format($unFraisHorsForfait['lhMontant'],2,',','.').'</td>';
|
|
||||||
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui")
|
|
||||||
{echo '
|
|
||||||
<td><a href="index.php?uc=gererFraisHorsForfait&action=editer&idFrais='.$unFraisHorsForfait['lhId'].'"><img alt="modifier" src="images/editer.jpg" border="0"></a></td>
|
|
||||||
<td><img alt="supprimer" src="images/supprimer.jpg" border="0"></td>';
|
|
||||||
}
|
|
||||||
if ($ajoutFraisPossible['modifComptable']=="oui")
|
|
||||||
{if (substr($unFraisHorsForfait['lhLibelle'],0,6)<>'REFUSE')
|
|
||||||
{echo '<td><input type="checkbox" name="justificatifs[]" value="'.$unFraisHorsForfait['lhId'].'" checked onClick=""></td>';}
|
|
||||||
else
|
|
||||||
{echo '<td> </td>';}
|
|
||||||
}
|
|
||||||
$totalFraisHorsForfait=$totalFraisHorsForfait + $unFraisHorsForfait['lhMontant']; echo '
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
echo '
|
|
||||||
<tr>
|
|
||||||
<td> </td>
|
|
||||||
<td align="right"><b>Total</b></td>
|
|
||||||
<td align="right"><b>'.number_format($totalFraisHorsForfait,2,',','.').'</b></td>';
|
|
||||||
if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>';}
|
|
||||||
if ($ajoutFraisPossible['modifComptable']=="oui") {echo '
|
|
||||||
<td> </td>';} echo '
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<h3 align="center"><b>Total de la demande de remboursement de frais : '.number_format($totalFraisForfait + $totalFraisHorsForfait,2,',','.').' €</b></h3>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>'; ?>
|
|
35
vues/v_fichesAvalider.php
Normal file
35
vues/v_fichesAvalider.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<div class="col-11 d-flex mx-auto">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Mois</th>
|
||||||
|
<th scope="col">Nom Fiche</th>
|
||||||
|
<th scope="col">Total</th>
|
||||||
|
<th scope="col">Statut</th>
|
||||||
|
<th scope="col">Détails</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($lesFiches as $uneFiche) { ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?= $gestionFiche->dateComplete($uneFiche['rMois']) ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<?= $uneFiche['uNom'] ?>
|
||||||
|
<?= $uneFiche['uPrenom'] ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?= $uneFiche['rMontantValide'] ?> €
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?= $uneFiche['eLibelle'] ?>
|
||||||
|
</td>
|
||||||
|
<td><a
|
||||||
|
href="index.php?direction=nouvelleFiche&userId=<?= $userId ?>&dateListing=<?= $uneFiche['rMois'] ?>">voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
@ -1,36 +1,32 @@
|
|||||||
<?php
|
|
||||||
var_dump($_SESSION['test']);
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<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>
|
<center>
|
||||||
<div class="col-3 mb-4">
|
<div class="col-3 mb-4">
|
||||||
<h3>Gerer mes fiches de frais</h3>
|
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php
|
||||||
if ($_SESSION['typeU'] == 'comptable') {
|
if ($_SESSION['typeU'] != 'comptable') {
|
||||||
echo '<select class="form-select" name="selVisiteur" id="">
|
echo '<h3>Gérer mes fiches de frais</h3>';
|
||||||
<option value="visiteur1">Visiteur 1</option></select>';
|
} else { ?>
|
||||||
|
|
||||||
|
<form action="index.php?direction=gestionFiche" method="POST">
|
||||||
|
<?php
|
||||||
|
echo '<h3>Gérer les fiches de frais de :</h3>';
|
||||||
|
echo '<select class="form-select" name="selVisiteur" id="">';
|
||||||
|
foreach ($LesUtilisateurs as $key => $value) {
|
||||||
|
$id = $value['uId'];
|
||||||
|
$prenom = $value['uPrenom'];
|
||||||
|
$nom = $value['uNom'];
|
||||||
|
|
||||||
|
if ($id == $userId) {
|
||||||
|
echo '<option value="' . $id . '" selected>' . $nom . " " . $prenom . "</option>";
|
||||||
|
} else {
|
||||||
|
echo '<option value="' . $id . '">' . $nom . " " . $prenom . "</option>";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
echo '</select>'; ?>
|
||||||
|
<button type="submit" class="btn btn-dark m-2" >Selectionner</button>
|
||||||
|
<!-- Fin du formulaire -->
|
||||||
|
<?php }
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</center>
|
</center>
|
||||||
@ -46,27 +42,29 @@ var_dump($_SESSION['test']);
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php foreach ($lesFiches as $uneFiche) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Novembre</th>
|
<th scope="row">
|
||||||
<td>351 €</td>
|
<?= $gestionFiche->dateComplete($uneFiche['rMois']) ?>
|
||||||
<td>en cours...</td>
|
</th>
|
||||||
<td><a href="#">voir</a></td>
|
<td>
|
||||||
</tr>
|
<?= $uneFiche['rMontantValide'] ?> €
|
||||||
<tr>
|
</td>
|
||||||
<th scope="row">Octobre</th>
|
<td>
|
||||||
<td>1458 €</td>
|
<?= $uneFiche['eLibelle'] ?>
|
||||||
<td>en cours...</td>
|
</td>
|
||||||
<td><a href="#">voir</a></td>
|
<td><a
|
||||||
</tr>
|
href="index.php?direction=nouvelleFiche&userId=<?= $userId ?>&dateListing=<?= $uneFiche['rMois'] ?>">voir</a>
|
||||||
<tr>
|
</td>
|
||||||
<th scope="row">Septembre</th>
|
|
||||||
<td>1112 €</td>
|
|
||||||
<td>classé</td>
|
|
||||||
<td><a href="#">voir</a></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
PAGINATION:// NE PAS TOUCHER
|
||||||
|
-->
|
||||||
<div class="col-4 d-flex mx-auto">
|
<div class="col-4 d-flex mx-auto">
|
||||||
<nav aria-label="...">
|
<nav aria-label="...">
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
@ -84,12 +82,3 @@ var_dump($_SESSION['test']);
|
|||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1 +1,4 @@
|
|||||||
<h4>BONJOUR VOUS ETES COMPTABLE</h4>
|
<h4>BONJOUR VOUS ETES <?= strtoupper($_SESSION['uType']) ?></h4>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
var_dump($_SESSION);
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
<center>
|
<center>
|
||||||
<h1>Nouvelle Fiche de frais</h1>
|
<h1>Fiche de frais</h1>
|
||||||
<br>
|
<br>
|
||||||
<p>Mois de Novembre 2023</p>
|
<p>Mois de
|
||||||
|
<?= $dateHeader ?>
|
||||||
|
</p>
|
||||||
|
<p class="color-grey" id='idFiche' data-id="<?= $userId . '-' . $date ?>">
|
||||||
|
ID:
|
||||||
|
<?= $userId . '-' . $date ?>
|
||||||
|
</p>
|
||||||
</center>
|
</center>
|
||||||
<br>
|
<br>
|
||||||
<!--
|
<!--
|
||||||
@ -20,23 +26,30 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody class="table-group-divider border-secondary-subtle">
|
<tbody class="table-group-divider border-secondary-subtle">
|
||||||
<?php
|
<?php
|
||||||
foreach ($typesFraisForfaitaires as $key => $value):
|
foreach ($listeFraisForfaitaire as $key => $value):
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr data-id="<?= $value['fId'] ?>" class="fraisForfaitaire">
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
<?= $value['fLibelle'] ?>
|
<?= $value['fLibelle'] ?>
|
||||||
</th>
|
</th>
|
||||||
<td><input type="text" name="fraisForfait-<?= $value['fId'] ?>" class="form-control"></td>
|
|
||||||
<td>
|
<td>
|
||||||
|
<input type="text" name="fraisForfait" class="form-control frsFrt" id="<?= $key ?>"
|
||||||
|
value="<?= $value['lfQuantite'] ?>" <?= $disabled ?>>
|
||||||
|
</td>
|
||||||
|
<td id="mttFrs-<?= $key ?>" data-price="<?= $value['fMontant'] ?>">
|
||||||
<?= $value['fMontant'] ?> €
|
<?= $value['fMontant'] ?> €
|
||||||
</td>
|
</td>
|
||||||
<td>0€</td>
|
<td class="mttFrsTotal" id="totalFrs-<?= $key ?>">
|
||||||
|
<?= $value['fTotal'] ?>€
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="border-0"></td>
|
||||||
|
<td class="prixTotalFrsF table-primary"></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -57,31 +70,87 @@
|
|||||||
<th>Valider</th>
|
<th>Valider</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="table-group-divider border-secondary-subtle">
|
<tbody class="table-group-divider border-secondary-subtle fraisHFGroup">
|
||||||
<tr>
|
<?php
|
||||||
<td scope="row">23/12/2023</td>
|
foreach ($listeFraisHf as $key => $value):
|
||||||
<td>Salle de réunion</td>
|
?>
|
||||||
<td>130 €</td>
|
<tr id="fraisHf-<?= $key ?>" data-id="<?= $value['lhId'] ?>"
|
||||||
<td>facture.pdf</td>
|
class="fraisHF <?= $value['lhRefus'] == 1 ? 'table-danger' : '' ?>" data-id="<?= $value['lhId'] ?>">
|
||||||
<td><button type="button" class="btn btn-outline-primary">Supprimer</button></td>
|
<th scope="row" id="dateFrsHF">
|
||||||
|
<?= $value['lhDate'] ?>
|
||||||
|
</th>
|
||||||
|
<td id="LibelleFrsHF">
|
||||||
|
<?= $value['lhLibelle'] ?>
|
||||||
|
</td>
|
||||||
|
<td id="MttFrsHF">
|
||||||
|
<?= $value['lhMontant'] ?> €
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?= $value['lhJustificatif'] == 1 ? 'ok' : 'non fournis' ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
if ($typeUser === 'comptable') { ?>
|
||||||
|
<button type="button" class="btn btn-outline-primary btnRefuseFraisHf"
|
||||||
|
data-status="<?= $value['lhRefus'] | 0 ?>" id="frsSup-<?= $key ?>" <?= $disabled ?>>
|
||||||
|
<?= ($value['lhRefus']) ? 'Accepter' : 'Refuser' ?>
|
||||||
|
</button>
|
||||||
|
<?php } elseif ($typeUser === 'visiteur') { ?>
|
||||||
|
<button type="button" class="btn btn-outline-primary btnSuprFraisHf" id="frsSup-<?= $key ?>"
|
||||||
|
<?= $disabled ?>>
|
||||||
|
Supprimer
|
||||||
|
</button>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<?php
|
||||||
<td scope="row"><input class="form-control" type="date"></td>
|
endforeach;
|
||||||
<td><input type="text" class="form-control" placeholder="saisir un titre"></td>
|
?>
|
||||||
<td><input type="text" class="form-control" placeholder="Saisir un Montant"></td>
|
<!--
|
||||||
|
Formulaire d'ajout de frais HF
|
||||||
|
-->
|
||||||
|
<?php
|
||||||
|
if ($disabled !== 'disabled' && $typeUser !== 'comptable'):
|
||||||
|
?>
|
||||||
|
<tr class="newFraisForm">
|
||||||
|
<td>
|
||||||
|
<!-- Date form -->
|
||||||
|
<input name="dateHf" class="form-control" id="dateHf" type="date" min="<?= $dateFormHFMin ?>"
|
||||||
|
max="<?= $dateFormHFMax ?>">
|
||||||
|
</td>
|
||||||
|
<td><input type="text" name="libelleHf" id="libelleHf" class="form-control"
|
||||||
|
placeholder="saisir un titre"></td>
|
||||||
|
<td><input type="text" name="mttHf" id="mttHf" class="form-control" placeholder="Saisir un Montant">
|
||||||
|
</td>
|
||||||
<td><input type="file" class="form-control"></td>
|
<td><input type="file" class="form-control"></td>
|
||||||
<td><button type="button" class="btn btn-outline-primary">Valider</button></td>
|
<td><button type="button" class="btn btn-outline-primary validFraisHF">Valider</button></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="border-0"></td>
|
||||||
|
<td class="table-primary" id="total-frais-HF">TOTAL: 0€</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<span class="border-3 border-bottom border-black col-10 mx-auto my-5 d-flex"></span>
|
<!-- TOTAL -->
|
||||||
|
<div style="position:fixed; bottom:5px; right:5px; margin:0; padding:5px 3px;">
|
||||||
<h3 class="fw-bold offset-1">Commentaire (facultatif)</h3>
|
<button type="button" class="btn btn-primary" id="total-fiche">
|
||||||
|
<strong>TOTAL : </strong>
|
||||||
<div class="col-8 d-flex mx-auto">
|
<?= $totalFraisFiche ?>
|
||||||
<textarea name="commentaireFiche" id="commentaireFiche" class="form-control border-black"></textarea>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Affiche le bouton si fiche non cloturé
|
||||||
|
*/
|
||||||
|
if ($status === 'CR'):
|
||||||
|
?>
|
||||||
<div class="col-3 d-flex mx-auto my-5 justify-content-center">
|
<div class="col-3 d-flex mx-auto my-5 justify-content-center">
|
||||||
<button type="button" class="btn btn-outline-primary">Envoyer la Fiche</button>
|
<button type="button" class="btn btn-outline-primary btn-lg" id="sendFileBtn" data-uType="<?= $typeUser ?>">Envoyer
|
||||||
|
la Fiche
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
|
<script src="include/newFiche.js"></script>
|
||||||
|
<!-- <script src="../include/newFiche.js"></script> -->
|
Reference in New Issue
Block a user