Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 391cf327 authored by 65160270's avatar 65160270
Browse files

update-cart

parent cff7ce48
Branches
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
</head>
<body>
<h2>รายการสินค้า</h2>
<a href="/products/add">เพิ่มสินค้า</a>
<a href="/products/add">Add Product</a>
<table border="1">
<tr>
<th>รูป</th>
......
......@@ -2,25 +2,25 @@
<html lang="th">
<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>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:</label>
<input type="number" name="stock" required>
<br>
<label>คำบรรยายสินค้า:</label>
<label>description:</label>
<textarea name="description" required><%= product.description %></textarea>
<br>
<label>เลือกไฟล์รูปสินค้า:</label>
<input type="file" name="image" required>
<label>image:</label>
<input type="file" name="image_url" required>
<br>
<button type="submit">เพิ่มสินค้า</button>
......
......@@ -2,37 +2,37 @@
<html lang="th">
<head>
<meta charset="UTF-8">
<title>แก้ไขสินค้า</title>
<title>Edit</title>
</head>
<body>
<h2>แก้ไขสินค้า</h2>
<h2>Edit</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>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:</label>
<input type="number" name="stock" value="<%= product.stock %>" required>
<br>
<label>คำบรรยายสินค้า:</label>
<label>description:</label>
<textarea name="description" required><%= product.description %></textarea>
<br>
<label>เปลี่ยนรูปภาพ (อัพโหลดใหม่ถ้าต้องการ):</label>
<input type="file" name="image">
<label>image:</label>
<input type="file" name="image_url">
<br>
<button type="submit">บันทึกการแก้ไข</button>
<button type="submit">submit</button>
</form>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment