<?php
/* $this->session->userdata('imazon_id_aluno') ->userdata('imazon_nome') ->userdata('imazon_email_aluno') */
$facebook_login_url = ""; #DEV
if (!$this->session->userdata('imazon_id_aluno')) {
	$facebook_login_url = $loginUrl;
}

//function codifica() { #DEV
//    return null;
//}
?>

<head>
	<base href="<?php echo base_url(); ?>" />
	<meta charset="utf-8">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta http-equiv="content-language" content="pt-br">
	<meta name="robots" content="index,follow">
	<meta http-equiv="cache-control" content="private">
	<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta name="author" content="Imazon Cursos">
	<meta name="description" content="Mais de 1000 Cursos Disponíveis com Certificado imediato válido em todo Brasil. Cursos nas áreas: Educação, Administração, Direito, Arte, Economia, Marketing, Meio Ambiente, Psicologia, Negócios, Matemática.">
	<meta name="keywords" content="imazon,imazon cursos,curso,cursos,online,certificado,profissionalizante,ead,capacitação,educação,administração,direito,arte,economia,marketing,meio ambiente,psicologia,negócios,matemática,tecnologia,biologia,cursos com certificado">
	<meta name="copyright" content="© 2007-<?php echo (new DateTime())->format('Y'); ?> Imazon Cursos">
	<meta name="msapplication-TileColor" content="#00aba9">
	<meta name="theme-color" content="#00630b">
	<meta name="msapplication-navbutton-color" content="#00630b">
	<meta name="apple-mobile-web-app-status-bar-style" content="#00630b">
	<meta name="google-site-verification" content="C3-tsLiLMF7fa2hZFsf6Cz5AQJrvriXlLtY9dTSBEsg" />
	<meta name="google-signin-client_id" content="<?php echo GOOGLE_LOGIN; ?>">
	<title><?php echo (!empty($titulo) ? $titulo : "Imazon Cursos com Certificado") ?></title>
	<link rel="icon" type="image/x-icon" href="<?php echo ROOT_URL; ?>src/ico/favicon.ico" />
	<link rel="icon" type="image/png" sizes="32x32" href="<?php echo ROOT_URL; ?>src/ico/32x32.png">
	<link rel="icon" type="image/png" sizes="192x192" href="<?php echo ROOT_URL; ?>src/ico/192x192.png">
	<link rel="icon" type="image/png" sizes="512x512" href="<?php echo ROOT_URL; ?>src/ico/512x512.png">
	<link rel="apple-touch-icon" sizes="180x180" href="<?php echo ROOT_URL; ?>src/ico/apple-icon.png">
	<link rel="mask-icon" href="<?php echo ROOT_URL; ?>src/ico/safari-pinned-tab.svg" color="#002905">
	<link rel="manifest" href="<?php echo ROOT_URL; ?>src/ico/site.webmanifest">
	<script type="text/javascript" charset="UTF-8" src="<?php echo ROOT_URL; ?>src/basic/jquery-3.4.1.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="<?php echo ROOT_URL; ?>src/basic/popper.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="<?php echo ROOT_URL; ?>src/basic/bootstrap.min.js"></script>
         <meta name = "facebook-domain-verification" content = "nrcfrszxp9tinkl9f36hv4ylm9bfa9" />
	<link type="text/css" rel="stylesheet" href="<?php echo ROOT_URL; ?>src/basic/bootstrap.min.css">
	<link type="text/css" rel="stylesheet" href="<?php echo ROOT_URL; ?>src/basic/font-awesome/css/fontawesome.min.css">
	<link type="text/css" rel="stylesheet" href="<?php echo ROOT_URL; ?>src/basic/font-awesome/css/brands.min.css">
	<link type="text/css" rel="stylesheet" href="<?php echo ROOT_URL; ?>src/basic/font-awesome/css/solid.min.css">
	<style>
		i.fab.fa-facebook.fa-lg.align-middle {
			position: relative;
			top: 4px;
		}
	</style>
        
                <!-- Global site tag (gtag.js) - Google Ads: 1036809317 -->
        <script async src="https://www.googletagmanager.com/gtag/js?id=AW-1036809317"></script>
        <script>
          window.dataLayer = window.dataLayer || [];
          function gtag(){dataLayer.push(arguments);}
          gtag('js', new Date());

          gtag('config', 'AW-1036809317');
        </script>

        
       
       

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q49823DTWZ"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-Q49823DTWZ');
</script>


<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'AW-1036809317', {
      'allow_enhanced_conversions': true
    });

var enhanced_conversion_data = {}

</script>

<?php
 if($this->uri->segment(2)=="dados_cadastro"){?>
  
<script>
    //Cadastro

var g_ED = {
    "email" : '#imz-user-email',
    "phone_number" : "#tel-cadastro"
    
    
  }

  var g_countrycode = '+55';

  window.enhanced_conversion_data = window.enhanced_conversion_data || {};
  document.addEventListener('input', g_save_toLocalStorage);
  function g_save_toLocalStorage(e) {
    var input = e.target;
    for(i in g_ED) {
      if(input.matches(g_ED[i]) ){
        localStorage['g_'+ i] = input.value;
      }
    }
    g_setup_Enhanced_Conversion_Data();
  }

  function g_setup_Enhanced_Conversion_Data(){
    for(i in g_ED) {
      if(localStorage['g_' + i]) {
        if(i == 'email' && g_validateEmail(localStorage['g_' + i])) {
          window.enhanced_conversion_data[i] = localStorage['g_' + i];
        }
        if(i == 'phone_number' && window.enhanced_conversion_data['email']) {
          window.enhanced_conversion_data[i] = g_countrycode + localStorage['g_' + i];
          window.enhanced_conversion_data[i] = window.enhanced_conversion_data[i].replace(/\D/g, '');
        }
      }
    }
  }

  function g_validateEmail(email) {
    return /\S+@\S+\.\S+/.test(email);
  }
  g_setup_Enhanced_Conversion_Data();
//COLOCAR A CONVERSÃO DE COMPRA QUE JA EXISTE 
    document.addEventListener('DOMContentLoaded', function(){
     document.querySelector('#imz-btn-submit-form').addEventListener('click', function(){
    gtag('event', 'conversion', {'send_to': 'AW-1036809317/GkVxCPqM_4ABEOXose4D'});
     })})
    
    </script>
<?php } ?>


    
 
  
</head>

<body class="d-flex flex-column min-vh-100 bg-white">
	<header id="imz-header" class="sticky-top bg-white" id="imz-navbar">
		<div class="container d-xl-block d-lg-block d-none py-1">
			<div class="row align-items-center">
				<div class="col-2"><a href="<?php echo base_url(); ?>"><img class="navbar-brand d-inline" src="<?php echo ROOT_URL; ?>src/img/imz-50.png" alt="Imazon Cursos" height="60"></a></div>
				<form class="col-6 form-inline align-self-center d-flex justify-content-center" method="POST" action="<?php echo base_url(); ?>buscar_curso">
					<input required="" class="form-control col-9" name="busca" type="text" placeholder="Digite uma palavra ex.: Educação, Saúde, Direito..." aria-label="Search">
					<button class="btn btn-outline-success ml-2" type="submit"><i class="fas fa-search"></i> Buscar</button>
				</form>
				<div class="col-4 text-center">
					<?php if ($this->session->userdata('imazon_id_aluno')) : ?>
						<a href="#" class="col badge-pill badge-light badge-success p-1"><small><?php echo (!empty($this->session->userdata('imazon_nome'))) ? $this->session->userdata('imazon_nome') : $this->session->userdata('imazon_email_aluno') ?></small></a>
						<div class="btn-group btn-sm col p-1"><a href="<?php echo base_url(); ?>dados_cadastrais" class="btn btn-sm btn-info py-0"><i class="fas fa-user-circle"></i> Meus Dados</a><a href="<?php echo base_url(); ?>logout" class="btn btn-sm btn-info py-0"><i class="fas fa-sign-out-alt"></i> Sair</a>
						</div>
					<?php else : ?>
						<div class="btn-group btn-sm">
							<a href="<?php echo base_url(); ?>pagina_login" class="btn btn-sm btn-success"><i class="fas fa-sign-in-alt align-middle"></i> Login</a>
								<a href="<?php echo $facebook_login_url; ?>" class="btn btn-sm btn-primary"><i class="fab fa-facebook fa-lg align-middle"></i></a>
								<button id="top-button" onclick="ClickLogin()" class="imz-login-google btn btn-sm btn-danger">
								<i class="fab fa-google fa-lg align-middle"></i>
							</button>
						</div>
						<a href="<?php echo base_url(); ?>pagina_cadastro"><button class="btn btn-sm btn-info d-inline mr-1"><i class="fas fa-user-circle"></i> Cadastro </button></a>
					<?php endif; ?>
				</div>
			</div>
		</div>
		<nav class="navbar navbar-expand-lg navbar-light bg-light d-flex py-0 border justify-content-around ">
			<button class="navbar-toggler border border-success" type="button" data-toggle="collapse" data-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation"><i class="fas fa-bars text-success py-auto"></i></button>
			<div class="mx-auto d-xl-none d-lg-none d-block"><a class="navbar-brand d-inline" href="<?php echo base_url(); ?>"><img class="d-inline" src="<?php echo ROOT_URL; ?>src/img/imz-50.png" class="d-inline-block align-top" alt="Imazon Cursos" height="60"></a></div>
			<?php if ($this->session->userdata('imazon_id_aluno')) : ?>
				<div class="d-xl-none d-lg-none d-block btn-group btn-sm py-1"><a href="<?php echo base_url(); ?>dados_cadastrais" class="btn btn-sm btn-info py-0"><i class="fas fa-user-circle"></i> Meus Dados</a><a href="<?php echo base_url(); ?>logout" class="btn btn-sm btn-info py-0"><i class="fas fa-sign-out-alt"></i> Sair</a></div>
				<div class="d-xl-none d-lg-none d-block text-center my-2 col-12" style="font-size:8pt;line-height:11pt;"><a href="#" class="col badge-pill badge-light badge-success p-0"><?php echo (!empty($this->session->userdata('imazon_nome'))) ? $this->session->userdata('imazon_nome') : $this->session->userdata('imazon_email_aluno') ?></a></div>
			<?php else : ?>
				<div class="text-right d-xl-none d-lg-none d-block my-2">
						<div class="btn-group btn-sm"><a href="<?php echo base_url(); ?>pagina_login" class="btn btn-sm btn-success"><i class="fas fa-sign-in-alt align-middle"></i> Login</a><a href="<?php echo $facebook_login_url; ?>" class="btn btn-sm btn-primary"><i class="fab fa-facebook fa-lg align-middle"></i></a><button id="sm-top-button" onclick="ClickLogin()" class="imz-login-google btn btn-sm btn-danger">
								<i class="fab fa-google fa-lg align-middle"></i>
						</button></div><a href="<?php echo base_url(); ?>pagina_cadastro"><button class="btn btn-sm btn-info d-i nline mr-1"><i class="fas fa-user-circle"></i> Cadastro </button></a>
				</div>
				</div>
			<?php endif; ?>
			<div class="collapse navbar-collapse" id="navbarToggler">
				<ul class="navbar-nav mr-auto mt-2 mt-lg-0 mx-auto px-3">
					<li class="nav-item nav-link"><a class="text-dark" href="<?php echo base_url(); ?>home"><i class="fas fa-home"></i> Home</a></li>
					<li class="nav-item nav-link"><a class="text-dark" href="<?php echo base_url(); ?>cursos"><i class="fas fa-book"></i> Cursos</a></li>
					<?php if ($this->session->userdata('imazon_id_aluno')) : ?>
						<li class="nav-item nav-link"><a class="text-dark" href="<?php echo base_url(); ?>cursos_matriculados"><i class="fas fa-book-reader"></i> Estudar | Certificado</a></li>
							<?php //<li class="nav-item nav-link"><a class="text-dark" href="'.ROOT_URL.'ganhe/cliente/index/<?php echo codifica($this->session->userdata('imazon_id_aluno')); ? >"><i class="fas fa-user-friends"></i> Indique e Ganhe</a></li> ?>
							<li class="nav-item nav-link"><a class="text-dark" href="ganhe_dinheiro"><i class="fas fa-user-friends"></i> Ganhe Dinheiro</a></li>
						<?php else : ?>
						<li class="nav-item nav-link"><a class="text-dark" href="<?php echo base_url(); ?>autenticacao"><i class="fas fa-award"></i> Certificado</a></li>
					<?php endif; ?>
					<li class="nav-item nav-link"><a class="text-dark" href="<?php echo base_url(); ?>suporte"><i class="fas fa-comment-dots"></i> Suporte</a></li>
				</ul>
			</div>
		</nav>
		<nav class="navbar navbar-light bg-light d-xl-none d-lg-none d-block border-top">
			<form class="form-inline col-md-10 col-12 align-self-center d-flex justify-content-center mx-auto" method="POST" action="<?php echo base_url(); ?>buscar_curso"><input required="" name="busca" class="form-control col mr-sm-2" type="search" placeholder="Educação, Saúde, Direito..." aria-label="Search"><button class="btn btn-outline-success ml-2" type="submit"><i class="fas fa-search"></i></button></form>
		</nav>
	</header>
	<div id="imz-alert-default" class="container"></div>
	<section id="imz-principal-section">
		<script>
			/**
  Renderiza o botão de login na tela
*/
			function renderButton() {
				gapi.signin2.render('top-button', {
					'scope': 'email profile https://www.googleapis.com/auth/plus.login', // solicitando acesso ao profile e ao e-mail do usuário
					'width': 20,
					'height': 20,
					'longtitle': true,
					'theme': 'dark',
					'onsuccess': onSuccess,
					'onfailure': onFailure,
					'onSignIn': onSignIn
				});

				gapi.signin2.render('sm-top-button', {
					'scope': 'email profile https://www.googleapis.com/auth/plus.login', // solicitando acesso ao profile e ao e-mail do usuário
					'width': 20,
					'height': 20,
					'longtitle': true,
					'theme': 'dark',
					'onsuccess': onSuccess,
					'onfailure': onFailure,
					'onSignIn': onSignIn
				});
			}

			/**
			  Função executada quando o login é efetuado com sucesso
			*/
			function onSuccess(googleUser) {
				//console.log('OnSuccess');
				//console.log(typeof clicked);
				if (typeof clicked !== 'undefined') {

					var profile = googleUser.getBasicProfile();
					var email = profile.getEmail();

					$.post('<?php echo base_url(); ?>verifica_cadastro', {
						email: email
					}, function(e) {

						if (e == "true") {

							$.post('<?php echo base_url(); ?>site/logar_google', {
								email: email
							}, function(login) {
								if (login == 'ok') {
									window.location.href = "<?php echo base_url(); ?>cursos_matriculados";
								} else {
									window.location.href = "<?php echo base_url(); ?>cursos";
								}
							});
						} else {

							$.post('<?php echo base_url(); ?>site/cadastrar_google', {
								email: email
							}, function(add) {
								window.location.href = "<?php echo base_url(); ?>cursos_matriculados";
							});

						}

					});

				}
			}

			/**
			  Função executada quando ocorrer falha no logn
			*/
			function onFailure(error) {
				//console.log('OnFailure');
				console.log(error);
			}

			function onSignIn(googleUser) {
				//console.log('onSignIn');
				if (typeof clicked !== 'undefined') {

					var profile = googleUser.getBasicProfile();
					var email = profile.getEmail();

					$.post('<?php echo base_url(); ?>verifica_cadastro', {
						email: email
					}, function(e) {

						if (e == "true") {

							$.post('<?php echo base_url(); ?>site/logar_google', {
								email: email
							}, function(login) {
								if (login == 'ok') {
									window.location.href = "<?php echo base_url(); ?>cursos_matriculados";
								} else {
									window.location.href = "<?php echo base_url(); ?>cursos";
								}
							});
						} else {

							$.post('<?php echo base_url(); ?>site/cadastrar_google', {
								email: email
							}, function(add) {
								window.location.href = "<?php echo base_url(); ?>cursos_matriculados";
							});

						}

					});

				}
			}
		</script>
		<script>
			$(function() {

				document.addEventListener('keydown', function(event) {


					function detectmob() {
						if (navigator.userAgent.match(/Android/i) ||
							navigator.userAgent.match(/webOS/i) ||
							navigator.userAgent.match(/iPhone/i) ||
							navigator.userAgent.match(/iPad/i) ||
							navigator.userAgent.match(/iPod/i) ||
							navigator.userAgent.match(/BlackBerry/i) ||
							navigator.userAgent.match(/Windows Phone/i)
						) {
							return true;
						} else {
							return false;
						}
					}


					function autoCompleteMobile() {
						var key = event.key;
						var keyCode = event.keyCode;
						if (keyCode == '229' || keyCode == 229 || key == '@') {

							$('#imz-user-email').on('keypress input', function() {
								//$("#tags").keypress(function(event){

								var email_valid = $(this).val();

								var email_valid = email_valid.replace('@', '');

								var domains = [
									"@gmail.com",
									"@hotmail.com",
									"@yahoo.com",
									"@yahoo.com.br",
									"@outlook.com",
									"@bol.com.br",
									"@live.com"
								];

								var user_mail = [];
								var i;

								for (i = 0; i < domains.length; i++) {
									user_mail[i] = email_valid + domains[i];
								}

								//console.log(user_mail);

								$("#imz-user-email").autocomplete({
									source: user_mail
								});

								//}

							});
						}
					}

					function autoCompleteDesktop() {
						var key = event.key;
						var keyCode = event.keyCode;
						if (keyCode == '229' || keyCode == 229 || key == '@') {

							//$('#tags').on('keypress input', function(){
							$("#imz-user-email").keypress(function(event) {

								var email_valid = $(this).val();

								var email_valid = email_valid.replace('@', '');

								var domains = [
									"@gmail.com",
									"@hotmail.com",
									"@yahoo.com",
									"@yahoo.com.br",
									"@outlook.com",
									"@bol.com.br",
									"@live.com"
								];

								var user_mail = [];
								var i;

								for (i = 0; i < domains.length; i++) {
									user_mail[i] = email_valid + domains[i];
								}

								//console.log(user_mail);

								$("#imz-user-email").autocomplete({
									source: user_mail
								});

								//}

							});
						}
					}

					var isMobile = detectmob();

					if (isMobile) {
						autoCompleteMobile(event);
					} else {
						autoCompleteDesktop(event);
					}



					//}

				});


			});
		</script>
		<script src="https://apis.google.com/js/platform.js?onload=renderButton" async defer></script>