<?php
include('conexion.php');
$usu = addslashes($_POST['usu']);
$pass = addslashes($_POST['pass']);

$usuario = mysqli_query($conexion,"SELECT * FROM Admin WHERE Usuario = '$usu'");
if(mysqli_num_rows($usuario)<1){
	echo 'usuario';
}else{
		$consulta = mysqli_query($conexion,"SELECT * FROM Admin WHERE Usuario = '$usu' AND pass = '$pass'");
		if(mysqli_num_rows($consulta)<1){
			echo 'password';
		}else{
			$consulta2 = mysqli_fetch_array($consulta);
			$_SESSION['id_usu'] = $consulta2['Usuario'];
			$_SESSION['id_usua'] = $consulta2['IdUsuario'];
			$_SESSION['nom_admin'] = $consulta2['Nombre'].' '.$consulta2['Apellido'];
			echo '1';
		}
	}

?>
