<?php
//[fbbttm-myaccount]
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
function fbbttm_foodboxbooker_myaccount(){

	global $fbbttm_helperobj,$fbbttm_orderinfoobj, $fbbttm_tabledataobj,$fbbttm_lostpassword;

	$return ='';

	if ( is_user_logged_in() ) 
		{

			

			 $navigationpath = FBBTTM_DIR . 'templates/template-parts/navigation.php';
			 $dashboard_path = FBBTTM_DIR . 'templates/myaccount.php';
			 $orderpath = FBBTTM_DIR . 'templates/dashbord.php';
			 $addresspath = FBBTTM_DIR . 'templates/address.php';
			 $editaccountpath = FBBTTM_DIR . 'templates/edit-account.php';

			 $navigation  =  $fbbttm_helperobj->fbbttm_get_filecontent( $navigationpath);
			 $dashboard   =  $fbbttm_helperobj->fbbttm_get_filecontent( $dashboard_path);
			 $orderdata   =  $fbbttm_helperobj->fbbttm_get_filecontent( $orderpath);
			 $address 	  =  $fbbttm_helperobj->fbbttm_get_filecontent( $addresspath);
			 $editaccount =  $fbbttm_helperobj->fbbttm_get_filecontent( $editaccountpath);



			$return .='<div class="fbbttm-accountpage row">
    		<div class="col-md-12">
        	<div class="fbbttm-account-menubar">';
		 	$return .= $navigation;
		 	$return .='</div>';

		 	$return .='<div class="fbbttm-account-details">';

		 	
		 	
		 	$return .= $orderdata;

		 	$return .= $dashboard;

		 	$return .= $address;

		 	$return .= $editaccount;

		 	$return .='</div>';

		 	$return .='</div></div>';



			// ob_end_clean();
			// require_once FBBTTM_DIR . 'templates/myaccount.php';

		}
		else
		{
			

		
			$my_c = filter_input( INPUT_GET, "ukey", FILTER_SANITIZE_STRING );

			$passwordpath = FBBTTM_DIR . 'templates/lost-password.php';

			$fbbttm_lostpassword  =  $fbbttm_helperobj->fbbttm_get_filecontent( $passwordpath);

			if ( !empty($my_c)) {

				$reserformpath = FBBTTM_DIR . 'templates/reset-password.php';

				$reserform  =  $fbbttm_helperobj->fbbttm_get_filecontent( $reserformpath);
			
				$return .= $reserform;



				
			}
			else
			{

			$loginregisterpath = FBBTTM_DIR . 'templates/login-register.php';

			$loginregister  =  $fbbttm_helperobj->fbbttm_get_filecontent( $loginregisterpath);

		
			$return .= $loginregister;

			$return .= $fbbttm_lostpassword;
			}
			
		}

	return $return;
}


add_shortcode( 'fbbttm-myaccount', 'fbbttm_foodboxbooker_myaccount' );
?>