summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/load-events.php11
-rw-r--r--src/post-ajax.php12
2 files changed, 22 insertions, 1 deletions
diff --git a/src/load-events.php b/src/load-events.php
index 5fdc140..686bd06 100644
--- a/src/load-events.php
+++ b/src/load-events.php
@@ -23,7 +23,16 @@ $events = [
23 'end' => '2025-06-09', 23 'end' => '2025-06-09',
24 'allDay' => true, // pas d'heure 24 'allDay' => true, // pas d'heure
25 'color' => '#008000', 25 'color' => '#008000',
26 ] 26 ],
27 // provoque une erreur, si allDay la fin ne peut être égale au début
28 /*[
29 'id' => 4,
30 'title' => 'Évènement4',
31 'start' => '2025-06-09',
32 'end' => '2025-06-09',
33 'allDay' => true,
34 'color' => '#1a5fb4',
35 ],*/
27]; 36];
28 37
29header('Content-Type: application/json'); 38header('Content-Type: application/json');
diff --git a/src/post-ajax.php b/src/post-ajax.php
new file mode 100644
index 0000000..df5a01a
--- /dev/null
+++ b/src/post-ajax.php
@@ -0,0 +1,12 @@
1<?php
2if($_SERVER['REQUEST_METHOD'] === 'POST'){ // && $_SESSION['admin'] === true
3 if($_SERVER['CONTENT_TYPE'] === 'application/json'){
4 $data = file_get_contents('php://input');
5 $json = json_decode($data, true);
6 //var_dump($json);
7
8 $id = isset($json['id']) ? $json['id'] : 7; // = id_event en BDD si nouvel évènement
9 echo json_encode(['success' => true, 'id' => $id]);
10 die;
11 }
12} \ No newline at end of file