<?php
session_start();
include("config.php");
$uName = $_POST['login_username'];
$pWord = $_POST['login_userpass'];
if($uName && $pWord){
	$qry 	 = "SELECT usuario, clave FROM usuario WHERE usuario='".mysqli_real_escape_string($con,$uName)."' AND clave='".mysqli_real_escape_string($con,$pWord)."' AND estado=1";
	$res 	 = mysqli_query($con,$qry);
	$num_row = mysqli_num_rows($res);
	$row	 = mysqli_fetch_assoc($res);
	if( $num_row == 1 ) {
		$_SESSION['user'] = $row['usuario'];
		$_SESSION['pass'] = $row['clave'];
		echo 1;		
	}else {
		echo 8;
	}
}else{
	echo 7;
}
?>