-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop.php
53 lines (41 loc) · 1.36 KB
/
top.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
require 'vendor/autoload.php';
require 'include/web-functions.php';
use App\Cas;
use App\DroitsUtilisateur;
const VIEW_SERVICES = "services";
const VIEW_ETABS = "etabs";
function main(): void {
try {
$cas = Cas::getInstance();
$cas->init();
$mois = $_POST["mois"];
$serviceId = $_POST["serviceId"];
$departement = [];
$etabType = [];
$etabType2 = [];
if (isset($_POST["departement"])) {
$departement = array_map('intval', $_POST["departement"]);
}
if (isset($_POST["etabType"])) {
$etabType = array_map('intval', $_POST["etabType"]);
}
if (isset($_POST["etabType2"])) {
$etabType2 = array_map('intval', $_POST["etabType2"]);
}
if(!is_numeric($mois)) {
throw new Exception('donnée de mois invalide');
}
if(!is_numeric($serviceId)) {
throw new Exception('donnée de service invalide');
}
$mois = intval($mois);
$serviceId = intval($serviceId);
$droitsUtilisateur = new DroitsUtilisateur();
$templateDate = ['table' => getTopData($droitsUtilisateur, $serviceId, $mois, $departement, $etabType, $etabType2)];
echo renderTwig('top.html.twig', $templateDate);
} catch (Exception $e) {
showException($e);
}
}
main();