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

add_action( 'admin_init', 'flexyconsent_settings_deleteAccountPage' );
function flexyconsent_settings_deleteAccountPage() { 
	global $flexyconsentSettings; 
	$pageNameMain = 'deleteAccountPage';
	// $pageName = flexyconsent_getPageName($pageNameMain);
	// $sectionName = flexyconsent_getSectionName($pageNameMain);
}
 
function flexyconsent_deleteAccountPage() { 
	$pageNameMain = 'deleteAccountPage';
	?>
		<div class="container py-3">
			<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("Delete account","flexyconsent"); ?>
						<p><?php esc_html_e("This action cannot be reversed.","flexyconsent"); ?></p>
						<p><?php esc_html_e("All user and website information will be lost and cannot be recovered.","flexyconsent"); ?></p>
						<p><?php esc_html_e("Please write your email address to confirm.","flexyconsent"); ?></p>
						<table class="form-table" role="presentation">
							<tbody>
								<tr>
									<td>
										<input type="text" id="email-address" name="email-address">
										<input type="hidden" id="email-address-validate" name="email-address-validate" value="<?php echo esc_attr(flexyconsent_getOption('email')); ?>">
									</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('Delete Account', 'flexyconsent'); ?>">
						</div>
					</form>
				</div>
				<div class="col-12 text-center">
					<?php flexyconsent_get_bottom_section(); ?>
				</div>
			</div>
		</div>
		<?php
}