MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/language/api/index.php
<?php			

	include("../conexion.php");
	
	//cors para que puedan hacer las peticiones de otro servidor
	header('Access-Control-Allow-Origin: *');
    header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
    header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
    header("Allow: GET, POST, OPTIONS, PUT, DELETE");

	
	//sevalida en token
	$TOKEN = "7WK5T79u5mIzjIXXi2oI9Fglmgivv7RAJ7izyj9tUyQ";
	$cedulaConsultar = $_GET['cedula']; 
	
	if($_GET['token'] != $TOKEN ){
	    
	    echo '{ "res" : "token invadido", "estado" : "1" }';
	    die();
	    
	}
	
	//se llama los datos de cartera de iuris
	if(isset($_GET['consultaCartera'])){
	    
    	$consulta1 = "SELECT * FROM `cartera` where cedula = '".$cedulaConsultar."' ";
    	$result = mysqli_query($conn,$consulta1);
    	$data = mysqli_fetch_assoc($result);
    	
    	if($data){
    	    
    	    $respuesta['estado'] = 1;
    	    $respuesta['cedula'] = $data['cedula'];
    	    $respuesta['nombre'] = $data['nombre'];
    	    $respuesta['numerocontrato'] = $data['numerocontrato'];
    	    $respuesta['tipocontrato'] = $data['tipocontrato'];
    	    $respuesta['estadoCartera'] = $data['estado'];
    	    $respuesta['empresa'] = "iulargrup";
    	    
    	    echo json_encode($respuesta);
    	    
    	}else{
    	    
    	    echo '{ "res" : "sin datos", "estado" : "2" }';
    	    
    	}
    	
	}

?>