Compare commits
10 Commits
v0.0.1b-pr
...
v0.0.1g-pr
Author | SHA1 | Date | |
---|---|---|---|
df7599ab9b | |||
f08b18fab5 | |||
9f245f6578 | |||
85c00fde0a | |||
d279249503 | |||
1db0ab4873 | |||
53179a0a85 | |||
fa1bacb404 | |||
e55df1b480 | |||
5b5e5cc28e |
26
Class/class.gestionFiche.php
Normal file
26
Class/class.gestionFiche.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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 utilisateur(string $idUtilisateur): array
|
||||
{
|
||||
$req = '';
|
||||
}
|
||||
|
||||
}
|
@ -1,37 +1,219 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* OBJECT QUI GERE LA PARTIE AFFICHAGE D'UNE FICHE
|
||||
*/
|
||||
|
||||
class Class_newFiche
|
||||
{
|
||||
private $pdo = null;
|
||||
private $month;
|
||||
private $userId;
|
||||
|
||||
|
||||
public function __construct(PdoGsb $pDO)
|
||||
public function __construct(PdoGsb $pDO, string $userId, string $month)
|
||||
{
|
||||
$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
|
||||
{
|
||||
$req = 'SELECT "fLibelle", "fMontant" 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->execute();
|
||||
|
||||
return $result->fetchAll();
|
||||
}
|
||||
|
||||
public function endInter(string $id)
|
||||
/**
|
||||
* Liste les frais Forfetaires d'un user pour 1 mois
|
||||
*/
|
||||
public function listFraisForfaitForU(): array
|
||||
{
|
||||
$req = "UPDATE intervention
|
||||
SET iHeureFin = NOW()
|
||||
WHERE iCis = :cis AND iId = :idInter AND iHeureFin IS NULL";
|
||||
$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;';
|
||||
|
||||
$cis = explode('-', $id)[0];
|
||||
$idInter = explode('-', $id)[1];
|
||||
|
||||
$result = PdoBD::$monPdo->prepare($req);
|
||||
$result->bindParam(':cis', $cis);
|
||||
$result->bindParam(':idInter', $idInter);
|
||||
$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
|
||||
{
|
||||
$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"
|
||||
|
||||
WHERE "rVisiteur" = :idVisiteur AND "rMois" = :mois
|
||||
ORDER BY "lhDate";';
|
||||
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam(':idVisiteur', $this->userId);
|
||||
$result->bindParam(':mois', $this->month);
|
||||
$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 "rVisiteur" = :userId AND "rMois" = :monthF AND "lhId" = :idFrais;';
|
||||
$result = $this->pdo->prepare($req);
|
||||
$result->bindParam(':stateF', $state);
|
||||
$result->bindParam(':idFrais', $idFrais);
|
||||
$result->bindParam(':userId', $this->userId);
|
||||
$result->bindParam(':monthF', $this->month);
|
||||
|
||||
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
|
||||
{
|
||||
$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();
|
||||
}
|
||||
}
|
40
controleurs/c_actionFiche.php
Normal file
40
controleurs/c_actionFiche.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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;
|
||||
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
}
|
@ -1,12 +1,35 @@
|
||||
<?php
|
||||
// ***************************************'
|
||||
// Le CASTEL-BTS SIO/ PROJET PPE4 GSB '
|
||||
// Programme: c_connexion.php v2.0 '
|
||||
// Objet : gestion remboursements frais'
|
||||
// Client : laboratoires GSB '
|
||||
// Date : 03/05/2023 à 11H01 '
|
||||
// Auteur : pascal-blain@wanadoo.fr '
|
||||
//****************************************'
|
||||
require_once(__DIR__ . '/../Class/class.user.php');
|
||||
|
||||
$userClass = new Class_user($pdo);
|
||||
if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||
//Récupère les données de l'utilisateur
|
||||
$data = $userClass->connectUser($_POST['login'], $_POST['password']);
|
||||
|
||||
//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');
|
||||
|
||||
if (!isset($_REQUEST['action'])) {
|
||||
@ -44,7 +67,7 @@ switch ($action) {
|
||||
$leMoisPrecedent = (date('Y') - 1) * 100 + 12;
|
||||
}
|
||||
//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');
|
||||
$leRemboursement = $pdo->existeRemboursement($id, $leMois);
|
||||
if ($leRemboursement == 0) {
|
||||
@ -61,4 +84,5 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
*/
|
||||
|
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;
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
@ -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,9 @@
|
||||
<?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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
include("vues/v_gestionFiches.php");
|
||||
|
@ -1,9 +1,70 @@
|
||||
<?php
|
||||
require_once(__DIR__ . '/../Class/class.newFiche.php');
|
||||
|
||||
$newFiche = new Class_newFiche($pdo);
|
||||
$liste = $newFiche->listFraisForfaitaires();
|
||||
$typeUser = $_SESSION['uType']; //visiteur ou comptable
|
||||
//$typeUser = 'comptable';//$_SESSION['uType']; //visiteur ou comptable
|
||||
$userId = $_SESSION['uId']; //exemple: 'b34'
|
||||
|
||||
var_dump($liste);
|
||||
/**
|
||||
* Gestion de la date selon la vue à afficher
|
||||
*/
|
||||
if (isset($_GET['currentList'])) {
|
||||
//Date des req SQL et function
|
||||
$date = date('Ym');
|
||||
|
||||
//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(time());
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
$dateHeader = date('F Y');
|
||||
}
|
||||
|
||||
//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'])) {
|
||||
$date = $_GET['dateListing'];
|
||||
}
|
||||
|
||||
$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');
|
||||
|
@ -1,10 +1,12 @@
|
||||
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 $bdd='dbname=gsb2021';
|
||||
private static $user='root' ;
|
||||
private static $mdp='root' ;
|
||||
|
||||
private static $bdd='dbname=gsb2021';
|
||||
private static $user='root' ;
|
||||
private static $mdp='root' ;
|
||||
|
||||
gsb.ini:
|
||||
[database]
|
||||
driver = mysql
|
||||
@ -12,22 +14,23 @@ host = localhost
|
||||
port = 3306
|
||||
schema = gsb2021
|
||||
username = root
|
||||
password = root
|
||||
password = root
|
||||
|
||||
|
||||
|
||||
Database connection:
|
||||
<?php
|
||||
class MyPDO extends PDO
|
||||
{
|
||||
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'] .
|
||||
':host=' . $settings['database']['host'] .
|
||||
((!empty($settings['database']['port'])) ? (';port=' . $settings['database']['port']) : '') .
|
||||
';dbname=' . $settings['database']['schema'];
|
||||
|
||||
':host=' . $settings['database']['host'] .
|
||||
((!empty($settings['database']['port'])) ? (';port=' . $settings['database']['port']) : '') .
|
||||
';dbname=' . $settings['database']['schema'];
|
||||
|
||||
parent::__construct($dns, $settings['database']['username'], $settings['database']['password']);
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@
|
||||
</a>
|
||||
<ul class="collapse show nav flex-column ms-1" id="submenu1" data-bs-parent="#menu">
|
||||
<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>
|
||||
</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>
|
||||
</li>
|
||||
</ul>
|
||||
@ -44,7 +44,7 @@
|
||||
</a>
|
||||
<ul class="collapse show nav flex-column ms-1" id="submenu2" data-bs-parent="#menu">
|
||||
<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>
|
||||
</li>
|
||||
<li>
|
||||
@ -68,7 +68,7 @@
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
195
include/newFiche.js
Normal file
195
include/newFiche.js
Normal file
@ -0,0 +1,195 @@
|
||||
$(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();
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
/**
|
||||
* 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,
|
||||
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,
|
||||
method: "POST",
|
||||
data: data,
|
||||
}).done(function () {
|
||||
location.reload();
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Calcul prix total frais forfaitaires
|
||||
*/
|
||||
function calcPrixTotalFrsF() {
|
||||
|
||||
var prixTotal = 0;
|
||||
$('td[id^="totalFrs-"]').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() {
|
||||
|
||||
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) + ' €')
|
||||
}
|
27
index.php
27
index.php
@ -14,19 +14,20 @@ session_start();
|
||||
require_once("Class/class.pdo.php");
|
||||
|
||||
$pdo = new PdoGsb();
|
||||
//$estConnecte = estConnecte();
|
||||
$_SESSION['typeU'] = 'visiteur';
|
||||
/*
|
||||
if (!isset($_SESSION['userId'])) {
|
||||
$_REQUEST['direction'] = 'connexion';
|
||||
}
|
||||
*/
|
||||
if (!isset($_REQUEST['direction'])) {
|
||||
|
||||
/**
|
||||
* Direction si non renseigné et non connecté
|
||||
*/
|
||||
if (!isset($_REQUEST['direction']) && !isset($_SESSION['uId'])) {
|
||||
$_REQUEST['direction'] = 'connexion';
|
||||
} elseif (!isset($_REQUEST['direction']) && isset($_SESSION['uId'])) {
|
||||
$_REQUEST['direction'] = 'home';
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<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"
|
||||
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.js"
|
||||
integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<?php
|
||||
include('include/menu.php');
|
||||
if (!isset($_SESSION['uId'])) {
|
||||
$_REQUEST['direction'] = 'connexion';
|
||||
} else {
|
||||
include('include/menu.php');
|
||||
}
|
||||
?>
|
||||
<div class="col py-3">
|
||||
<?php
|
||||
@ -53,7 +60,7 @@ if (!isset($_REQUEST['direction'])) {
|
||||
break;
|
||||
|
||||
case 'gestionFiche':
|
||||
include("controleurs/c_gestionFiche.php");
|
||||
include(__DIR__ . "/controleurs/c_gestionFiche.php");
|
||||
break;
|
||||
|
||||
case 'home':
|
||||
|
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 -->
|
||||
<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">
|
||||
<h2>Identification utilisateur</h2>
|
||||
|
||||
@ -6,13 +53,13 @@
|
||||
<form method="POST" action="index.php?uc=connexion&action=valideConnexion">
|
||||
|
||||
|
||||
<p>
|
||||
<p>
|
||||
<label for="nom">Login*</label>
|
||||
<input id="login" type="text" name="login" size="30" maxlength="45">
|
||||
</p>
|
||||
<p>
|
||||
<label for="mdp">Mot de passe*</label>
|
||||
<input id="mdp" type="password" name="mdp" size="30" maxlength="45">
|
||||
<p>
|
||||
<label for="mdp">Mot de passe*</label>
|
||||
<input id="mdp" type="password" name="mdp" size="30" maxlength="45">
|
||||
</p>
|
||||
<input type="submit" value="Valider" name="valider">
|
||||
<input type="reset" value="Annuler" name="annuler">
|
||||
|
@ -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>'; ?>
|
@ -1,95 +1,76 @@
|
||||
<?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>
|
||||
<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>';
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
<center>
|
||||
<div class="col-3 mb-4">
|
||||
<br>
|
||||
<?php
|
||||
if ($_SESSION['typeU'] != 'comptable') {
|
||||
echo '<h3>Gérer mes fiches de frais</h3>';
|
||||
} else {
|
||||
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'];
|
||||
|
||||
echo '<option value="' . $id . '">' . $nom . " " . $prenom . "</option>";
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
<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>
|
||||
|
||||
</html>
|
||||
<!--
|
||||
PAGINATION:// NE PAS TOUCHER
|
||||
-->
|
||||
<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>
|
@ -1 +1,4 @@
|
||||
<h4>BONJOUR VOUS ETES COMPTABLE</h4>
|
||||
<h4>BONJOUR VOUS ETES <?= strtoupper($_SESSION['uType']) ?></h4>
|
||||
<?php
|
||||
|
||||
var_dump($_SESSION);
|
||||
|
@ -1,9 +1,17 @@
|
||||
<center>
|
||||
<h1>Nouvelle Fiche de frais</h1>
|
||||
<h1>Fiche de frais</h1>
|
||||
<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>
|
||||
<br>
|
||||
<!--
|
||||
Liste des frais forfaitaires
|
||||
-->
|
||||
<h3 class="fw-bold offset-1">Frais forfaitaires</h3>
|
||||
<div class="col-11 d-flex mx-auto my-3">
|
||||
<table class="table table-striped-columns align-middle">
|
||||
@ -16,17 +24,39 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider border-secondary-subtle">
|
||||
<?php
|
||||
foreach ($listeFraisForfaitaire as $key => $value):
|
||||
?>
|
||||
<tr data-id="<?= $value['fId'] ?>" class="fraisForfaitaire">
|
||||
<th scope="row">
|
||||
<?= $value['fLibelle'] ?>
|
||||
</th>
|
||||
<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'] ?> €
|
||||
</td>
|
||||
<td class="mttFrsTotal" id="totalFrs-<?= $key ?>">
|
||||
<?= $value['fTotal'] ?>€
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row">Hotel</th>
|
||||
<td><input type="text" class="form-control"></td>
|
||||
<td>20 €</td>
|
||||
<td>400€</td>
|
||||
<td colspan="3" class="border-0"></td>
|
||||
<td class="prixTotalFrsF table-primary"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<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>
|
||||
<div class="col-11 d-flex mx-auto my-3">
|
||||
<table class="table table-striped-columns align-middle">
|
||||
@ -39,31 +69,93 @@
|
||||
<th>Valider</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider border-secondary-subtle">
|
||||
<tbody class="table-group-divider border-secondary-subtle fraisHFGroup">
|
||||
<?php
|
||||
foreach ($listeFraisHf as $key => $value):
|
||||
?>
|
||||
<tr id="fraisHf-<?= $key ?>" data-id="<?= $value['lhId'] ?>" class="fraisHF <?= $value['lhRefus'] == 1 ? 'table-danger' : '' ?>"
|
||||
data-id="<?= $value['lhId'] ?>">
|
||||
<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" id="frsSup-<?= $key ?>"
|
||||
<?= $disabled ?>>
|
||||
Refuser
|
||||
</button>
|
||||
<?php } elseif ($typeUser === 'visiteur') { ?>
|
||||
<button type="button" class="btn btn-outline-primary btnSuprFraisHf" id="frsSup-<?= $key ?>"
|
||||
<?= $disabled ?>>
|
||||
Supprimer
|
||||
</button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<!--
|
||||
Formulaire d'ajout de frais HF
|
||||
-->
|
||||
<?php
|
||||
if ($disabled !== 'disabled'):
|
||||
?>
|
||||
<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><button type="button" class="btn btn-outline-primary validFraisHF">Valider</button></td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<tr>
|
||||
<td scope="row">23/12/2023</td>
|
||||
<td>Salle de réunion</td>
|
||||
<td>130 €</td>
|
||||
<td>facture.pdf</td>
|
||||
<td><button type="button" class="btn btn-outline-primary">Supprimer</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row"><input class="form-control" type="date"></td>
|
||||
<td><input type="text" class="form-control" placeholder="saisir un titre"></td>
|
||||
<td><input type="text" class="form-control" placeholder="Saisir un Montant"></td>
|
||||
<td><input type="file" class="form-control"></td>
|
||||
<td><button type="button" class="btn btn-outline-primary">Valider</button></td>
|
||||
<td colspan="2" class="border-0"></td>
|
||||
<td class="table-primary" id="total-frais-HF">TOTAL: 0€</td> <!--COMPLETE HERE -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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> -->
|
||||
<!-- TOTAL -->
|
||||
<div style="position:fixed; bottom:5px; right:5px; margin:0; padding:5px 3px;">
|
||||
<button type="button" class="btn btn-primary" id="total-fiche">
|
||||
<strong>TOTAL : </strong>
|
||||
<?= $totalFraisFiche ?>
|
||||
</button>
|
||||
</div>
|
||||
<!--
|
||||
<h3 class="fw-bold offset-1">Commentaire (facultatif)</h3>
|
||||
|
||||
<div class="col-8 d-flex mx-auto">
|
||||
<textarea name="commentaireFiche" id="commentaireFiche" class="form-control border-black"></textarea>
|
||||
</div>
|
||||
<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>
|
||||
</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">
|
||||
<button type="button" class="btn btn-outline-primary btn-lg" id="sendFileBtn" data-uType="<?= $typeUser ?>">Envoyer la Fiche
|
||||
</button>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<script src="../include/newFiche.js"></script>
|
Reference in New Issue
Block a user