<?php $this->load->view('admin/includes/head'); ?>
<?php $this->load->view('admin/includes/sidebar'); ?>
<?php $this->load->view('admin/includes/topbar'); ?>
<div class="container">

	<div class="row">
		<h2 class="text-center mt-4">Hello <?=$this->session->userdata('refDataName');?>, Welcome To The Devotee Dashboard</h2>

		
		<?php if (@$userDetails->isMember == 1 && @$userDetails->membershipStatus == 'ACTIVE' && @$userDetails->membershipPaymentStatus == 'COMPLETED') { ?>
			
			<div class="row justify-content-center">
				<div class="col-sm-6 col-md-6">
					<div class="text-center">
						<img src="<?=base_url('assets/img/membership/medal-bronze.svg');?>" alt="" class="img-fluid w-50">
						<h4 class="mt-3"><?=getCurrencySymbol() .' '.price_format(@$userDetails->membershipAmount, 2);?> <?=@$userDetails->membershipType;?></h4>
						<p class="mb-2"><?=@$userDetails->membershipDetail;?></p>
						<hr>
						<a href="<?=base_url('membership-form');?>" class="btn btn-primary"><i class="fa fa-level-up"></i> Upgrade Membership</a>
					</div>
				</div>

			</div>
		<?php } ?>


		<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
		<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>


	</div>
</div>
<!-- End Main content-->

<?php $this->load->view('admin/includes/footer'); ?>
<script type="text/javascript">
	$(document).ready(function() {
    // Check if the alert has been shown before
    if (!localStorage.getItem('alertShown')) {
        $("#heading").text('Devotee Dashboard');
        // Show the alert
        Swal.fire({
            title: 'Would you like to review and update your personal details?',
            showDenyButton: false,
            showCancelButton: true,
            confirmButtonText: 'YES',
            denyButtonText: `CANCEL`,
        }).then((result) => {
            if (result.isConfirmed) {
                window.location.href = "<?=base_url('admin/update-profile');?>";
            } else if (result.isDenied) {
                // Handle deny action if needed
            }
        });
        // Set a flag in localStorage to indicate that the alert has been shown
        localStorage.setItem('alertShown', 'true');
    }
});








</script>
</body>
</html>
