mise à jour de la bdd pour les fiches de frais et suppression des hors forfait
This commit is contained in:
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;
|
||||
}
|
Reference in New Issue
Block a user