{% extends 'wgcomm/base.html' %}
{% block tail %}
    <script src="static/wgcomm/js/datepicker.js"></script>
    <script src="static/wgcomm/js/wgdatepicker.js"></script>
    <script src="{{ url_for('static',filename='wgcomm/js/help-faq.js') }}"></script>
{% endblock %}
{% block tail_min %}
    <script src="static/wgcomm/js/datepicker.min.js"></script>
    <script src="static/wgcomm/js/wgdatepicker.min.js"></script>
    <script src="{{ url_for('static',filename='wgcomm/js/help-faq.min.js') }}"></script>
{% endblock %}
{% block title %}
    Startup
{% 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">FAQ</h1>
                    </div>
                    <div class="ms-auto pageheader-btn">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">Help</li>
                            <li class="breadcrumb-item"><a href="javascript:void(0);">FAQ</a></li>
                            <li class="breadcrumb-item active" aria-current="page">Advanced</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-->
                <input type="hidden" name="wgserver1001" id="wgserver1001"
                       value="{{ g.wgwsserver1001 }}">
                <div class="row">
                    <div class="col-lg-12 col-md-12">
                        <div class="card" id="swipeNotOpenDoor">
                            {#                            <form action="{{ url_for('wgcomm.web_user_add') }}" method="post">#}
                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                            {#                                {{ wgform._csrf }}#}
                            <div class="card-header border-bottom">
                                <h4 class="mb-0" hidden="hidden">not open when swipe</h4>
                            </div>
                            <div class="row p-5">
                                {#                                    <div class="btn-list text-end">#}
                                {#                                <div class="btn-list text-start">#}
                                {#                                    <button href="#"#}
                                {#                                            class="btn btn-primary" id="btnpri_allowselected"#}
                                {#                                            data-id="Add and Allow Selected Users=>All Doors"#}
                                {#                                            data-name="Add and Allow Selected Users=>All Doors"#}
                                {#                                            data-url="/pri_allowselected_with_adduser_alldoor">#}
                                {#                                        <i class="fe fe-plus-square"></i>Add and Allow Selected Users=>All Doors#}
                                {#                                    </button>#}
                                {#                                    <button id="submitpause" name="submitpause" class="btn btn-outline-danger"#}
                                {#                                            type="submit" value="pause">#}
                                {#                                        pause[receiving]#}
                                {#                                    </button>#}
                                {#                                </div>#}
                                {% if doornames %}

                                    <h5 class="mb-0">1. First push button, then door open...</h5>
                                    <h5 class="mb-0">2. Select door...</h5>
                                    <div class="form-group">
                                        {#                                        <label for="f_DoorName">选择门</label>#}
                                        <select class="form-control  form-select  text-dark" id="f_DoorName"
                                                name="f_DoorName"
                                                onchange="selectDoor(this.options[this.selectedIndex].value)">
                                            <option value="0" selected>---(Select a Door)</option>
                                            {% for door in doornames %}
                                                <option value="doorid={{ door.f_DoorID }},doorno={{ door.f_DoorNO }},sn={{ door.f_ControllerSN }},doorname={{ door.f_DoorName }}">{{ door.f_DoorName }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                    {#                                    <button id="submitadduser" name="submitadduser" class="btn btn-primary"#}
                                    {#                                            type="submit"#}
                                    {#                                            data-id="Only Add Selected Users"#}
                                    {#                                            data-name="Only Add Selected Users"#}
                                    {#                                            data-url="/pri_allowselected_with_adduser_alldoor"#}
                                    {#                                            value="Only Add Selected Users">#}
                                    {#                                        Only Add Selected Users#}
                                    {#                                    </button>#}
                                    <p class="card-text text-warning" id="opSelectedResultInfo" hidden>
                                    </p>
                                    <p class="card-text text-warning" id="opResultInfo" hidden></p>

                                    <h5 class="mb-0">3. please swipe...</h5>
                                    <ul class="nav1 nav-column flex-column br-7 p-3" id="divInfoHelp2" hidden="hidden">
                                    </ul>
                                    {#                                <ul class="nav1 nav-column flex-column br-7 p-3" id="divInfoHelpAdvice" hidden="hidden">#}
                                    {#                                </ul>#}
                                    <p class="card-text text-danger" id="divInfoHelpAdvice" hidden></p>
                                    <div class="btn-list text-start">
                                        <button href="#"
                                                class="btn btn-primary" id="btnpri_allowselected"
                                                data-id="Add and Allow this User=>All Doors"
                                                data-name="Add and Allow this User=>All Doors"
                                                data-url="/pri_allowselected_with_adduser_alldoor" hidden="hidden">
                                            <i class="fe fe-plus-square"></i>Auto add this card and allow access to all doors
                                        </button>
                                    </div>

                                    <div class="form-group" id='cardInfo'></div>
                                {% else %}
                                    <h5 class="mb-0">Please add a new controller, then <a
                                            href="{{ url_for('wgcomm_help.web_help_startup') }}"
                                            class="slide-item">Help->Startup</a> or <a
                                            href="{{ url_for('wgcomm.web_search_controller') }}"
                                            class="slide-item">Configuration->SearchController</a> ...</h5>

                                {% endif %}
                            </div>

                            {#                            <input type="hidden" name="wgserver1001" id="wgserver1001"#}
                            {#                                   value="{{ wgserver1001 }}">#}
                        </div>

                        <div class="card" id="cardanalyst">
                            {#                            <form action="{{ url_for('wgcomm.web_user_add') }}" method="post">#}
                            {#                            <form>#}
                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                            {#                                {{ wgform._csrf }}#}
                            <div class="card-header border-bottom">
                                <h4 class="mb-0">Same Card, Card NO not same</h4>
                            </div>
                            <ul class="nav1 nav-column flex-column br-7 p-3" id="divInfoHelp" hidden="hidden">
                            </ul><!-- main-mail-menu -->
                            {#                            <div id='divautoaddcontrollerinfo'></div>#}
                            <div class="card-body" id="2cards">

                                <div class="form-group">
                                    <label for="f_CardNOa">want to get Card NO A</label>
                                    <input class="form-control" id="f_CardNOa" name="f_CardNOa"
                                           oninput="if(value.length>19)value=value.slice(0,19)"
                                           placeholder="please input Card NO(want)" type="text" value=""
                                           autocomplete="new-password">
                                </div>
                                <div class="form-group">
                                    <label for="f_CardNOb">in fact get Card NO B(not want)</label>
                                    <input class="form-control" id="f_CardNOb" name="f_CardNOb"
                                           oninput="if(value.length>19)value=value.slice(0,19)"
                                           placeholder="please input Card NO(in fact, not want)" type="text" value=""
                                           autocomplete="new-password">
                                </div>
                                <div class="row p-5">
                                    <div class="btn-list text-start">
                                        <button id="btnAnalyst" name="btnAnalyst" class="btn btn-primary"
                                                type="submit"
                                                value="">
                                            Analyst
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="card" id="editdoorname">
                            <div class="card-header border-bottom">
                                <h4 class="mb-0" hidden="hidden">change door name</h4>
                            </div>
                            <div class="row p-5">
                                <h5 class="mb-0"><a href="{{ url_for('wgcomm.web_controller_list') }}"
                                                    class="slide-item">Configure->Controllers Edit</a></h5>
                            </div>
                        </div>
                        <div class="card" id="opendoorpassword">
                            <div class="card-header border-bottom">
                                <h4 class="mb-0" hidden="hidden">open door password</h4>
                            </div>
                            <ul class="nav1 nav-column flex-column br-7 p-3" id="divInfoHelpopendoorpassword"
                                hidden="hidden">
                            </ul>
                            <div class="card-body">
                                {#                                <div class="form-group" hidden="hidden">#}
                                {#                                    <label for="f_SuperPassword11">password group#1</label>#}
                                {#                                    <input class="form-control" id="f_SuperPassword11" name="f_SuperPassword11"#}
                                {#                                           oninput="if(value.length>6)value=value.slice(0,6)"#}
                                {#                                           placeholder="please input 4-6 digits password"  type="password" value="">#}
                                {#                                </div>#}
                                <div class="form-group">
                                    <label for="f_SuperPassword1">password group#1</label>
                                    <input class="form-control" id="f_SuperPassword1" name="f_SuperPassword1"
                                           oninput="if(value.length>6)value=value.slice(0,6)"
                                           placeholder="please input 4-6 digits password" type="password"
                                           value="{{ superpassword[0] }}" autocomplete="new-password">
                                </div>
                                <div class="form-group">
                                    <label for="f_SuperPassword2">password group#2</label>
                                    <input class="form-control" id="f_SuperPassword2" name="f_SuperPassword2"
                                           oninput="if(value.length>6)value=value.slice(0,6)"
                                           placeholder="please input 4-6 digits password" type="password"
                                           value="{{ superpassword[1] }}" autocomplete="new-password">
                                </div>
                                <div class="form-group">
                                    <label for="f_SuperPassword3">password group#3</label>
                                    <input class="form-control" id="f_SuperPassword3" name="f_SuperPassword3"
                                           oninput="if(value.length>6)value=value.slice(0,6)"
                                           placeholder="please input 4-6 digits password" type="password"
                                           value="{{ superpassword[2] }}" autocomplete="new-password">
                                </div>
                                <div class="form-group">
                                    <label for="f_SuperPassword4">password group#4</label>
                                    <input class="form-control" id="f_SuperPassword4" name="f_SuperPassword4"
                                           oninput="if(value.length>6)value=value.slice(0,6)"
                                           placeholder="please input 4-6 digits password" type="password"
                                           value="{{ superpassword[3] }}" autocomplete="new-password">
                                </div>
                                <div class="row p-5">
                                    <div class="btn-list text-start">
                                        <button id="btnEditSuperPassword" name="btnEditSuperPassword"
                                                class="btn btn-primary"
                                                type="submit"
                                                value="">
                                            Update Open Door Password
                                        </button>
                                    </div>
                                </div>
                            </div>

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