<div class="wrap lsq-settings-page">

    <h1>{{ i18n.text_0|e }}</h1>

    <form method="post" action="{{ save_url }}">
       {{ nonce|raw }}
        <input type="hidden" name="lsq_form_type" value="{{ pro }}" />

        <table class="form-table">
   <tr>
                <th scope="row">
                    <label for="lsq_notifications_enabled">{{ i18n.text_1|e }}</label>
                </th>
                <td>
                    <label>
                        <input type="checkbox"
                               name="lsq_notifications_enabled"
                               id="lsq_notifications_enabled"
                               value="yes"
                               {% if notifications_enabled == 'yes' %}checked{% endif %}
                        >{{ i18n.text_2|e }}</label>
                </td>
            </tr>
            <tr>
                <th scope="row">
                    <label for="lsq_send_method">{{ i18n.text_3|e }}</label>
                </th>
                <td>
                    <label style="display:block; margin-bottom:6px;">
                        <input type="checkbox"
                               name="lsq_send_immediately"
                               id="lsq_send_immediately"
                               value="yes"
                               {% if send_immediately == 'yes' %}checked{% endif %}
                        >{{ i18n.text_4|e }}</label>

                    <label style="display:block;">
                        <input type="checkbox"
                               name="lsq_send_by_cron"
                               id="lsq_send_by_cron"
                               value="yes"
                               {% if send_by_cron == 'yes' %}checked{% endif %}
                        >{{ i18n.text_5|e }}</label>
                </td>
            </tr>

            {% if send_by_cron == 'yes' %}
            <tr>
                <th scope="row">
                    <label for="lsq_cron_time">{{ i18n.text_6|e }}</label>
                </th>
                <td>
                    <input type="time"
                           name="lsq_cron_time"
                           id="lsq_cron_time"
                           value="{{ cron_time }}"
                           style="width:140px;"
                    >
                    <p class="description">{{ i18n.text_7|e }}</p>
                </td>
            </tr>

            <tr>
                <th scope="row">
                    <label for="lsq_cron_frequency">{{ i18n.text_8|e }}</label>
                </th>
                <td>
                    <select name="lsq_cron_frequency"
                            id="lsq_cron_frequency"
                            style="width:180px;">
                        <option value="hourly" {% if cron_frequency == 'hourly' %}selected{% endif %}>{{ i18n.text_9|e }}</option>
                        <option value="twicedaily" {% if cron_frequency == 'twicedaily' %}selected{% endif %}>{{ i18n.text_10|e }}</option>
                        <option value="daily" {% if cron_frequency == 'daily' %}selected{% endif %}>{{ i18n.text_11|e }}</option>
                        <option value="weekly" {% if cron_frequency == 'weekly' %}selected{% endif %}>{{ i18n.text_12|e }}</option>
                    </select>
                    <p class="description">{{ i18n.text_13|e }}</p>
                </td>
            </tr>
            {% endif %}

         

            <tr>
                <th scope="row">
                    <label for="lsq_threshold">{{ i18n.text_14|e }}</label>
                </th>
                <td>
                    <input type="number"
                           name="lsq_threshold"
                           id="lsq_threshold"
                           value="{{ threshold }}"
                           min="1"
                           style="width: 80px;"
                    >
                    <p class="description">{{ i18n.text_15|e }}</p>
                </td>
            </tr>

            <tr>
                <th scope="row">
                    <label for="lsq_notify_email">{{ i18n.text_16|e }}</label>
                </th>
                <td>
                    <input type="email"
                           name="lsq_notify_email"
                           id="lsq_notify_email"
                           value="{{ notify_email }}"
                           style="width: 280px;"
                    >
                    <p class="description">{{ i18n.text_17|e }}</p>
                </td>
            </tr>

        </table>

        <p class="submit">
            <button type="submit" class="button button-primary">{{ i18n.text_18|e }}</button>
        </p>

    </form>

    <hr>

    <h2>{{ i18n.text_19|e }}</h2>

    {% if notifications_enabled == 'yes' %}
        <p><strong>{{ i18n.text_20|e }}</strong> {{ i18n.text_21|e }}</p>
        <p><strong>{{ i18n.text_22|e }}</strong> {{ threshold }}</p>
        <p><strong>{{ i18n.text_23|e }}</strong> {{ notify_email }}</p>
    {% else %}
        <p><strong>{{ i18n.text_24|e }}</strong></p>
    {% endif %}

</div>