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

// add_action('admin_init', 'flexyconsent_settings_subscriptionPage');
// function flexyconsent_settings_subscriptionPage()
// {
// 	global $flexyconsentSettings;
// 	$pageNameMain = 'subscriptionPage';
// 	$pageName = flexyconsent_getPageName($pageNameMain);
// 	$sectionName = flexyconsent_getSectionName($pageNameMain);
// }

function flexyconsent_subscriptionPage()
{
	// global $flexyconsent_plugin_dir_url;
	$pageNameMain = 'subscriptionPage'; ?>
	<div class="container subscription-page-container py-3">
		<div id="modal_cancel_subscription" class="modal fade" tabindex="-1" aria-hidden="true" role="dialog">
			<div class="modal-dialog modal-dialog-centered">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title"><?php esc_html_e("Cancel Subscription", "flexyconsent"); ?></h5>
						<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?php esc_attr_e("Close", "flexyconsent"); ?>"></button>
					</div>
					<div class="modal-body">
						<p id="modal_subscription_info"></p>
						<p><?php esc_html_e("If you cancel your subscription, the subscription will continue until the end of the term but will not be renewed.", "flexyconsent"); ?></p>
						<p><?php esc_html_e("Are you sure you want to cancel your subscription?", "flexyconsent"); ?></p>
					</div>
					<div class="modal-footer">
						<button type="button" id="btn_cancel_subscription" class="btn btn-danger"><?php esc_html_e("Cancel Subscription", "flexyconsent"); ?></button>
						<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php esc_html_e("Close", "flexyconsent"); ?></button>
					</div>
				</div>
			</div>
		</div>

		<!-- <div id="modal_cancel_subscription" class="modal fade" tabindex="-1"
			aria-hidden="true" role="dialog">
			<div class="modal-dialog modal-dialog-centered">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">Cancel Subscription</h5>
						<button type="button" class="btn-close" data-bs-dismiss="modal"
							aria-label="Close"></button>
					</div>
					<div class="modal-body">
						<p id="modal_subscription_info"></p>
						<p>If you cancel your subscription, the subscription will
							continue until the end of the term but will not be renewed.</p>
						<p>Are you sure you want to cancel your subscription?</p>
						<div class="d-flex justify-content-end">
							<button type="button" class="btn btn-danger"
								id="btn_cancel_subscription">Cancel Subscription</button>
							<button type="button" class="btn btn-secondary ms-2"
								data-bs-dismiss="modal">Close</button>
						</div>
					</div>
				</div>
			</div>
		</div> -->

		<div class="row">
			<div class="col-12 text-center">
				<?php flexyconsent_get_top_section(); ?>
			</div>
			<div class="col-12 my-3" id="<?php echo esc_attr($pageNameMain); ?>">
				<div class="container">
					<h2 class="text-center"><?php esc_html_e("Subscriptions", "flexyconsent"); ?></h2>
					<div class="card mt-3 p-2 p-sm-3 d-none">
						<div id="flexyconsent-subscriptions"></div>
						<div class="my-2 d-flex justify-content-end">
							<button type="submit" class="btn btn-success w-lg mx-2"
								id='btn_save' disabled><?php esc_html_e("Save", "flexyconsent"); ?></button>
							<button type="button" id="btn_cancel" class="btn btn-cancel w-sm"
								onclick="window.location.reload()"><?php esc_html_e("Cancel", "flexyconsent"); ?></button>
						</div>

						<div class="py-3">
							<div id="btn_buy_new_plan" role="button" class="text-primary">
								<span><?php esc_html_e("Buy a new plan", "flexyconsent"); ?></span>
								<span><i class="fa-solid fa-chevron-right"></i></span>
							</div>
							<div id="plans_container" class="collapse"></div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-12 text-center">
				<?php flexyconsent_get_bottom_section(); ?>
			</div>
		</div>
	<?php
}
