<?php  

 session_start();
 error_reporting(0);
//  include('../../../DesertGraphicsLtda/validadores/validarSession.php');
 include('include/conexion.php');
 include('include/conexion1.php');
 include('include/conexion3.php');
$user=$_POST['email'];
$pass=$_POST['password'];

  $query = "select * from sto_users where user_correo='$user' and user_clave='$pass'";
  $stmt = $DBcon->prepare( $query );
  $stmt->execute();

  if($stmt->rowCount() > 0) {
      while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
          extract($row);
          $_SESSION['admin'] = $id_users;
          $_SESSION['nombre'] = $user_nombre;
          $_SESSION['cargo'] = $user_cargo;
          $nameuser="paso!";
      }
    }


if ($nameuser) {
  echo json_encode(array('success' => true));
} else {
  echo json_encode(array('success' => false));
}


?>