<?php 
/*
 * Reset password template
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

   global $fbbttm_myaccountobj,$fbbttm_lostpassword,$fbbttm_allowed_html;
   
   $keydata = $fbbttm_myaccountobj->fbbttm_get_keyvalid();
  
   $formshow = $keydata['showresetbox'];
   if($formshow == 'Yes'){

   	$userid= $keydata['fbbttm-userid'];
   	$activekey= $keydata['fbbttm-activation-key'];
?>	

<div class="row fbbttm-resetpassword">

	<div class="fbbttm-resetpassword-content">

		<form name="fbbttm-resetpassword" id="fbbttm-reset-password" method="post">
			<?php
    	// Noncename needed to verify where the data originated
    		wp_nonce_field( 'fbbttm_meta_box_nonce', 'fbbttm_meta_box_noncename' );
			?>
			<h3><?php echo esc_html__('Enter a new password below.','foodboxbooker');?></h3>

			<div class="fbbttm-error fbbttm-common-error"></div>

			<div class="col-md-12">	

				<div class="col-md-6">

					<label><?php echo esc_html__('New password','foodboxbooker');?><req>*</req></label>
					<input type="password" name="fbbttm-password" id="fbbttm-password">
					<div class="fbbttm-error fbbttm-password"></div>
				</div>
				<div class="col-md-6">
					<label><?php echo esc_html__('Re-enter new password','foodboxbooker');?><req>*</req></label>
					<input type="password" name="fbbttm-password-1" id="fbbttm-password-1">
					<div class="fbbttm-error fbbttm-password-1"></div>
				</div>

			</div>
			<div class="col-md-12">
				<input type="hidden" name="fbbttm-userid" id="fbbttm-userid" value="<?php echo esc_html($userid);?>">
				<input type="hidden" name="fbbttm-activekey" id="fbbttm-activekey" value="<?php echo esc_html($activekey);?>">

				<input type="submit" name="fbbttm-submit" id="fbbttm-reset-submit" value="<?php echo esc_html__('Submit','foodboxbooker');?>" />
				<div class="fbbttm-loader hide"></div> 
			</div>
			<div class="fbbttm-message fbbttm-successmsg"></div>
			<div class="fbbttm-error php-error"></div>
		</form>
	</div>

</div>

<?php } else{

?>
<div class="fbbttm-resetpassword">
	  <p class="fbbttm-message">
		<input type="hidden" name="resetpasswordlost" id="resetpasswordlost" value="1">
			 <?php 
				 $messsage = $keydata['errormessage'];
				 echo esc_html($messsage);
			 ?>
		 	 <a class=""></a>
	   </p>
	<?php
		require_once FBBTTM_DIR . '/templates/lost-password.php';
		echo wp_kses($fbbttm_lostpassword,$fbbttm_allowed_html);
	?>
 </div>
<?php } ?>