<?php
$idioma = "es";
if (isset($_COOKIE["idioma"])) {
	$idioma = isset($_COOKIE["idioma"]) ? $_COOKIE["idioma"] : "es";
}
?>

<!DOCTYPE html>
<html translate="no" lang="es">
<!--================================================================================
	Item Name: Materialize - Material Design Admin Template
	Version: 4.0
	Author: PIXINVENT
	Author URL: https://themeforest.net/user/pixinvent/portfolio
================================================================================ -->

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="msapplication-tap-highlight" content="no">
	<meta name="description" content="Dialvox, un sistema para Call Centers, con conexión a cualquier tipo de telefonía pública. Es ideal para campañas de inbound o entrantes ya que permite tener un control absoluto de la productividad de los agentes y del resultado de las campañas.">
	<meta name="keywords" content="sisvox, call center, dialvox, contact center, ia">
	<title>
		<?= SITE_NAME ?>
	</title>
	<!-- Favicons-->
	<link rel="icon" href="/<?= RUTA_MAESTRA ?>/public/login/images/favicon/favicon-32x32.png" sizes="32x32">
	<!-- Favicons-->
	<link rel="apple-touch-icon-precomposed" href="/<?= RUTA_MAESTRA ?>/public/login/images/favicon/apple-touch-icon-152x152.png">
	<!-- For iPhone -->
	<meta name="msapplication-TileColor" content="#00bcd4">
	<meta name="msapplication-TileImage" content="/<?= RUTA_MAESTRA ?>/public/login/images/favicon/mstile-144x144.png">
	<script type="text/javascript" src="/<?= RUTA_MAESTRA ?>/public/login/js/jquery.min.js"></script>
	<!-- CORE CSS-->
	<link href="/<?= RUTA_MAESTRA ?>/public/login/css/materialize.css" type="text/css" rel="stylesheet">
	<link href="/<?= RUTA_MAESTRA ?>/public/login/css/login/style.css" type="text/css" rel="stylesheet">
	<!-- Custome CSS-->
	<link href="/<?= RUTA_MAESTRA ?>/public/login/css/login/page-center.css" type="text/css" rel="stylesheet">
	<!-- INCLUDED PLUGIN CSS ON THIS PAGE -->
	<link href="/<?= RUTA_MAESTRA ?>/public/login/css/perfect-scrollbar.css" type="text/css" rel="stylesheet">
	<link href="<?= LIB_JS ?>fonts/material_icons.css" rel="stylesheet">
	<link href="<?= CSS_ADMIN; ?>flag-icon.css" type="text/css" rel="stylesheet">
	<script src="<?= JS_ADMIN; ?>gettext.js" type="text/javascript"></script>
	<script src="<?= JS_ADMIN; ?>traduccion.js?version=<?= md5_file(RUTA_APP . "public/homeAdmin/js/traduccion.js"); ?>" type="text/javascript"></script>
	<script>
		seleccionarIdioma("<?= $idioma; ?>")
	</script>
</head>

<body class="grey lighten-5">

	<!-- Start Page Loading -->
	<div id="loader-wrapper">
		<div id="loader"></div>
		<div class="loader-section section-left"></div>
		<div class="loader-section section-right"></div>
	</div>

	<!-- End Page Loading -->
	<div id="login-page" class="row">
		<div class="col s12 z-depth-4 card-panel">
			<form class="login-form" onsubmit="return validarUser()" autocomplete="false">
				<?php if (defined('LOGO_LOGIN')) { ?>
					<div class="row">
						<div class="col s12 center">
							<?php echo "<img src=\"" . LOGO_LOGIN . "\" style=\"height: 48px; width: auto;\" />"; ?>
						</div>
					</div>
				<? } ?>
				<div class="row">
					<div class="col s12 center">
						<span class="center logo-text grey-text" style="font-family:'calibri'; font-size:45px;">DialVox</span>
						<br>
						<span class="center logo-text black-text" style="font-family:'calibri'; font-size:20px;">Login</span>
					</div>
				</div>
				<div class="row ">
					<div class="input-field col s12">
						<i class="material-icons prefix pt-5">person_outline</i>

						<input id="login_username" type="text" onkeyup="dameCampanas()" autocomplete="new-password">
						<label class="active" for="login_username">{{traducirFrase("Usuario")}}</label>
					</div>
				</div>
				<div class="row ">
					<div class="input-field col s12">
						<i class="material-icons prefix pt-5">lock_outline</i>
						<input id="login_password" type="password" onkeyup="dameCampanas()" autocomplete="new-password">
						<label class="active" for="login_password">{{traducirFrase("Contraseña")}}</label>
					</div>
				</div>
				<div class="row ">
					<div class="input-field col s12">
						<i class="material-icons prefix pt-5">language</i>
						<div id="banderaPais" style="display: none;"></div>
						<select value="<?= $idioma; ?>" class="browser-default" id="idioma" onchange="cambiaridioma()" style="margin-left: 3rem; width: 85%;">
							<option value='es'>{{traducirFrase("Español")}}</option>
							<option value='en'>{{traducirFrase("Inglés")}}</option>
						</select>
					</div>
				</div>
				<div class="row" id="bloqueCampanas">
					<div class="col s12 m12 l12 ml-2 mt-3">
						<select id="select">
							<option disabled selected value="">{{traducirFrase("Seleccione una campaña")}}</option>
						</select>
						<label for="select" class="active">{{traducirFrase("Campaña")}}</label>
					</div>
				</div>
				<div class="row" id="Extension">
					<div class="input-field col s12">
						<i class="material-icons prefix pt-5">local_phone</i>
						<input id="ext_num" type="text" autocomplete="new-password">
						<label class="active" for="ext_num">{{traducirFrase("Extensión")}}</label>
					</div>
				</div>
				<div class="row" id="PassExt">
					<div class="input-field col s12">
						<i class="material-icons prefix pt-5">lock</i>
						<input id="ext_pass" type="password" autocomplete="new-password">
						<label class="active" for="ext_pass">{{traducirFrase("Contraseña de extensión")}}</label>
					</div>
				</div>
				<p id="mainError" class="red-text text-lighten-1 center" style="transition: all 237ms ease-in-out; opacity: 0;">
					texto
				</p>
				<div class="row">
					<div class="input-field col s12">
						<button style="background-color: #212121  !important;" class="btn waves-effect waves-light col s12" type="submit" id="boton">Login</button>
					</div>
				</div>
				<p id="error">
					<font color="red">{{traducirFrase("Usuario no encontrado o contraseña incorrecta")}}</font />
				</p>
				<p id="error1">
					<font color="red">{{traducirFrase("Campaña invalida o no seleccionada")}}</font />
				</p>
				<p id="error2">
					<font color="red">{{traducirFrase("Extensión no encontrada o contraseña de extensión incorrecta")}}</font />
				</p>
				<p id="error3">
					<font color="red">{{traducirFrase("No hay registros marcables en la campaña")}}</font />
				</p>
			</form>
		</div>
		<div id='DivPost'></div>
	</div>
	<!-- ================================================
    Scripts
    ================================================ -->
	<!--materialize js-->
	<script type="text/javascript" src="/<?= RUTA_MAESTRA ?>/public/login/js/materialize.min.js"></script>
	<!--scrollbar-->
	<script type="text/javascript" src="/<?= RUTA_MAESTRA ?>/public/login/js/perfect-scrollbar.min.js"></script>
	<!--plugins.js - Some Specific JS codes for Plugin Settings-->
	<script type="text/javascript" src="/<?= RUTA_MAESTRA ?>/public/login/js/login/plugins.js"></script>
	<!-- Vue Js -->
	<script src="<?= JS_ADMIN; ?>vue.js" type="text/javascript"></script>
	<!-- Sweet alerts -->
	<script src="<?= LIB_JS; ?>sweetalert2.js" type="text/javascript"></script>
	<script>
		<?php echo file_get_contents("scripts" . DIRECTORY_SEPARATOR . "vue.app.js", TRUE) ?>
	</script>
	<!--custom-script.js - Add your own theme custom JS-->