<?
session_start();
require("../funciones/post_get.php");
require("../class/bd.php");

$baseConfig='wwwsolin_configuracion_2018';
$bd= new MySQL('wwwsolin_solinix','Holasolinix1*',$baseConfig);
$bd->ConectarFTP();

if(isset($_POST['user_login'])){
	$user_login=$_POST['user_login'];
}else{
	$user_login='';
}

if(isset($_POST['user_pass'])){
	$user_pass=$_POST['user_pass'];
}else{
	$user_pass='';
}

//Conexion con la base
$result=$bd->consulta("select ges_id, ges_nom, ges_consu from gestor where ges_login='$user_login' and ges_pass='$user_pass'");
if($bd->num_rows($result)==0)
{
	?>
	<script language="JavaScript">
	alert("Datos Incorrectos");
	//location.href="index.php";
	</script>
	<?
}
else
{
	$row=$bd->fetch_array($result);
	$ges_id=$row["ges_id"];
	$ges_nom=$row["ges_nom"];
	$ges_consu=$row["ges_consu"];
	
	$_SESSION['ges_id'] = $ges_id;
	$_SESSION['ges_nom'] = $ges_nom;
	$_SESSION['ges_consu'] = $ges_consu;

	?>
	<script language="JavaScript">
	location.href="../plataforma/index.php";
	</script>
	<?
}
?>
