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

{% block title %}
    Multiple cardsuser
{% endblock %}
{% block tail %}
    <script src="static/wgcomm/js/table-data.js"></script>
    <script src="static/wgcomm/js/extern-multi-card-user-list.js"></script>
{% endblock %}
{% block tail_min %}
    <script src="static/wgcomm/js/table-data.min.js"></script>
    <script src="static/wgcomm/js/extern-multi-card-user-list.min.js"></script>
{% endblock %}
{% block main_content %}

    <!--app-content open-->
    <div class="app-content main-content mt-0" id="allpage">
        <div class="side-app">
            <!-- CONTAINER -->
            <div class="main-container container-fluid">
                <!-- PAGE-HEADER -->
                <div class="page-header">
                    <div>
                        <h1 class="page-title">{{ wgform.f_DoorName.data }}--Select User</h1>
                    </div>
                    <div class="ms-auto pageheader-btn">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">Configuration</li>
                            <li class="breadcrumb-item"><a href="javascript:void(0);">Multiple cards</a></li>
                            <li class="breadcrumb-item active" aria-current="page">Select User</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 %}
                <button onclick="history.back()" class="btn btn-outline-danger">Back</button>
                <p class="card-text text-warning" id="opSelectedResultInfo" hidden>
                </p>

                <!--ROW OPENED-->
                <div class="row">
                    <div class="col-lg-8 col-xl-8">
                        <div class="col-md-12">
                            <div class="card">
                                <div id="calendar3" class="fc fc-media-screen fc-direction-ltr fc-theme-standard">
                                    <div class="card-body">
                                        <div class="fc-view-harness fc-view-harness-active" style="height: 500px;">
                                            <div class="fc-list  fc-list-sticky fc-listMonth-view fc-view">
                                                <div class="fc-scroller fc-scroller-liquid" id="logscroll"
                                                     style="overflow: hidden auto;">
                                                    <div class="table-responsive">
                                                        <table class="table table-bordered text-nowrap border-bottom wp-100 active-tb"
                                                                {#                                                               id="basic-datatable">#}
                                                               id="responsive-datatableUser">
                                                            <thead class="table-head">

                                                            <tr>
                                                                <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">Status</th>
                                                                <th class="bg-transparent border-bottom-0">Operation</th>
                                                            </tr>
                                                            </thead>
                                                            <tbody class="table-body">
                                                            {% for con in objlist %}
                                                                <tr id="con-{{ con.f_ConsumerID }}">
                                                                    <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"
                                                                        id="groupid-{{ con.f_ConsumerID }}">
                                                                        {% if con.f_MoreCards_GrpID==None or con.f_MoreCards_GrpID==0 %}
                                                                        {% else %}
                                                                            Selected
                                                                        {% endif %}
                                                                    </td>
                                                                    <td>
                                                                        <div class="d-flex align-items-stretch">
                                                                            <button href="#"
                                                                                    class="btn btn-icon btn-primary-light me-2 active-btn"
                                                                                    data-id="{{ con.f_ConsumerID }}"
                                                                                    data-name="1"
                                                                                    data-label="{{ wgform.f_DoorID.data }}"
                                                                                    {#                                                                    data-url="{{ multicardUrl }}"#}
                                                                                    data-op="select"
                                                                                    data-bs-toggle="tooltip" title=""
                                                                                    data-bs-original-title="Selected"
                                                                                    id="select-{{ con.f_ConsumerID }}">
                                                                                Selected
                                                                                <i class="fe fe-edit"></i>
                                                                            </button>
                                                                            <button href="#"
                                                                                    class="btn btn-icon btn-warning-light me-2 active-btn"
                                                                                    data-id="{{ con.f_ConsumerID }}"
                                                                                    data-name="0"
                                                                                    data-label="{{ wgform.f_DoorID.data }}"
                                                                                    {#                                                                    data-url="{{ losecardUrl }}"#}
                                                                                    data-op="unselect"
                                                                                    data-bs-toggle="tooltip" title=""
                                                                                    data-bs-original-title="unregister"
                                                                                    id="unselect-{{ con.f_ConsumerID }}">
                                                                                unregister
                                                                                <i class="fe fe-shield-off"></i>
                                                                            </button>
                                                                        </div>
                                                                    </td>
                                                                </tr>
                                                            {% endfor %}
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--ROW CLOSED-->
            </div>
        </div>
    </div>
    <!-- CONTAINER CLOSED -->
{% endblock %}
