From 6fe24348d59ee3c394c94c08488ac4b895cf857a Mon Sep 17 00:00:00 2001 From: 65160270 <65160270@go.buu.ac.th> Date: Fri, 28 Mar 2025 23:17:24 +0700 Subject: [PATCH] update-cart --- views/product.ejs | 20 ++++++++++---------- views/product_add.ejs | 18 +++++++++--------- views/product_edit.ejs | 20 ++++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/views/product.ejs b/views/product.ejs index f0d89b1..4692966 100644 --- a/views/product.ejs +++ b/views/product.ejs @@ -1,25 +1,25 @@ <!DOCTYPE html> -<html lang="th"> +<html lang="en"> <head> <meta charset="UTF-8"> - <title>รายการสินค้า</title> + <title>Product List</title> </head> <body> - <h2>รายการสินค้า</h2> - <a href="/products/add">เพิ่มสินค้า</a> + <h2>Product List</h2> + <a href="/products/add">Add Product</a> <table border="1"> <tr> - <th>รูป</th> - <th>ชื่อสินค้า</th> - <th>ราคา</th> - <th>จำนวน</th> - <th>คำบรรยาย</th> + <th>Image</th> + <th>Product Name</th> + <th>Price</th> + <th>Stock</th> + <th>Description</th> </tr> <% products.forEach(product => { %> <tr> <td><img src="<%= product.image %>" width="100"></td> <td><%= product.name %></td> - <td><%= product.price %> บาท</td> + <td><%= product.price %> THB</td> <td><%= product.stock %></td> <td><%= product.description %></td> </tr> diff --git a/views/product_add.ejs b/views/product_add.ejs index b6c741c..7d354ea 100644 --- a/views/product_add.ejs +++ b/views/product_add.ejs @@ -1,29 +1,29 @@ <!DOCTYPE html> -<html lang="th"> +<html lang="en"> <head> <meta charset="UTF-8"> - <title>เพิ่มสินค้า</title> + <title>Add Product</title> </head> <body> - <h2>เพิ่มสินค้า</h2> + <h2>Add Product</h2> <form action="/products/add" method="POST" enctype="multipart/form-data"> - <label>ชื่อสินค้า:</label> + <label>Product Name:</label> <input type="text" name="name" required> <br> - <label>ราคา:</label> + <label>Price:</label> <input type="number" name="price" required> <br> - <label>จำนวนสินค้า:</label> + <label>Stock Quantity:</label> <input type="number" name="stock" required> <br> - <label>คำบรรยายสินค้า:</label> + <label>Product Description:</label> <textarea name="description" required><%= product ? product.description : "" %></textarea> <br> - <label>เลือกไฟล์รูปสินค้า:</label> + <label>Select Product Image:</label> <input type="file" name="image" required> <br> - <button type="submit">เพิ่มสินค้า</button> + <button type="submit">Add Product</button> </form> </body> </html> diff --git a/views/product_edit.ejs b/views/product_edit.ejs index a54f07b..b0680d4 100644 --- a/views/product_edit.ejs +++ b/views/product_edit.ejs @@ -1,38 +1,38 @@ <!DOCTYPE html> -<html lang="th"> +<html lang="en"> <head> <meta charset="UTF-8"> - <title>แก้ไขสินค้า</title> + <title>Edit Product</title> </head> <body> - <h2>แก้ไขสินค้า</h2> + <h2>Edit Product</h2> <form action="/products/edit/<%= product.id %>" method="POST" enctype="multipart/form-data"> - <label>รหัสสินค้า:</label> + <label>Product ID:</label> <input type="text" name="product_id" value="<%= product.id %>" readonly> <br> - <label>ชื่อสินค้า:</label> + <label>Product Name:</label> <input type="text" name="name" value="<%= product.name %>" required> <br> - <label>ราคา:</label> + <label>Price:</label> <input type="number" name="price" value="<%= product.price %>" required> <br> - <label>จำนวนสินค้า:</label> + <label>Stock Quantity:</label> <input type="number" name="stock" value="<%= product.stock %>" required> <br> - <label>คำบรรยายสินค้า:</label> + <label>Product Description:</label> <textarea name="description" required><%= product.description %></textarea> <br> - <label>เปลี่ยนรูปภาพ (อัพโหลดใหม่ถ้าต้องการ):</label> + <label>Change Image (Upload a new one if needed):</label> <input type="file" name="image"> <br> - <button type="submit">บันทึกการแก้ไข</button> + <button type="submit">Save Changes</button> </form> </body> </html> -- GitLab