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

{% block title %}
    Fixed Quota Dining
{% endblock %}
{% block tail %}
    <script src="static/wgcomm/js/datepicker.js"></script>
    <script src="static/wgcomm/js/wgdatepicker.js"></script>
{% endblock %}
{% block tail_min %}
    <script src="static/wgcomm/js/datepicker.min.js"></script>
    <script src="static/wgcomm/js/wgdatepicker.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">考勤正常班Configuration</h1>
                    </div>
                    <div class="ms-auto pageheader-btn">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">Reports</li>
                            <li class="breadcrumb-item"><a href="javascript:void(0);">考勤正常班Configuration</a></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-lg-12 col-md-12">
                        <div class="card">
                            <form action="{{ url_for('wgcomm_report_att.web_report_att_setup') }}" method="post"
                                  enctype="multipart/form-data" id="formA">
                                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                                {{ wgform._csrf }}
                                <div class="card-header border-bottom">
                                    <h4 class="mb-0">正常班规则</h4>
                                </div>

                                <div class="card-body">
                                    <div class="form-group">
                                        晚To
                                        {{ wgform.t_a_Attendence_LateTimeout() }}
                                        {{ wgform.t_a_Attendence_LateTimeout.label }}
                                    </div>
                                    <div class="form-group">
                                        迟To
                                        {{ wgform.t_a_Attendence_LateAbsenceTimeout() }}
                                        {{ wgform.t_a_Attendence_LateAbsenceTimeout.label }}
                                        {{ wgform.t_a_Attendence_LateAbsenceDay() }}
                                        {#                                        <select  id="t_a_Attendence_LateAbsenceDay"#}
                                        {#                                                name="t_a_Attendence_LateAbsenceDay">#}
                                        {#                                            <option value="0"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LateAbsenceDay.data==0 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >0 days#}
                                        {#                                            </option>#}
                                        {#                                            <option value="1"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LateAbsenceDay.data==1 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >Half day#}
                                        {#                                            </option>#}
                                        {#                                            <option value="2"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LateAbsenceDay.data==2 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >1天#}
                                        {#                                            </option>#}
                                        {#                                        </select>#}
                                    </div>

                                    <div class="form-group">
                                        提前
                                        {{ wgform.t_a_Attendence_LeaveTimeout() }}
                                        {{ wgform.t_a_Attendence_LeaveTimeout.label }}
                                    </div>
                                    <div class="form-group">
                                        早退
                                        {{ wgform.t_a_Attendence_LeaveAbsenceTimeout() }}
                                        {{ wgform.t_a_Attendence_LeaveAbsenceTimeout.label }}
                                        {{ wgform.t_a_Attendence_LeaveAbsenceDay() }}
                                        {#                                        <select  id="t_a_Attendence_LeaveAbsenceDay"#}
                                        {#                                                name="t_a_Attendence_LeaveAbsenceDay">#}
                                        {#                                            <option value="0"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LeaveAbsenceDay.data==0 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >0 days#}
                                        {#                                            </option>#}
                                        {#                                            <option value="1"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LeaveAbsenceDay.data==1 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >Half day#}
                                        {#                                            </option>#}
                                        {#                                            <option value="2"#}
                                        {#                                                    {% if wgform.t_a_Attendence_LeaveAbsenceDay.data==2 %}#}
                                        {#                                                    selected#}
                                        {#                                                    {% endif %}#}
                                        {#                                            >1天#}
                                        {#                                            </option>#}
                                        {#                                        </select>#}
                                    </div>
                                    <div class="form-group">
                                        下午下班
                                        {{ wgform.t_a_Attendence_OvertimeTimeout() }}
                                        {{ wgform.t_a_Attendence_OvertimeTimeout.label }}
                                    </div>
                                </div>
                                <div class="card-header border-bottom">
                                    <h4 class="mb-0">班次Configuration</h4>
                                </div>
                                <div class="card-body">

                                    <div class="form-group">
                                        <input type="radio" id="t_a_Attendence_ReadCardTwoTimes"
                                               name="t_a_Attendence_ReadCardTwoTimes" value="2"
                                                {% if wgform.t_a_Attendence_ReadCardTwoTimes.data!=4 %}
                                               checked
                                                {% endif %}
                                        >
                                        {#                                        {{ wgform.t_a_Attendence_ReadCardTwoTimes() }}#}
                                        {{ wgform.t_a_Attendence_ReadCardTwoTimes.label }}
                                        <div class="form-group">
                                            {{ wgform.t_a_Attendence_OnDuty0.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OnDuty0" name="t_a_Attendence_OnDuty0" min="00:00"
                                                   max="23:59"
                                                   value={{ wgform.t_a_Attendence_OnDuty0.data }}>
                                            <br>

                                            {{ wgform.t_a_Attendence_OffDuty0.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OffDuty0" name="t_a_Attendence_OffDuty0"
                                                   min="00:00" max="23:59"
                                                   value={{ wgform.t_a_Attendence_OffDuty0.data }}>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <input type="radio" id="t_a_Attendence_ReadCardTwoTimes"
                                               name="t_a_Attendence_ReadCardTwoTimes" value="4"
                                                {% if wgform.t_a_Attendence_ReadCardTwoTimes.data==4 %}
                                               checked
                                                {% endif %}
                                        >
                                        {#                                        {{ wgform.t_a_Attendence_ReadCardTwoTimes() }}#}
                                        {{ wgform.t_a_Attendence_ReadCardFourTimes.label }}
                                        <div class="form-group">
                                            {{ wgform.t_a_Attendence_OnDuty1.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OnDuty1" name="t_a_Attendence_OnDuty1" min="00:00"
                                                   max="23:59"
                                                   value={{ wgform.t_a_Attendence_OnDuty1.data }}>
                                            <br>

                                            {{ wgform.t_a_Attendence_OffDuty1.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OffDuty1" name="t_a_Attendence_OffDuty1"
                                                   min="00:00" max="23:59"
                                                   value={{ wgform.t_a_Attendence_OffDuty1.data }}>
                                            <br>
                                            {{ wgform.t_a_Attendence_OnDuty2.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OnDuty2" name="t_a_Attendence_OnDuty2" min="00:00"
                                                   max="23:59"
                                                   value={{ wgform.t_a_Attendence_OnDuty2.data }}>
                                            <br>

                                            {{ wgform.t_a_Attendence_OffDuty2.label }}
                                            <input type="time" style="border-width: 1px; border-style: solid"
                                                   id="t_a_Attendence_OffDuty2" name="t_a_Attendence_OffDuty2"
                                                   min="00:00" max="23:59"
                                                   value={{ wgform.t_a_Attendence_OffDuty2.data }}>
                                        </div>
                                    </div>
                                </div>


                                <div class="row p-5">
                                    <div class="btn-list text-end">
                                        <button id="submitcancel" name="submitcancel" class="btn btn-outline-danger"
                                                type="submit" value="Cancel">
                                            <i class="fe fe-x-circle"></i>
                                            Cancel
                                        </button>
                                        <button id="submitsave" name="submitsave" class="btn btn-primary" type="submit"
                                                value="Save">
                                            <i class="fe fe-check-circle"></i>
                                            Save
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!--ROW CLOSED-->
            </div>
        </div>
    </div>
    <!-- CONTAINER CLOSED -->
{% endblock %}
