From 885f2d8fa114432d190db6a8b63e991f47b47eaf Mon Sep 17 00:00:00 2001
From: DewanaGustavus <76590469+DewanaGustavus@users.noreply.github.com>
Date: Thu, 16 Nov 2023 11:58:38 +0700
Subject: [PATCH] feat: history detail

---
 src/components/history/HistoryDetail.php      | 59 +++++++++++++++++++
 .../history/HistoryDetailController.php       |  7 +++
 src/styles/history/HistoryDetail.css          | 40 +++++++++++++
 3 files changed, 106 insertions(+)
 create mode 100644 src/components/history/HistoryDetail.php
 create mode 100644 src/controller/history/HistoryDetailController.php
 create mode 100644 src/styles/history/HistoryDetail.css

diff --git a/src/components/history/HistoryDetail.php b/src/components/history/HistoryDetail.php
new file mode 100644
index 0000000..29a28ea
--- /dev/null
+++ b/src/components/history/HistoryDetail.php
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <title>History</title>
+    <link rel="stylesheet" href="../../styles/Global.css">
+    <link rel="stylesheet" href="../../styles/history/HistoryDetail.css">
+</head>
+
+<body>
+    <?php
+    include(dirname(__DIR__) . '/template/Navbar.php');
+    ?>
+    <div>
+        <h1>Detail history</h1>
+        <div class="container">
+            <?php
+            // TODO : fetch from REST
+            $history = ['courierName' => "jamal", 'shippingCost' => 2, 'rating' => 0, 'historyId' => 1];
+            $productDetails = [
+                ["productName" => "pisau cukur", "quantity" => 69],
+                ["productName" => "ivan gunawan", "quantity" => 420],
+                ["productName" => "pisau cukur 2", "quantity" => 692],
+                ["productName" => "ivan gunawan 2", "quantity" => 4202],
+            ];
+            ?>
+            
+            <label>Nama Kurir : </label> 
+            <p><?=$history['courierName']?></p>
+            <label>Biaya ongkir : </label> 
+            <p><?=$history['shippingCost']?></p>
+            <label>Rating : </label> 
+            <p><?=($history['rating'] === 0) ? 'belum memberi rating' : $history['rating']?></p>
+            <?php 
+                if($history['rating'] === 0) {
+                    // TODO : giving rating
+                }
+            ?>
+            
+            <h3>Product Details</h3>
+            <table>
+                <tr>
+                    <th>Product Name</th>
+                    <th>Quantity</th>
+                </tr>
+                <?php foreach ($productDetails as $product) { ?>
+                    <tr>
+                        <td><?php echo $product['productName']; ?></td>
+                        <td><?php echo $product['quantity']; ?></td>
+                    </tr>
+                <?php } ?>
+            </table>
+
+
+        </div>
+    </div>
+</body>
+</html>
\ No newline at end of file
diff --git a/src/controller/history/HistoryDetailController.php b/src/controller/history/HistoryDetailController.php
new file mode 100644
index 0000000..4689df3
--- /dev/null
+++ b/src/controller/history/HistoryDetailController.php
@@ -0,0 +1,7 @@
+<?php
+
+class HistoryDetailController extends Controller{
+    public function index($id = 0) {
+        $this->render();
+    }
+}
\ No newline at end of file
diff --git a/src/styles/history/HistoryDetail.css b/src/styles/history/HistoryDetail.css
new file mode 100644
index 0000000..14260d6
--- /dev/null
+++ b/src/styles/history/HistoryDetail.css
@@ -0,0 +1,40 @@
+* {
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+}
+
+body {
+    font-family: Arial, sans-serif;
+    line-height: 1.6;
+    background-color: #f5f5f5;
+    color: #333;
+    margin: 0;
+}
+
+.container {
+    max-width: 600px;
+    margin: 0 auto;
+    background-color: #fff;
+    border-radius: 8px;
+    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+    text-align: start;
+}
+
+h1, h3 {
+    text-align: center;
+    margin-bottom: 20px;
+    color: #333;
+}
+
+.container label {
+    font-weight: bold;
+}
+
+.container p {
+    margin-bottom: 10px;
+}
+
+th {
+    text-align: start;
+}
\ No newline at end of file
-- 
GitLab