<?php
if (!defined('ABSPATH')) exit;
// add_action( 'admin_init', 'flexyconsent_settings_userSettingsPage' );
// function flexyconsent_settings_userSettingsPage() { 
// 	global $flexyconsentSettings; 
// 	$pageNameMain = 'userSettingsPage';
// 	// $pageName = flexyconsent_getPageName($pageNameMain);
// 	// $sectionName = flexyconsent_getSectionName($pageNameMain);
// }

function flexyconsent_userSettingsPage()
{ ?>
	<div id="flexyconsent_user_settings_page" class="container px-3 py-3 flexyconsent-container">
		<div class="row">
			<div class="col-12 text-center my-3">
				<?php flexyconsent_get_top_section(); ?>
			</div>
		</div>

		<div class="row g-4 pb-3">
			<div class="col-12">
				<div class="card shadow-sm h-100">
					<div class="card-header bg-primary text-white fw-bold">
						<?php esc_html_e('User Information', 'flexyconsent'); ?>
					</div>
					<div class="card-body">
						<ul class="list-unstyled mb-0">
							<li><strong><?php esc_html_e("Email", "flexyconsent"); ?>:</strong> <span id="email"></span></li>
							<li><strong><?php esc_html_e("Full Name", "flexyconsent"); ?>:</strong> <span id="full_name"></span></li>
							<li><strong><?php esc_html_e("Company", "flexyconsent"); ?>:</strong> <span id="company_name"></span></li>
						</ul>
					</div>
				</div>
			</div>

			<div id="invoice_info_col" class="col-12" style="display: none;">
				<div class="card shadow-sm h-100">
					<div class="card-header bg-success text-white fw-bold">
						<?php esc_html_e('Invoice Info', 'flexyconsent'); ?>
					</div>
					<div class="card-body">
						<ul class="list-unstyled mb-0">
							<li><strong><?php esc_html_e("Name On Invoice", "flexyconsent"); ?>:</strong> <span id="invoice_name">-</span></li>
							<li><strong><?php esc_html_e("Account Type", "flexyconsent"); ?>:</strong> <span id="account_type">-</span></li>
							<li><strong><?php esc_html_e("Address", "flexyconsent"); ?>:</strong> <span id="address">-</span></li>
							<li><strong><?php esc_html_e("City", "flexyconsent"); ?>:</strong> <span id="city">-</span></li>
							<li><strong><?php esc_html_e("Country", "flexyconsent"); ?>:</strong> <span id="country">-</span></li>
							<li><strong><?php esc_html_e("Post Code", "flexyconsent"); ?>:</strong> <span id="post_code">-</span></li>
							<li><strong><?php esc_html_e("VAT Number", "flexyconsent"); ?>:</strong> <span id="vat_number">-</span></li>
						</ul>
					</div>
				</div>
			</div>
		</div>

		<div class="d-flex justify-content-center mt-3">
			<a href="<?php echo esc_url(flexyconsent_generateGoPage('dashboardPage')); ?>" class="mx-3 button button-primary"><?php esc_html_e("Cancel", "flexyconsent"); ?></a>
			<a href="<?php echo esc_url(flexyconsent_generateGoPage('updateEmailPage')); ?>" class="mx-3 button button-primary"><?php esc_html_e("Change email address", "flexyconsent"); ?></a>
			<a href="<?php echo esc_url(flexyconsent_generateGoPage('updateUserSettingsPage')); ?>" class="mx-3 button button-primary"><?php esc_html_e("Update user info", "flexyconsent"); ?></a>
			<a id="deleteAccount" href="<?php echo esc_url(flexyconsent_generateGoPage('deleteAccountPage')); ?>" class="mx-3 button button-primary"><?php esc_html_e("Close my account", "flexyconsent"); ?></a>
		</div>

		<div class="col-12 text-center">
			<?php flexyconsent_get_bottom_section(); ?>
		</div>
	</div>
	</div>
<?php
}
