Compare commits
No commits in common. "a2201a4eb39b8f649c153c695ed978493ec66634" and "4eac346ff2e3e20679a8e45eb10878244b109604" have entirely different histories.
a2201a4eb3
...
4eac346ff2
@ -20,7 +20,7 @@ class Class_gestionFiche
|
|||||||
|
|
||||||
public function get_ListesFiches(string $idUtilisateur): array
|
public function get_ListesFiches(string $idUtilisateur): array
|
||||||
{
|
{
|
||||||
$req = 'SELECT "rMois", "rEtat", "rNbJustificatifs", ROUND("rMontantValide", 2) as "rMontantValide", "eLibelle"
|
$req = 'SELECT "rMois", "rEtat","rNbJustificatifs","rMontantValide","eLibelle"
|
||||||
FROM remboursement
|
FROM remboursement
|
||||||
INNER JOIN etat ON etat."eId"=remboursement."rEtat"
|
INNER JOIN etat ON etat."eId"=remboursement."rEtat"
|
||||||
WHERE "rVisiteur"= :userId
|
WHERE "rVisiteur"= :userId
|
||||||
@ -33,10 +33,5 @@ class Class_gestionFiche
|
|||||||
return $result->fetchAll();
|
return $result->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dateComplete(string $date) : string
|
|
||||||
{
|
|
||||||
return substr($date, 0, 4) . '-' . substr($date, 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ class Class_user
|
|||||||
$this->pdo = $pDO->getPdoGsb();
|
$this->pdo = $pDO->getPdoGsb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function connectUser(string $login, string $password): array|bool
|
public function connectUser(string $login, string $password): array
|
||||||
{
|
{
|
||||||
$req = 'SELECT "uId", "uNom", "uPrenom", "uAdresse", "uCp", "uVille", "uSecteur", "uLabo", "parametre"."pLibelle"
|
$req = 'SELECT "uId", "uNom", "uPrenom", "uAdresse", "uCp", "uVille", "uSecteur", "uLabo", "parametre"."pLibelle"
|
||||||
FROM utilisateur
|
FROM utilisateur
|
||||||
|
@ -6,11 +6,6 @@ if (isset($_POST['login']) && isset($_POST['password'])) {
|
|||||||
//Récupère les données de l'utilisateur
|
//Récupère les données de l'utilisateur
|
||||||
$data = $userClass->connectUser($_POST['login'], $_POST['password']);
|
$data = $userClass->connectUser($_POST['login'], $_POST['password']);
|
||||||
|
|
||||||
if($data == false) {
|
|
||||||
header('location: index.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Si l'utilisateur existe ou pas
|
//Si l'utilisateur existe ou pas
|
||||||
if (count($data) === 0) {
|
if (count($data) === 0) {
|
||||||
header('location: index.php?direction=connexion&msg=errorco');
|
header('location: index.php?direction=connexion&msg=errorco');
|
||||||
|
@ -1,42 +1,17 @@
|
|||||||
<?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');
|
||||||
|
|
||||||
$typeUser = $_SESSION['uType']; //visiteur ou comptable
|
$typeUser = $_SESSION['uType']; //visiteur ou comptable
|
||||||
$typeUser = 'comptable';//$_SESSION['uType']; //visiteur ou comptable
|
// $typeUser = 'comptable';//$_SESSION['uType']; //visiteur ou comptable
|
||||||
$userId = $_SESSION['uId']; //exemple: 'b34'
|
$userId = $_SESSION['uId']; //exemple: 'b34'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gestion de la date selon la vue à afficher
|
* Gestion de la date selon la vue à afficher
|
||||||
*/
|
*/
|
||||||
if (isset($_GET['currentList'])) {
|
if (isset($_GET['currentList'])) {
|
||||||
|
|
||||||
//Date des req SQL et function
|
//Date des req SQL et function
|
||||||
$date = date('Ym');
|
$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
|
//Date du header en français
|
||||||
try {
|
try {
|
||||||
//sudo timedatectl set-local-rtc 1
|
//sudo timedatectl set-local-rtc 1
|
||||||
@ -48,10 +23,18 @@ try {
|
|||||||
IntlDateFormatter::GREGORIAN,
|
IntlDateFormatter::GREGORIAN,
|
||||||
'MMMM Y'
|
'MMMM Y'
|
||||||
);
|
);
|
||||||
$dateHeader = $format->format($dateFormat);
|
$dateHeader = $format->format(time());
|
||||||
|
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
$dateHeader = date('F Y', $dateTimeStamp);
|
$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
|
//$date = '202312'; //TESTVAR
|
||||||
|
@ -195,12 +195,6 @@ function calcPrixTotalFrsF() {
|
|||||||
*/
|
*/
|
||||||
function calcPrixTotalFrsHorsF() {
|
function calcPrixTotalFrsHorsF() {
|
||||||
|
|
||||||
console.log($('td#MttFrsHF').length)
|
|
||||||
|
|
||||||
if ($('td#MttFrsHF').length == 0) {
|
|
||||||
vf
|
|
||||||
}
|
|
||||||
|
|
||||||
var prixTotal = 0;
|
var prixTotal = 0;
|
||||||
$('td#MttFrsHF').each(function () {
|
$('td#MttFrsHF').each(function () {
|
||||||
prixTotal += parseFloat($(this).html().replace('€', ''))
|
prixTotal += parseFloat($(this).html().replace('€', ''))
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<?php foreach ($lesFiches as $uneFiche) { ?>
|
<?php foreach ($lesFiches as $uneFiche) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
<?= $gestionFiche->dateComplete($uneFiche['rMois']) ?>
|
<?= $uneFiche['rMois'] ?>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<?= $uneFiche['rMontantValide'] ?> €
|
<?= $uneFiche['rMontantValide'] ?> €
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<?= $uneFiche['eLibelle'] ?>
|
<?= $uneFiche['eLibelle'] ?>
|
||||||
</td>
|
</td>
|
||||||
<td><a
|
<td><a
|
||||||
href="index.php?direction=nouvelleFiche&userId=<?= $userId ?>&dateListing=<?= $uneFiche['rMois'] ?>">voir</a>
|
href="controleurs\c_nouvelleFiche.php?userId=<?= $userId ?>&dateListing=<?= $uneFiche['rMois'] ?>">voir</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user