<?php
if (!defined('ABSPATH')) exit;

// add_action( 'admin_init', 'flexyconsent_settings_updateEmailPage' );
// function flexyconsent_settings_updateEmailPage() { 
// 	global $flexyconsentSettings; 
// 	$pageNameMain = 'updateEmailPage';
// 	$pageName = flexyconsent_getPageName($pageNameMain);
// 	$sectionName = flexyconsent_getSectionName($pageNameMain);
// }
 
function flexyconsent_updateEmailPage() { 
	$pageNameMain = 'updateEmailPage'; ?>
		<div class="container py-3 flexyconsent-container">
			<div class="row">
				<div class="col-12 text-center">
					<?php flexyconsent_get_top_section(); ?>
				</div>
				<div class="col-12">
					<form action='options.php' method='post' id="<?php echo esc_attr($pageNameMain); ?>" class="d-table mx-auto my-3 flexyconsent-form">
						<?php
						settings_fields( $pageNameMain );
						do_settings_sections( $pageNameMain ); ?>
						<h4><?php esc_html_e("Change your email address","flexyconsent"); ?>
						<table class="form-table" role="presentation">
							<tbody>
								<tr>
									<th scope="row"><?php esc_html_e('New email address', 'flexyconsent'); ?></th>
									<td>
										<input type="text" id="flexyconsent-new-mail-address" name="new-email" placeholder='<?php esc_html_e('New email address', 'flexyconsent'); ?>'>
									</td>
								</tr>
							</tbody>
						</table>	
						<div class="d-flex justify-content-between">
							<a class="button button-back" href="<?php echo esc_url(flexyconsent_generateGoPage('userSettingsPage')); ?>"><?php esc_html_e('Cancel','flexyconsent'); ?></a>
							<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e('Continue', 'flexyconsent'); ?>">
						</div>
					</form>
				</div>
				<div class="col-12 text-center">
					<?php flexyconsent_get_bottom_section(); ?>
				</div>
			</div>
		</div>
		<?php
}