HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/kofejob-wp/wp-content/themes/kofejob/template-parts/template-dashboard.php
<?php

/**
 * Template Name: Dashboard Pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package kofejob
 */

if (!is_user_logged_in()) {

	$errors = array();

	if (isset($_REQUEST['login'])) {
		$error_codes = explode(',', $_REQUEST['login']);

		foreach ($error_codes as $code) {
			switch ($code) {
				case 'empty_username':
					$errors[] = esc_html__('You do have an email address, right?', 'kofejob');
					break;
				case 'empty_password':
					$errors[] =  esc_html__('You need to enter a password to login.', 'kofejob');
					break;
				case 'username_exists':
					$errors[] =  esc_html__('This username already exists.', 'kofejob');
					break;
				case 'authentication_failed':
				case 'invalid_username':
					$errors[] =  esc_html__(
						"We don't have any users with that email address. Maybe you used a different one when signing up?",
						'kofejob'
					);
					break;
				case 'incorrect_password':
					$err = __(
						"The password you entered wasn't quite right.",
						'kofejob'
					);
					$errors[] =  sprintf($err, wp_lostpassword_url());
					break;
				default:
					break;
			}
		}
	}
	// Retrieve possible errors from request parameters
	if (isset($_REQUEST['register-errors'])) {
		$error_codes = explode(',', $_REQUEST['register-errors']);

		foreach ($error_codes as $error_code) {

			switch ($error_code) {
				case 'email':
					$errors[] = esc_html__('The email address you entered is not valid.', 'kofejob');
					break;
				case 'email_exists':
					$errors[] = esc_html__('An account exists with this email address.', 'kofejob');
					break;
				case 'closed':
					$errors[] = esc_html__('Registering new users is currently not allowed.', 'kofejob');
					break;
				case 'captcha-no':
					$errors[] = esc_html__('Please check reCAPTCHA checbox to register.', 'kofejob');
					break;
				case 'username_exists':
					$errors[] =  esc_html__('This username already exists.', 'kofejob');
					break;
				case 'captcha-fail':
					$errors[] = esc_html__("You're a bot, aren't you?.", 'kofejob');
					break;
				case 'policy-fail':
					$errors[] = esc_html__("Please accept the Privacy Policy to register account.", 'kofejob');
					break;
				case 'terms-fail':
					$errors[] = esc_html__("Please accept the Terms and Conditions to register account.", 'kofejob');
					break;
				case 'first_name':
					$errors[] = esc_html__("Please provide your first name", 'kofejob');
					break;
				case 'last_name':
					$errors[] = esc_html__("Please provide your last name", 'kofejob');
					break;
				case 'empty_user_login':
					$errors[] = esc_html__("Please provide your user login", 'kofejob');
					break;
				case 'password-no':
					$errors[] = esc_html("You have forgot about password.", 'kofejob', 'kofejob');
					break;
				case 'incorrect_password':
					$err = __(
						"The password you entered wasn't quite right. ",
						'kofejob'
					);
					$errors[] =  sprintf($err, wp_lostpassword_url());
					break;
				default:
					break;
			}
		}
	}
	get_header();

	$page_top = get_post_meta($post->ID, 'kofejob_page_top', TRUE);

	switch ($page_top) {
		case 'titlebar':
			get_template_part('template-parts/header', 'titlebar');
			break;

		case 'parallax':
			get_template_part('template-parts/header', 'parallax');
			break;

		case 'off':

			break;

		default:
			get_template_part('template-parts/header', 'titlebar');
			break;
	}

	 
	  ?>
	<div class="content">
	<div class="container  ">

		<div class="row">
		<div class="col-md-12 col-lg-12">
			<div class="login-wrap">
				 
 					<?php if (count($errors) > 0) : ?>
						<?php foreach ($errors  as $error) : ?>
							<div class="alert alert-danger">
								<p><?php echo esc_html($error);  ?></p>
								<a class="close"></a>
							</div>
						<?php endforeach; ?>
					<?php endif; ?>
					<?php if (isset($_REQUEST['registered'])) : ?>
						<div class="badge text-bg-success closeable">
							<p>
								<?php
								$password_field = get_option('kofejob_display_password_field');
								if ($password_field) {
									printf(
										esc_html__('You have successfully registered to %s.', 'kofejob'),
										'<strong>' . get_bloginfo('name') . '</strong>'
									);
								} else {
									printf(
										esc_html__('You have successfully registered to <strong>%s</strong>. We have emailed your password to the email address you entered.', 'kofejob'),
										get_bloginfo('name')
									);
								}

								?>
							</p>
						</div>
					<?php endif; ?>
					</div>

	</div>
	</div>
	<div class="clearfix"></div>
     <?php do_action('kofejob_login_form');	 ?>
 </div>
 </div>
			


		
<?php
	get_footer();
} else { //is logged

	get_header('dashboard');
	$current_user = wp_get_current_user();
	$user_id = get_current_user_id();
	$roles = $current_user->roles;
	$role = array_shift($roles);

	if (!empty($current_user->user_firstname)) {
		$name = $current_user->user_firstname;
	} else {
		$name =  $current_user->display_name;
	}

?>

	<!-- Dashboard -->
	<div class="content dashboard-content">
		<div class="container">
			<div class="row">

			<div class="col-xl-3 col-md-4  theiaStickySidebar">
					 
					 <div class="settings-widget">
			 <?php
			 $current_user_id = get_current_user_id();
			 $active_profile = get_user_meta($current_user_id,'_active_profile', true);
			 if(isset($active_profile) && $active_profile == 1)
			 {
				get_template_part( 'template-parts/sidebar','emp' );
			 }
			 else
			 {
				 get_template_part( 'template-parts/sidebar','free' );
			 }
			  ?>
			 </div>
			  
			 </div>

			 <div class="col-xl-9 col-md-8" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

			 <?php
				if(kofejob_fl_framework_get_options('fl_user_email_verification') != null && kofejob_fl_framework_get_options('fl_user_email_verification') == true)
				{
					$uid = get_current_user_id();
					$stored_dateTime = get_user_meta($uid,'_verify_email_resend_time', true);
					$now = time();
					$currentDateTime = date('d-m-Y H:i:s', $now);
					
					$date1 = strtotime($currentDateTime); 
					$date2 = strtotime($stored_dateTime);
					
					$diff = abs($date2 - $date1);  
  
  

					$years = floor($diff / (365*60*60*24));  
					$months = floor(($diff - $years * 365*60*60*24)  / (30*60*60*24));  
					$days = floor(($diff - $years * 365*60*60*24 -  $months*30*60*60*24)/ (60*60*24)); 
					$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)  / (60*60));  
					$minutes = floor(($diff - $years * 365*60*60*24  - $months*30*60*60*24 - $days*60*60*24  - $hours*60*60)/ 60);
					$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24  - $hours*60*60 - $minutes*60));
					

					if(strtotime($currentDateTime) > strtotime($stored_dateTime) )
					{
						$resent_msg = '<a href="javascript:void(0)" class="register_email_again"> '.esc_html__('Resend Email?','kofejob').'</a>';
					}
					else
					{
						$resent_msg = esc_html__('Resend again in ','kofejob'). $minutes.esc_html__(' minutes ','kofejob'). $seconds.esc_html__(' seconds','kofejob');
					}
					
					$is_verified = get_user_meta( $uid, 'is_email_verified', true );
					if($is_verified != 1 || $is_verified == '' )

					{
						?>
						<div class="kofejob-alert alert alert-danger alert-dismissible fade show" role="alert">
							<div class="kofejob-alart-box">
							 
								<div class="text-info">
									<h5><?php echo esc_html__('Your email address is not verified','kofejob'); ?> </h5>
									<p class="mb-0">
										<?php echo esc_html__('A verification link has been sent to your email. ','kofejob'); ?>
										<?php echo wp_return_echo($resent_msg); ?>
									</p>
									</div>
							 
							</div>
				 
 						</div>
						<?php
					}
				}
				?>
				
<!-- Titlebar --> 
<?php 
if(isset($_GET["action"])) {
	$form_edit = $_GET["action"];
} else {
	$form_edit = 'unedit';
}
?>
 	<?php

			while (have_posts()) : the_post();
				the_content();
			endwhile; // End of the loop. 
			?>
		</div>


 			</div>
			<!-- Content
			================================================== -->
			<?php
			$current_user = wp_get_current_user();

			$roles = $current_user->roles;
			$role = array_shift($roles);
			if (!empty($current_user->user_firstname)) {
				$name = $current_user->user_firstname;
			} else {
				$name =  $current_user->display_name;
			}
			?>
		 
		<!-- Navigation / End -->

		</div>
	</div>
	<!-- Dashboard / End -->
<?php
	get_footer();
} ?>