<?php

	if( !defined( 'MAP_PLUGIN_NAME' ) )
	{
	    exit('Not allowed.');
	}

	$locale   = MyAgilePrivacy::get_locale();
	$is_pro   = isset( $the_settings['pa'] ) && $the_settings['pa'] == 1;
	$is_it    = $locale == 'it_IT';

	$utm_medium = $is_pro ? 'plugin-pro' : 'plugin-basic';
	$banner     = $is_it  ? 'banner_ita.png' : 'banner_eng.png';

	if( $is_pro && $is_it )
	{
	    $banner = 'banner_pro_ita.png';
	}
	elseif( $is_pro && !$is_it )
	{
	    $banner = 'banner_pro_eng.png';
	}

	$url        = 'https://www.myagileprivacy.com/?utm_source=referral&utm_medium=' . $utm_medium . '&utm_campaign=backend';
	$banner_url = esc_attr( plugin_dir_url( __DIR__ ) ) . '../img/' . $banner;

	echo '<a href="' . esc_url( $url ) . '" target="blank"><img class="img-fluid" src="' . $banner_url . '" style="width:100%;"></a>';
?>

<div>

	<div class="my-5 d-flex flex-row justify-content-center">

		<a href="https://cmppartnerprogram.withgoogle.com/" target="_blank" rel="nofollow" style="margin-left:15px;margin-right:15px;cursor:pointer;"><img src="<?php echo esc_attr( plugin_dir_url( __DIR__  ) ); ?>../img/google-official-CMP-partner.png" style="height:60px; cursor:pointer;"></a>

		<a href="https://support.google.com/admanager/answer/13554116?hl=en&ref_topic=9760861&sjid=17685026765202216942-AP#zippy=,google-certified-cmps" target="_blank" rel="nofollow" style="margin-left:15px;margin-right:15px;cursor:pointer;"><img src="<?php echo esc_attr( plugin_dir_url( __DIR__  ) ); ?>../img/google-cmp-badge.png" style="height:60px; cursor:pointer;"></a>

		<a href="https://iabeurope.eu/cmp-list/" target="_blank" rel="nofollow"  style="margin-left:15px;margin-right:15px;cursor:pointer;"><img src="<?php echo esc_attr( plugin_dir_url( __DIR__  ) ); ?>../img/iab-banner.png" style="height:60px; cursor:pointer;"></a>

		<a href="https://help.ads.microsoft.com/#apex/ads/en/60119/1-500" target="_blank" rel="nofollow" style="margin-left:15px;margin-right:15px;cursor:pointer;"><img src="<?php echo esc_attr( plugin_dir_url( __DIR__  ) ); ?>../img/microsoft-uet-banner.png" style="height:60px; cursor:pointer;"></a>

	</div>
</div>

<?php

	$installed_html = '';

	if( isset( $map_stats ) && $map_stats && $map_stats->active_installs )
	{
		$installed_html = '<br><b>'.intval( $map_stats->active_installs ).'+</b>';

		if( $locale == 'it_IT' )
		{
			$installed_html .= ' installazioni attive';
		}
		else
		{
			$installed_html .= ' active installations';
		}
	}

?>
<div>
	<div class="">
		<a href="<?php echo esc_attr( admin_url('edit.php?post_type=my-agile-privacy-c&page=my-agile-privacy-c_helpdesk') ); ?>" class="btn btn-success d-flex justify-content-center align-items-center gap-4">
			<i class="fa-regular fa-circle-question fa-xl"></i>
			<span style="text-align: left;">
				<?php echo wp_kses_post( __( '<strong>Do you need support?</strong><br><u>Click here</u> and check the Help Desk section', 'MAP_txt' ) ); ?>

			</span>
		</a>
	</div>
	<p class="text-center"><?php echo $installed_html; ?></p>
</div>
