<?php
defined('ABSPATH') or die('this is the last candy you will eat...');
global $mad;
$fp_id = get_option( 'page_on_front' );
$cookies_page=get_field('cookies_page',$fp_id);
if(!defined('mad_pos_lag')){
	?>
<div class="site_loader">
	<div class="load_1" <?php if($mad->get_lang()===false){ echo ' ok="0" '; }else{echo ' ok="1" style="display:none;"';}?>>
		<h3 align="center"><?=__('Language | Lingua',tdomain);?></h3>
		<div class="content">
			<ul class="site_loader_languages_menu" align="center" ajax_call="<?=site_url();?>/wp-admin/admin-ajax.php" ajax_nonce="<?=wp_create_nonce("load_madness");?>">
				<?php
				$languages=icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
				if(!empty($languages)){
					foreach($languages as $lang_id=>$lang){
						?><li><a href="<?=$lang_id;?>" language_switcher="<?=$lang_id;?>" class="<?=($lang['active']==1)?'active':'';?>"><?=$lang['native_name'];?></a></li><?php
					}
				}
				?>
			</ul>
		</div>
		<div class="standby" style="display:none;">
			<?php if($mad->get_lang()===false){
				?>
			<p align="center">Applying please wait....</p>
			<p align="center">Aplicando, Por favor aguarde</p>
				<?php
			}else{
				?>
			<p align="center"><?=__('Applying please wait....',tdomain);?></p>
				<?php
			}?>
			<?php require('preloader_parts/standby.php');?>
		</div>
	</div>
	<div class="load_2" <?php 
		if(($mad->get_cookie_policy()===false) && ($mad->get_lang()===false)){
			 echo ' ok="0" style="display:none;"'; 
		}elseif(($mad->get_cookie_policy()===false) && ($mad->get_lang()!==false)){
			echo ' ok="0"';
		}elseif(($mad->get_cookie_policy()!==false)){
			echo ' ok="1" style="display:none;"';
		}?>>
		<h3 align="center"><?=get_the_title($cookies_page);?></h3>
		<div class="content" align="center" ccpg="<?=$cookies_page;?>" fpg="<?=$fp_id;?>" fpg_nm="<?=get_the_title($fp_id);?>" ccpg_nm="<?=get_the_title($cookies_page);?>" sub2="0">
			<div class="page_container"><?php 
			$page=get_page($cookies_page);
			echo apply_filters('the_content', $page->post_content);
			?>
			</div>
			<div class="container_buttons" ajax_call="<?=site_url();?>/wp-admin/admin-ajax.php" ajax_nonce="<?=wp_create_nonce("load_madness");?>">
				<a href="" data-continue="step_3" class="buttons"><?=__('I Accept this Information',tdomain);?><span><?=__('You will continue on this site',tdomain);?></span></a>
				<a href="https://google.pt/" class="buttons"><?=__('I Do not Accept this Information',tdomain);?><span><?=__('You will be redirected to google',tdomain);?></span></a>
			</div>
			<p>&nbsp;</p>
		</div>
		<div class="standby" style="display:none;">
			<?php if($mad->get_lang()===false){
				?>
			<p align="center">Applying please wait....</p>
			<p align="center">Aplicando, Por favor aguarde</p>
				<?php
			}else{
				?>
			<p align="center"><?=__('Applying please wait....',tdomain);?></p>
				<?php
			}?>
			<?php require('preloader_parts/standby.php');?>
		</div>
	</div>
	<div class="load_3" ok="0" <?=(($mad->get_cookie_policy()===false) || ($mad->get_lang()===false))?'style="display:none;"':'';?>>
		<h3 align="center"><?=__('Loading the Web APP Files',tdomain);?></h3>
		<div class="content" align="center">
			<?php require('preloader_parts/part_3.php');?>
		</div>
	</div>
</div>
<?php
}else{
	?>
	<div class="load_1" <?php echo ' ok="0" pre_ok="'.(($mad->get_lang()===false)?'0':'1').'"';?>>
		<h3 align="center"><?=__('Language | Lingua',tdomain);?></h3>
		<div class="content" style="display:none;">
			<ul class="site_loader_languages_menu" align="center" ajax_call="<?=site_url();?>/wp-admin/admin-ajax.php" ajax_nonce="<?=wp_create_nonce("load_madness");?>">
				<?php
				$languages=icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
				if(!empty($languages)){
					foreach($languages as $lang_id=>$lang){
						?><li><a href="<?=$lang_id;?>" language_switcher="<?=$lang_id;?>" class="<?=($lang['active']==1)?'active':'';?>"><?=$lang['native_name'];?></a></li><?php
					}
				}
				?>
			</ul>
		</div>
		<?php require('preloader_parts/standby.php');?>
	</div>
	<div class="load_2" <?php 
		if(($mad->get_cookie_policy()===false) && ($mad->get_lang()===false)){
			 echo ' ok="0" style="display:none;"'; 
		}elseif(($mad->get_cookie_policy()===false) && ($mad->get_lang()!==false)){
			echo ' ok="0"';
		}elseif(($mad->get_cookie_policy()!==false)){
			echo ' ok="1" style="display:none;"';
		}?>>
		<h3 align="center"><?=get_the_title($cookies_page);?></h3>
		<div class="content" align="center" ccpg="<?=$cookies_page;?>" fpg="<?=$fp_id;?>" fpg_nm="<?=get_the_title($fp_id);?>" ccpg_nm="<?=get_the_title($cookies_page);?>" sub2="1">
			<div class="page_container"><?php 
			$page=get_page($cookies_page);
			echo apply_filters('the_content', $page->post_content);
			?>
			</div>
			<div class="container_buttons" ajax_call="<?=site_url();?>/wp-admin/admin-ajax.php" ajax_nonce="<?=wp_create_nonce("load_madness");?>">
				<a href="" data-continue="step_3" class="buttons"><?=__('I Accept this Information',tdomain);?><span><?=__('You will continue on this site',tdomain);?></span></a>
				<a href="https://google.pt/" class="buttons"><?=__('I Do not Accept this Information',tdomain);?><span><?=__('You will be redirected to google',tdomain);?></span></a>
			</div>
			<p>&nbsp;</p>
		</div>
			<?php require('preloader_parts/standby.php');?>
	</div>
	<div class="load_3" ok="0" <?=(($mad->get_cookie_policy()===false) || ($mad->get_lang()===false))?'style="display:none;"':'';?>>
		<h3 align="center"><?=__('Loading the Web APP Files',tdomain);?></h3>
		<div class="content" align="center">
			<?php require('preloader_parts/part_3.php');?>
		</div>
	</div>
<?php
}
?>