{% extends 'custom_admin_base.html' %}
{% block content %}
    {% include 'custom_admin_user_sub.html' %}
    <div class="admin-list">
        <form action="{% url 'company:companySearch' %}" 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="15%" />
                <col width="13%" />
                <col width="7%" />
                <col width="38%" />
                <col width="12%" />
                <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 company in object_list %}
                <tr onclick="as.getCompanyInfo({{ company.pk }})">
                    <th>{{ company.pk }}</th>
                    <td>{{ company.name }}</td>
                    <td>{{ company.corporate_number }}</td>
                    <td>{{ company.ceo }}</td>
                    <td>({{ company.post_code }}) {{ company.address }}<br />{{ company.detail_address }}</td>
                    <td>{{ company.tel }}</td>
                    <td>{% if company.stamp == None or company.stamp == '' %} 등록 필요 {% else %} <img src="{{ company.stamp.url }}" width="35px" height="35px"> {% endif %}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <div class="button-block">
            <a href="{% url 'company:companyRegister' %}" class="admin-add-button">신규등록</a>
            <a href="{% url 'company:companyList' %}" class="admin-add-button">전체목록</a>
        </div>
        {% include 'pagination/pagination.html' %}
    </div>
{% endblock content %}