<!DOCTYPE html>
<html lang="th">
<head>
    <meta charset="UTF-8">
    <title>แก้ไขสินค้า</title>
</head>
<body>
    <h2>แก้ไขสินค้า</h2>
    <form action="/products/edit/<%= product.id %>" method="POST" enctype="multipart/form-data">

        <label>รหัสสินค้า:</label>
        <input type="text" name="product_id" value="<%= product.id %>" readonly>
        <br>

        <label>ชื่อสินค้า:</label>
        <input type="text" name="name" value="<%= product.name %>" required>
        <br>

        <label>ราคา:</label>
        <input type="number" name="price" value="<%= product.price %>" required>
        <br>

        <label>จำนวนสินค้า:</label>
        <input type="number" name="stock" value="<%= product.stock %>" required>
        <br>

        <label>คำบรรยายสินค้า:</label>
        <textarea name="description" required><%= product.description %></textarea>
        <br>

        <label>เปลี่ยนรูปภาพ (อัพโหลดใหม่ถ้าต้องการ):</label>
        <input type="file" name="image">
        <br>

        <button type="submit">บันทึกการแก้ไข</button>
    </form>
</body>
</html>