{% extends "base.html" %}

{% block title %}
Add a patient
{% endblock %}

{% block content %}
    <h2>Add a patient</h2>
    {% if result %}
    <table>
    <thead>
        <tr>
            <th>Add</th>
            <th>姓名</th>
            <th>病歷號</th>
            <th>性別</th>
            <th>生日</th>
            <th>地址</th>
            <th>電話</th>
            <th>身份證號</th>
        </tr>
    </thead>
    <tbody>
        {% for patient in result %}
            <tr>
                <td><a href='/patient/add/?ChartNo={{patient.medical_records}}&force=1'><img src="/site_media/img/actions/document-new.png" alt="Add" border=0 title="Add patient to database"/></a></td>
                <td>{{ patient.name }}</td>
                <td>{{ patient.medical_records }}</td>
                <td>{{ patient.gender }}</td>
                <td>{{ patient.birthday }}</td>
                <td>{{ patient.address }}</td>
                <td>{{ patient.phone }}</td>
                <td>{{ patient.id_cards }}</td>
            </tr>
        {% endfor %}
    </tbody>
    </table>
    <hr/>
    {% endif %}
    <form action="." method="POST">{% csrf_token %}
        <table>
            {{ form.as_table }}
        </table>
        <p><input type="submit"></p>
    </form>
{% endblock %}
