From 3b9ec16908681a65f740265a7dbd10c31e5610c5 Mon Sep 17 00:00:00 2001
From: Gulilil <juan.csantoso@gmail.com>
Date: Sat, 7 Oct 2023 15:09:57 +0700
Subject: [PATCH] progress on list edit

---
 app/api/anime_list/add.php    |  7 +++++++
 app/api/anime_list/delete.php |  7 +++++++
 app/api/anime_list/edit.php   |  7 +++++++
 app/public/style/list.css     |  9 ++++++++-
 app/views/Client/list.php     | 21 ++++++++++++++++++++-
 5 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 app/api/anime_list/add.php
 create mode 100644 app/api/anime_list/delete.php
 create mode 100644 app/api/anime_list/edit.php

diff --git a/app/api/anime_list/add.php b/app/api/anime_list/add.php
new file mode 100644
index 0000000..6208315
--- /dev/null
+++ b/app/api/anime_list/add.php
@@ -0,0 +1,7 @@
+<?php
+require_once(dirname(__DIR__,2).'/define.php');
+require_once(BASE_DIR.'/models/Anime_List.php');
+
+$al = new Anime_List();
+
+?>
\ No newline at end of file
diff --git a/app/api/anime_list/delete.php b/app/api/anime_list/delete.php
new file mode 100644
index 0000000..6208315
--- /dev/null
+++ b/app/api/anime_list/delete.php
@@ -0,0 +1,7 @@
+<?php
+require_once(dirname(__DIR__,2).'/define.php');
+require_once(BASE_DIR.'/models/Anime_List.php');
+
+$al = new Anime_List();
+
+?>
\ No newline at end of file
diff --git a/app/api/anime_list/edit.php b/app/api/anime_list/edit.php
new file mode 100644
index 0000000..6208315
--- /dev/null
+++ b/app/api/anime_list/edit.php
@@ -0,0 +1,7 @@
+<?php
+require_once(dirname(__DIR__,2).'/define.php');
+require_once(BASE_DIR.'/models/Anime_List.php');
+
+$al = new Anime_List();
+
+?>
\ No newline at end of file
diff --git a/app/public/style/list.css b/app/public/style/list.css
index 3c13aa9..a09e76e 100644
--- a/app/public/style/list.css
+++ b/app/public/style/list.css
@@ -31,4 +31,11 @@
   background-color: white;
   width: 400px;
   margin:auto;
-}
\ No newline at end of file
+}
+
+.form-vertical {
+  display: flex;
+  flex-direction: column;
+  gap: 10px;  /* Provides space between each item */
+  width: 45%px;  /* Adjust based on your preference */
+}
diff --git a/app/views/Client/list.php b/app/views/Client/list.php
index ed4a6bc..4aa3969 100644
--- a/app/views/Client/list.php
+++ b/app/views/Client/list.php
@@ -19,7 +19,7 @@ $isUserOwn = $al->getAnimeListByID($id)['client_id'] == $c->getClientByUsername(
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Error Page</title>
+    <title>Anime List Page</title>
     <link rel="stylesheet" href="../../public/style/global.css">
     <link rel="stylesheet" href="../../public/style/list.css">
     <script src='/public/handler/navbar.js'></script>
@@ -30,6 +30,25 @@ $isUserOwn = $al->getAnimeListByID($id)['client_id'] == $c->getClientByUsername(
   if ($isUserOwn){
     echo "
       <h1> Anime List ID $id </h1>
+      <form class='form-vertical' action='/api/anime_list/edit.php' method='post' enctype='multipart/form-data'>
+          <!-- Hidden input for client_id -->
+          <input type='hidden' id='editClientId' name='client_id'>
+
+          <label for='editUserScore'>User Score</label>
+          <input type='text' id='editUserScore' name='user_score'>
+
+          <label for='editProgress'>Progress:</label>
+          <input type='text' id='editProgress' name='progress'>
+
+          <label for='editWatchStatus'>WatchStatus:</label>
+          <input type='text' id='editWatchStatus' name='watch_status' required>
+
+          <label for='editReview'>Review:</label>
+          <input type='text' id='editReview' name='review'>
+
+
+          <input type='submit' value='Update Client'>
+      </form>
     ";
   } else {
     echo "
-- 
GitLab