<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
?>
<div class="wrap sc-wordform-setting-page-validation-tab-table-wrapper">

	<form id="scWordformSettingsValidationTabForm" method="post">
		<div class="sc-wordform-validation-toolbar">
			<div class="sc-wordform-validation-toolbar-copy">
				<label for="scWordformSelectValidationMsgsFor"><?php esc_html_e( 'Select Form', 'wordform-pro' ); ?></label>
				<p><?php esc_html_e( 'Use one shared message set for all forms, or switch to a specific form and override only that form.', 'wordform-pro' ); ?></p>
			</div>
			<div class="sc-wordform-validation-toolbar-control">
				<select id="scWordformSelectValidationMsgsFor" name="sc-wordform-select-validation-message-form-id">
					<option value="all_form"><?php esc_html_e( 'All Forms', 'wordform-pro' ); ?></option>
					<?php
					if ( isset( $all_created_forms ) && array_filter( $all_created_forms ) ) {
						foreach ( $all_created_forms as $data ) {
							echo '<option value="' . esc_attr( $data['form_id'] ) . '">' . esc_html( $data['form_name'] ) . '</option>';
						}
					}
					?>
				</select>
			</div>
		</div>

		<table class="sc-wordform-validation-messages-display-table">
			<tbody>
				<?php require_once SFTCY_WORDFORM_PLUGIN_DIR . 'admin/views/settings_callback_validation_tab_page_template.php'; ?>
			</tbody>
		</table>

		<div class="sc-wordform-validation-actions">
			<input type="hidden" class="sc-wordform-validation-tab-selected-form-name" name="sc-wordform-validation-tab-selected-form-name" value="All Forms" />
			<input type="hidden" class="sc-wordform-validation-tab-selected-form-id" name="sc-wordform-validation-tab-selected-form-id" value="all_form" />
			<button type="submit" class="button button-primary button-large"><?php esc_html_e( 'Save', 'wordform-pro' ); ?></button>
			<button type="button" class="button button-secondary button-large sc-wordform-validation-reset-btn"><?php esc_html_e( 'Reset', 'wordform-pro' ); ?></button>
			<span class="sc-wordform-validation-message-settings-info"></span>
		</div>
	</form>  

</div>
