{% extends 'custom_admin_base.html' %}
{% block content %}
    {% include 'order_contract/custom_admin/custom_admin_order_sub.html' %}
    <div class="change_list">
        <form action="{% url 'order_contract:custom_admin_order_list' %}" method="get" class="search-form">
            <input type="text" name="search_word" placeholder="이름으로검색"><input type="submit" value="검색">
        </form>
        <table cellpadding="0" cellspacing="0">
            <colgroup>
                <col width="5%" />
                <col width="7%" />
                <col width="15%" />
                <col width="10%" />
                <col width="40%" />
                <col width="13%" />
                <col width="10%" />
            </colgroup>
            <thead>
                <tr>
                    <th>No.</th>
                    <th>연도</th>
                    <th>유치원</th>
                    <th>주문명</th>
                    <th>진행단계</th>
                    <th>최종진행일</th>
                    <th>담당자</th>
                </tr>
            </thead>
            <tbody>
            {% for object in object_list %}
                <tr>
                    <td>{{ object.pk }}</td>
                    <td>{{ object.create_date|date:"y년" }}</td>
                        {% if object.order_status == 5 %}
                            <td><a href="{% url 'order_contract:contract_complete' object.id %}">{{ object.kindergarten }}</a></td>
                            <td><a href="{% url 'order_contract:contract_complete' object.id %}">{{ object.name }}</a></td>
                        {% else %}
                            <td>{{ object.kindergarten }}</td>
                            <td>{{ object.name }}</td>
                        {% endif %}
                    <td>
                        {% if object.order_status == 1 %}
                            <img class="progressbar" src="/static/base/image/progressbar0.gif">
                        {% elif object.order_status == 2 %}
                            <img class="progressbar" src="/static/base/image/progressbar1.gif">
                        {% elif object.order_status == 3 %}
                            <img class="progressbar" src="/static/base/image/progressbar2.gif">
                        {% elif object.order_status == 4 %}
                            <img class="progressbar" src="/static/base/image/progressbar3.gif">
                        {% else %}
                            <a href="{% url 'order_contract:contract_complete' object.id %}"><img class="progressbar" src="/static/base/image/progressbar4.gif"></a>
                        {% endif %}
                    </td>
                    <td>{{ object.modify_date|date:"Y년 M d일" }}</td>
                    <td>{{ object.kindergarten.user_profile.user_name }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        {% include 'pagination/pagination.html' %}
    </div>
{% endblock content %}