<?php

include('../../path.php');

require_once(ROOT_CONFIG);



$action=!empty($_REQUEST['action'])?$_REQUEST['action']:''; 



switch ($action) {



    case 'validar-telefono':

        $_Telefono=!empty($_REQUEST['telefono'])?$_REQUEST['telefono']:''; 

        $_Id=!empty($_REQUEST['id'])?$_REQUEST['id']:''; 

        $Odbj_conexion = new odbconexion;

        $conexion=$Odbj_conexion->openconection();

        if($_Id>0){

            $consulta="SELECT * FROM login_appquadrata WHERE Login_Telefono='$_Telefono' AND IdLoginr!='$_Id'";

        }else{

            $consulta="SELECT * FROM login_appquadrata WHERE Login_Telefono='$_Telefono'";

        }

        $Array_adapter=$conexion->query($consulta);

        $conexion->close();

        echo json_encode($Array_adapter->num_rows);

    break;



    

    case 'validar-correo':

        $_Correo=!empty($_REQUEST['correo'])?$_REQUEST['correo']:''; 

        $_Id=!empty($_REQUEST['id'])?$_REQUEST['id']:''; 

        $Odbj_conexion = new odbconexion;

        $conexion=$Odbj_conexion->openconection();

        if($_Id>0){

            $consulta="SELECT * FROM login_appquadrata WHERE Login_Correo='$_Correo' AND IdLoginr!='$_Id'";

        }else{

            $consulta="SELECT * FROM login_appquadrata WHERE Login_Correo='$_Correo'";

        }

        $Array_adapter=$conexion->query($consulta);

        $conexion->close();

        echo json_encode($Array_adapter->num_rows);

    break;



    default:

        

        break;

}

?>

