From 2806694b1d01419752da842a3d7a5edc9f29dd65 Mon Sep 17 00:00:00 2001 From: 65160270 <65160270@go.buu.ac.th> Date: Tue, 25 Mar 2025 15:16:18 +0700 Subject: [PATCH] update-edit --- views/order-details.ejs | 45 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/views/order-details.ejs b/views/order-details.ejs index 45cf64f..1f3ca07 100644 --- a/views/order-details.ejs +++ b/views/order-details.ejs @@ -11,35 +11,36 @@ <div class="info-section"> <h3>Shipping Address</h3> - <p> - <span id="shipping-address"><%= order.shipping_address %></span> - <input type="text" id="new-address" value="<%= order.shipping_address %>" style="display:none;"> - </p> - <button id="edit-btn">แก้ไขที่อยู่</button> - <button id="save-btn" style="display:none;">บันทึก</button> + <p><%= order.shipping_address %></p> </div> </div> <div class="order-items-detail"> <h3>Order Items</h3> <div class="items-grid"> - <% items.forEach(item => { %> - <div class="item-card"> - <img src="<%= item.image_url %>" alt="<%= item.name %>"> - <div class="item-info"> - <h4><%= item.name %></h4> - <p>Quantity: <%= item.quantity %></p> - <p>Price per unit: ฿<%= item.price.toLocaleString() %></p> - <p>Subtotal: ฿<%= (item.price * item.quantity).toLocaleString() %></p> - </div> - </div> - <% }); %> + <table> + <thead> + <tr> + <th>Order ID</th> + <th>Product ID</th> + <th>Product Name</th> + <th>Quantity</th> + <th>Price</th> + </tr> + </thead> + <tbody> + <% items.forEach(item => { %> + <tr> + <td><%= item.order_id %></td> + <td><%= item.product_id %></td> + <td><%= item.name %></td> + <td><%= item.quantity %></td> + <td>฿<%= item.price.toFixed(2) %></td> + </tr> + <% }) %> + </tbody> + </table> </div> </div> - - <div class="order-actions"> - <a href="/order/history" class="back-btn">Back to Order History</a> - <a href="/" class="continue-shopping">Continue Shopping</a> - </div> </div> <%- include('partials/footer') %> \ No newline at end of file -- GitLab