{% extends "layout.html" %}

{% block title %}
    <p>Editing doctor record</p>
{% endblock %}

{% block body %}
<div class="person_block">
    <div class="photo">
        <img src="{{ data['image_url'] }}" onerror="this.src='/static/photo/face.jpg'"
        width="150" height="150" alt="photo of person">
    </div>
    <div class="name_title">
        {{data['first_name']}} {{data['last_name']}}
    </div>
</div>


<div class="person_data_edit">
    <form action="/edit_doctor/" method="post" enctype="multipart/form-data">
        <table class="table">
            <tr>
                <td>First name</td>
                <td><input type="text" name="first_name" value="{{data['first_name']}}" required></td>
            </tr>
            <tr>
                <td>Last Name</td>
                <td><input type="text" name="last_name" value="{{data['last_name']}}" required></td>
            </tr>
            <tr>
                <td>Grade</td>
                <td><input type="text" name="grade" value="{{data['grade']}}" ></td>
            </tr>
            <tr>
                <td>Specialization</td>
                <td><input type="text" name="specialization" value="{{data['specialization']}}" ></td>
            </tr>
            <tr>
                <td>email</td>
                <td><input type="email" name="email" value="{{data['email']}}" required ></td>
            </tr>
            <tr>
                <td>Photo (up to 200kb. 1:1 ratio. bmp, png, jpg, jfif allowed)</td>
                <td>
                    <input type="file" name="file" placeholder="photo 150x150">
                </td>
            </tr>
        </table>
        <input type="hidden" name="id" value={{data['id']}}>

        <input type="submit" id="button_save" value="SAVE">
    </form>
    
</div>    
{% endblock %}