Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 6fe24348 authored by 65160270's avatar 65160270
Browse files

update-cart

parent 96a1d042
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html> <!DOCTYPE html>
<html lang="th"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>รายการสินค้า</title> <title>Product List</title>
</head> </head>
<body> <body>
<h2>รายการสินค้า</h2> <h2>Product List</h2>
<a href="/products/add">เพิ่มสินค้า</a> <a href="/products/add">Add Product</a>
<table border="1"> <table border="1">
<tr> <tr>
<th>รูป</th> <th>Image</th>
<th>ชื่อสินค้า</th> <th>Product Name</th>
<th>ราคา</th> <th>Price</th>
<th>จำนวน</th> <th>Stock</th>
<th>คำบรรยาย</th> <th>Description</th>
</tr> </tr>
<% products.forEach(product => { %> <% products.forEach(product => { %>
<tr> <tr>
<td><img src="<%= product.image %>" width="100"></td> <td><img src="<%= product.image %>" width="100"></td>
<td><%= product.name %></td> <td><%= product.name %></td>
<td><%= product.price %> บาท</td> <td><%= product.price %> THB</td>
<td><%= product.stock %></td> <td><%= product.stock %></td>
<td><%= product.description %></td> <td><%= product.description %></td>
</tr> </tr>
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="th"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>เพิ่มสินค้า</title> <title>Add Product</title>
</head> </head>
<body> <body>
<h2>เพิ่มสินค้า</h2> <h2>Add Product</h2>
<form action="/products/add" method="POST" enctype="multipart/form-data"> <form action="/products/add" method="POST" enctype="multipart/form-data">
<label>ชื่อสินค้า:</label> <label>Product Name:</label>
<input type="text" name="name" required> <input type="text" name="name" required>
<br> <br>
<label>ราคา:</label> <label>Price:</label>
<input type="number" name="price" required> <input type="number" name="price" required>
<br> <br>
<label>จำนวนสินค้า:</label> <label>Stock Quantity:</label>
<input type="number" name="stock" required> <input type="number" name="stock" required>
<br> <br>
<label>คำบรรยายสินค้า:</label> <label>Product Description:</label>
<textarea name="description" required><%= product ? product.description : "" %></textarea> <textarea name="description" required><%= product ? product.description : "" %></textarea>
<br> <br>
<label>เลือกไฟล์รูปสินค้า:</label> <label>Select Product Image:</label>
<input type="file" name="image" required> <input type="file" name="image" required>
<br> <br>
<button type="submit">เพิ่มสินค้า</button> <button type="submit">Add Product</button>
</form> </form>
</body> </body>
</html> </html>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="th"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>แก้ไขสินค้า</title> <title>Edit Product</title>
</head> </head>
<body> <body>
<h2>แก้ไขสินค้า</h2> <h2>Edit Product</h2>
<form action="/products/edit/<%= product.id %>" method="POST" enctype="multipart/form-data"> <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> <input type="text" name="product_id" value="<%= product.id %>" readonly>
<br> <br>
<label>ชื่อสินค้า:</label> <label>Product Name:</label>
<input type="text" name="name" value="<%= product.name %>" required> <input type="text" name="name" value="<%= product.name %>" required>
<br> <br>
<label>ราคา:</label> <label>Price:</label>
<input type="number" name="price" value="<%= product.price %>" required> <input type="number" name="price" value="<%= product.price %>" required>
<br> <br>
<label>จำนวนสินค้า:</label> <label>Stock Quantity:</label>
<input type="number" name="stock" value="<%= product.stock %>" required> <input type="number" name="stock" value="<%= product.stock %>" required>
<br> <br>
<label>คำบรรยายสินค้า:</label> <label>Product Description:</label>
<textarea name="description" required><%= product.description %></textarea> <textarea name="description" required><%= product.description %></textarea>
<br> <br>
<label>เปลี่ยนรูปภาพ (อัพโหลดใหม่ถ้าต้องการ):</label> <label>Change Image (Upload a new one if needed):</label>
<input type="file" name="image"> <input type="file" name="image">
<br> <br>
<button type="submit">บันทึกการแก้ไข</button> <button type="submit">Save Changes</button>
</form> </form>
</body> </body>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment