<?php
/**
 * Load admin view for Form SMS Notification.
 *
 * @package miniorange-sms-order-notification-otp-verification/notifications/formsmsnotification/views
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
echo '				<div id="formNotifSubTabContainer" class="mowc-subpage-container ' . esc_attr( $mowc_formnotif_hidden ) . '">		
						<form name="f" method="post" action="" id="mo_form_sms_notif_settings">
							<input type="hidden" name="option" value="mo_form_sms_notif_settings" />';
							wp_nonce_field( 'mo_form_sms_notif_settings', 'mo_form_sms_notif_settings_nonce' );
echo '						<div class="mowc-header">
								<p class="mowc-heading flex-1">' . esc_html( mowc_( 'Form Notification Settings' ) ) . '</p>
								<input type="submit" name="save" id="save"
											class="mowc-button inverted" value="' . esc_attr( mowc_( 'Save Settings' ) ) . '">
							</div>

							<div id="mo_admin_phone_settings" class="p-mowc-8 border-b">
									<div class="flex flex-col gap-mowc-6 px-mowc-4">
									<div class="w-full flex m-mowc-4">
										<div class="flex-1">
											<h5 class="mowc-title">' . esc_html__( 'Admin Phone Numbers', 'miniorange-sms-order-notification-otp-verification' ) . '</h5>
											<p class="mowc-caption mt-mowc-2">' . esc_html__( 'Enter the Admin Phone Numbers on which Notifications will be received.', 'miniorange-sms-order-notification-otp-verification' ) . '</p>
										</div>
										<div class="flex-1 flex flex-wrap">
									<input type="text" name="mo_form_admin_notif_recipient" id="mo_form_admin_notif_recipient" value="' . esc_attr( $mowc_admin_recipient_value ) . '"  class="w-full mowc-input" pattern="^[+\-0-9; ]+$" placeholder="' . esc_html( mowc_( 'Enter semi-colon (;) to separate multiple phone numbers.' ) ) . '" title="' . esc_attr__( 'Only numbers, plus (+), hyphen (-), spaces, and semicolons (;) are allowed.', 'miniorange-sms-order-notification-otp-verification' ) . '"/>
								';

						echo '	</div>
									</div>
								</div>
							</div>
							
							<table class="mowc-wcnotif-table bg-white">
								<thead>
									<tr>
										<th>' . esc_html__( 'SMS Type', 'miniorange-sms-order-notification-otp-verification' ) . '</th>
										<th>' . esc_html__( 'Recipient', 'miniorange-sms-order-notification-otp-verification' ) . '</th>
										<th></th>
										<th>' . esc_html__( 'SMS Body', 'miniorange-sms-order-notification-otp-verification' ) . '</th>			
									</tr>
								</thead>
								<tbody>';
									mowc_show_form_notifications_table( $mowc_notification_settings );
echo '							</tbody>
							</table>

							<div class="mowc-alert mowc-alert-info">
								<span>' . wp_kses(
									sprintf(
										/* translators: %1$s: Email link */
										__( 'Contact us or email us at %1$s to integrate SMS Notifications on your form', 'miniorange-sms-order-notification-otp-verification' ),
										'<a href="' . esc_url( 'mailto:otpsupport@xecurify.com' ) . '" class="mowc-link">' . esc_html( 'otpsupport@xecurify.com' ) . '</a>'
									),
									array(
										'a' => array(
											'href'  => true,
											'class' => true,
										),
									)
								) . '</span>
							</div>
						</form>
					</div>
					<script>
					jQuery(document).ready(function($){
						$("#mo_form_admin_notif_recipient").on("input", function() {
							this.value = this.value.replace(/[^0-9+\-; ]/g, "");
						});
						
						$(document).on("input", "input[id$=\"_recipient\"]", function() {
							this.value = this.value.replace(/[^0-9+\-; ]/g, "");
						});
					});
					</script>';
