summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-06-16 02:49:38 +0200
committerpolo <ordipolo@gmx.fr>2025-06-16 02:49:38 +0200
commitebf9c2050339da7a42dd67f09b98af1e92f833a3 (patch)
tree12f7ed11226300a47d7ab98e377aad8d4456f095 /src
parentba4c1d898fbcaa118ab6ff81317ef32839293d66 (diff)
downloadfullcalendar-ebf9c2050339da7a42dd67f09b98af1e92f833a3.zip
front-end plus ou moins terminé
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