{% 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">Dining Settings</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);">Dining Settings</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_meal.web_report_meal_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">Dining rules</h4>
                                </div>
                                <div class="card-body">
                                    <div class="form-group">
                                        {{ wgform.meal_rule_a.label }}
                                        <select class="form-control  form-select  text-dark" id="meal_rule_a"
                                                name="meal_rule_a">
                                            <option value="0"
                                                    {% if wgform.meal_rule_a.data==0 %}
                                                    selected
                                                    {% endif %}
                                            >Swipe once = count once
                                            </option>
                                            <option value="1"
                                                    {% if wgform.meal_rule_a.data==1 %}
                                                    selected
                                                    {% endif %}
                                            >Multiple swipes = count once
                                            </option>
                                            <option value="2"
                                                    {% if wgform.meal_rule_a.data==2 %}
                                                    selected
                                                    {% endif %}
                                            >Same location, <60s apart = count once
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        {{ wgform.meal_rule_b.label }}
                                        <select class="form-control  form-select  text-dark" id="meal_rule_b"
                                                name="meal_rule_b">
                                            <option value="1"
                                                    {% if wgform.meal_rule_b.data==1 %}
                                                    selected
                                                    {% endif %}
                                            >Only count (allowed to pass) swipe records
                                            </option>
                                            <option value="0"
                                                    {% if wgform.meal_rule_b.data==0 %}
                                                    selected
                                                    {% endif %}
                                            >Count all swipes (including denied)
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="card-header border-bottom">
                                    <h4 class="mb-0">Dining period</h4>
                                </div>
                                <div class="card-body">
                                    <div class="col-sm-12 col-md-12 col-xl-3 no-taskEnd-checkbox">
                                        <div class="form-group">
                                            <label class="custom-control custom-checkbox no-taskEnd-checkbox-container">
                                                <input type="checkbox" class="custom-control-input" id="f_morning_meal"
                                                       name="f_morning_meal"
                                                        {% if wgform.f_morning_meal.data %}
                                                       value="1" checked
                                                        {% else %}
                                                       value="0"
                                                        {% endif %}
                                                >
                                                <span class="custom-control-label">
                                                    {{ wgform.f_morning_meal.label }}
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_BeginHMS1" name="f_BeginHMS1" min="00:00" max="23:59"
                                                           value={{ wgform.f_BeginHMS1.data }}>
                                                    To
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_EndHMS1"
                                                           name="f_EndHMS1" min="00:00" max="23:59"
                                                           value={{ wgform.f_EndHMS1.data }}>

                                                    {{ wgform.f_cost1( class="form-control",placeholder="Enter amount") }}
                                                    $/time
                                                </span>
                                            </label>

                                            <label class="custom-control custom-checkbox no-taskEnd-checkbox-container">
                                                <input type="checkbox" class="custom-control-input" id="f_lunch_meal"
                                                       name="f_lunch_meal"
                                                        {% if wgform.f_lunch_meal.data %}
                                                       value="1" checked
                                                        {% else %}
                                                       value="0"
                                                        {% endif %}
                                                >
                                                <span class="custom-control-label">
                                                    {{ wgform.f_lunch_meal.label }}
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_BeginHMS2" name="f_BeginHMS2" min="00:00" max="23:59"
                                                           value={{ wgform.f_BeginHMS2.data }}>
                                                    To
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_EndHMS2"
                                                           name="f_EndHMS2" min="00:00" max="23:59"
                                                           value={{ wgform.f_EndHMS2.data }}>

                                                    {{ wgform.f_cost2( class="form-control",placeholder="Enter amount") }}
                                                    $/time
                                                </span>
                                            </label>
                                            <label class="custom-control custom-checkbox no-taskEnd-checkbox-container">
                                                <input type="checkbox" class="custom-control-input" id="f_evening_meal"
                                                       name="f_evening_meal"
                                                        {% if wgform.f_evening_meal.data %}
                                                       value="1" checked
                                                        {% else %}
                                                       value="0"
                                                        {% endif %}
                                                >
                                                <span class="custom-control-label">
                                                    {{ wgform.f_evening_meal.label }}
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_BeginHMS3" name="f_BeginHMS3" min="00:00" max="23:59"
                                                           value={{ wgform.f_BeginHMS3.data }}>
                                                    To
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_EndHMS3"
                                                           name="f_EndHMS3" min="00:00" max="23:59"
                                                           value={{ wgform.f_EndHMS3.data }}>

                                                    {{ wgform.f_cost3( class="form-control",placeholder="Enter amount") }}$/time
                                                </span>
                                            </label>
                                            <label class="custom-control custom-checkbox no-taskEnd-checkbox-container">
                                                <input type="checkbox" class="custom-control-input" id="f_other_meal"
                                                       name="f_other_meal"
                                                        {% if wgform.f_other_meal.data %}
                                                       value="1" checked
                                                        {% else %}
                                                       value="0"
                                                        {% endif %}
                                                >
                                                <span class="custom-control-label">
                                                    {{ wgform.f_other_meal.label }}
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_BeginHMS4" name="f_BeginHMS4" min="00:00" max="23:59"
                                                           value={{ wgform.f_BeginHMS4.data }}>
                                                    To
                                                    <input type="time" style="border-width: 1px; border-style: solid"
                                                           id="f_EndHMS4"
                                                           name="f_EndHMS4" min="00:00" max="23:59"
                                                           value={{ wgform.f_EndHMS4.data }}>

                                                    {{ wgform.f_cost4( class="form-control",placeholder="Enter amount") }}
                                                    $/time
                                                </span>
                                            </label>
                                        </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 %}
