diff --git a/admin/api/delete-chapter.php b/admin/api/delete-chapter.php
new file mode 100644
index 0000000..cb05dbb
--- /dev/null
+++ b/admin/api/delete-chapter.php
@@ -0,0 +1,39 @@
+ 'Non autorisé']));
+}
+
+$input = json_decode(file_get_contents('php://input'), true);
+$storyId = $input['storyId'] ?? '';
+$chapterId = $input['chapterId'] ?? '';
+
+if (!$storyId || !$chapterId) {
+ http_response_code(400);
+ exit(json_encode(['error' => 'Paramètres manquants']));
+}
+
+try {
+ $story = Stories::get($storyId);
+ if (!$story) {
+ throw new Exception('Roman non trouvé');
+ }
+
+ // Filtrer les chapitres pour retirer celui à supprimer
+ $story['chapters'] = array_values(array_filter($story['chapters'], function($chapter) use ($chapterId) {
+ return $chapter['id'] !== $chapterId;
+ }));
+
+ // Sauvegarder les modifications
+ Stories::save($story);
+
+ echo json_encode(['success' => true]);
+} catch (Exception $e) {
+ http_response_code(500);
+ echo json_encode(['error' => $e->getMessage()]);
+}
\ No newline at end of file
diff --git a/admin/api/get-chapter.php b/admin/api/get-chapter.php
new file mode 100644
index 0000000..57edcb3
--- /dev/null
+++ b/admin/api/get-chapter.php
@@ -0,0 +1,43 @@
+ 'Non autorisé']));
+}
+
+$storyId = $_GET['storyId'] ?? '';
+$chapterId = $_GET['chapterId'] ?? '';
+
+if (!$storyId || !$chapterId) {
+ http_response_code(400);
+ exit(json_encode(['error' => 'Paramètres manquants']));
+}
+
+try {
+ $story = Stories::get($storyId);
+ if (!$story) {
+ throw new Exception('Roman non trouvé');
+ }
+
+ $chapter = null;
+ foreach ($story['chapters'] as $ch) {
+ if ($ch['id'] === $chapterId) {
+ $chapter = $ch;
+ break;
+ }
+ }
+
+ if (!$chapter) {
+ throw new Exception('Chapitre non trouvé');
+ }
+
+ header('Content-Type: application/json');
+ echo json_encode($chapter);
+} catch (Exception $e) {
+ http_response_code(500);
+ echo json_encode(['error' => $e->getMessage()]);
+}
\ No newline at end of file
diff --git a/admin/api/reorder-chapters.php b/admin/api/reorder-chapters.php
new file mode 100644
index 0000000..417c613
--- /dev/null
+++ b/admin/api/reorder-chapters.php
@@ -0,0 +1,48 @@
+ 'Non autorisé']));
+}
+
+$input = json_decode(file_get_contents('php://input'), true);
+$storyId = $input['storyId'] ?? '';
+$newOrder = $input['chapters'] ?? [];
+
+if (!$storyId || empty($newOrder)) {
+ http_response_code(400);
+ exit(json_encode(['error' => 'Paramètres manquants']));
+}
+
+try {
+ $story = Stories::get($storyId);
+ if (!$story) {
+ throw new Exception('Roman non trouvé');
+ }
+
+ // Créer un tableau temporaire pour le nouvel ordre
+ $reorderedChapters = [];
+ foreach ($newOrder as $item) {
+ foreach ($story['chapters'] as $chapter) {
+ if ($chapter['id'] === $item['id']) {
+ $reorderedChapters[] = $chapter;
+ break;
+ }
+ }
+ }
+
+ // Mettre à jour l'ordre des chapitres
+ $story['chapters'] = $reorderedChapters;
+
+ // Sauvegarder les modifications
+ Stories::save($story);
+
+ echo json_encode(['success' => true]);
+} catch (Exception $e) {
+ http_response_code(500);
+ echo json_encode(['error' => $e->getMessage()]);
+}
\ No newline at end of file
diff --git a/admin/index.php b/admin/index.php
index 7f88b07..798b9cd 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -39,7 +39,10 @@ $stories = Stories::getAll();
Dernière modification : = htmlspecialchars($story['updated']) ?>
+
+ = count($story['chapters'] ?? []) ?> chapitre= count($story['chapters'] ?? []) > 1 ? 's' : '' ?>
+ Dernière modification : = htmlspecialchars(Stories::formatDate($story['updated'])) ?>
+