<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Smile Clinic</title>
    <link rel="stylesheet" href="/css/treatmenthistory.css">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet"/>
</head>
<body>
    <div class="sidebar">
        <img alt="Smile Clinic Logo" src="/images/logo.png"/>
        <h2>Smile Clinic</h2>
        <ul class="menu">
            <li>
                <i class="fas fa-calendar-alt"></i>
                ตารางทำงาน
            </li>
            <li>
                <i class="fas fa-calendar-check"></i>
                นัดหมาย
            </li>
            <li class="active">
                <i class="fas fa-file-medical"></i>
                การรักษา
            </li>
        </ul>
    </div>

    <div class="content">
        <h1>Edit Treatment History</h1>

        <form action="/dentist/updatetreatmenthis" method="POST">
            <input type="hidden" name="treatmenthistory_id" value="<%= treatmentHistory.treatmenthistory_id %>">

            <label for="dentist_name">ชื่อแพทย์:</label>
            <input type="text" id="dentist_name" name="dentist_name" value="<%= treatmentHistory.dentist_name %>" required><br><br>

            <label for="tm_details">รายละเอียดการรักษา:</label>
            <textarea id="tm_details" name="tm_details" required><%= treatmentHistory.tm_details %></textarea><br><br>

            <label for="followUpdate">นัดหมายครั้งถัดไป:</label>
            <input type="date" id="followUpdate" name="followUpdate" value="<%= treatmentHistory.followUpdate %>" required><br><br>

            <button type="submit" class="btn btn-success">อัปเดตข้อมูล</button>
        </form>
    </div>   
</body>
</html>
