{% extends 'wgcomm/base.html' %}

{% block title %}
    Swipe Records
{% endblock %}
{% block tail %}
    <!-- INTERNAL DATATABLES JS -->
    <script src="static/wgcomm/js/table-swipelist.js"></script>
{% endblock %}
{% block tail_min %}
    <!-- INTERNAL DATATABLES JS -->
    <script src="static/wgcomm/js/table-swipelist.min.js"></script>
{% endblock %}
{% block main_content %}
    <!--app-content open-->
    <div class="app-content main-content mt-0">
        <div class="side-app">
            <!-- CONTAINER -->
            <div class="main-container container-fluid">
                <!-- PAGE-HEADER -->
                <div class="page-header">
                    <div>
                        <h1 class="page-title">Swipe Records</h1>
                    </div>
                    <div class="ms-auto pageheader-btn">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">Console</li>
                            <li class="breadcrumb-item"><a href="javascript:void(0);">Swipe Records</a></li>
                            <li class="breadcrumb-item active" aria-current="page">List</li>
                        </ol>
                    </div>
                </div>
                <!-- PAGE-HEADER END -->
                {% with messages = get_flashed_messages() %}
                    {% if messages %}
                        <div class="form-group">
                            <ul>
                                {% for message in messages %}
                                    <li class="text-danger">{{ message }}</li>
                                {% endfor %}
                            </ul>
                        </div>
                    {% endif %}
                {% endwith %}
                <!--ROW OPENED-->
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body tasks-table-container">
                                <div class="table-responsive">
                                    <table id="table-swipelist"
                                           class="table editable-table table-nowrap table-bordered  wp-100 active-tb">
                                        <thead class="table-head">
                                        <tr>
                                            <th class="bg-transparent border-bottom-0 w-5">RecID</th>
                                            <th class="bg-transparent border-bottom-0">Card NO</th>
                                            <th class="bg-transparent border-bottom-0">User ID</th>
                                            <th class="bg-transparent border-bottom-0">Name</th>
                                            <th class="bg-transparent border-bottom-0">Department</th>
                                            <th class="bg-transparent border-bottom-0">Time</th>
                                            <th class="bg-transparent border-bottom-0">Addr</th>
                                            <th class="bg-transparent border-bottom-0">InExit</th>
                                            <th class="bg-transparent border-bottom-0 text-center">Pass</th>
                                            <th class="bg-transparent border-bottom-0">Description</th>
                                        </tr>
                                        </thead>
                                        <tbody class="table-body">
                                        {% for con in objlist %}
                                            <tr id="con-{{ con.f_RecID }}">
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_RecID }}</td>
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_CardNO }}</td>
                                                {% if con.f_ConsumerNO %}
                                                    <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_ConsumerNO }}</td>
                                                    <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_ConsumerName }}</td>
                                                    <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_GroupName }}</td>
                                                {% else %}
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                {% endif %}
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_ReadDate }}</td>
                                                <td class="text-muted fs-15 fw-semibold text-start">
                                                    {% if con.f_DoorName %}{{ con.f_DoorName }}{% endif %}</td>
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_InOut }}</td>
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_Character }}</td>
                                                <td class="text-muted fs-15 fw-semibold text-start">{{ con.f_Desc }}</td>
                                            </tr>
                                        {% endfor %}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--ROW CLOSED-->

            </div>
        </div>
    </div>
    <!-- CONTAINER CLOSED -->
{% endblock %}
