Git Product home page Git Product logo

datos-peru's Introduction

Datos Perú

Busca datos de ciudadanos Peruanos a partir de su CUI o Numero de DNI.

Instalacion mediante composer

	composer require -o "jossmp/datos-peru"
<?php
    require ("./vendor/autoload.php");
    ...
?>

Pre-requisitos

- cURL
- PHP 5.2.0 o superior

Metodo de Uso

<?php
	require_once("/vendor/autoload.php");

	$rop = new \jossmp\jne\rop(); // Registro de Organicaciones Politicas
	$essalud = new \jossmp\essalud\asegurado();
	$servir = new \jossmp\servir\servir();
	//$mtc = new \jossmp\mtc\conductor(); //Miniterio de trasporte y comunicaciones

	$dni = "44274795";

    $search1 = $rop->consulta( $dni );
	$search2 = $essalud->consulta( $dni );
	$search3 = $servir->consulta( $dni );

    if( $search1->success == true )
	{
		echo "Hola: " . $search1->result->nombres;
	}

	if( $search2->success == true )
	{
		echo "Hola: " . $search2->result->nombre;
	}

	if( $search2->success == true )
	{
		echo "Hola: " . $search3->result->nombre;
	}
?>

Estructura datos EsSalud

{
    "success": true,
    "result": {
        "dni": "44274795",
        "verificacion": 0,
        "paterno": "MAZCO",
        "materno": "PUMA",
        "nombre": "JOSUE",
        "sexo": "Masculino",
        "nacimiento": "22/**/****",
        "gvotacion": null
    },
    "asegurado": null
}

Estructura datos SERVIR y JNE(Registro de Org. Politicas)

{
    "success": true,
    "result": {
        "dni": "44274795",
        "verificacion": 0,
        "paterno": "MAZCO",
        "materno": "PUMA",
        "nombre": "JOSUE",
        "sexo": null,
        "nacimiento": null,
        "gvotacion": null
    }
}

Estructura datos RENIEC - Padron electoral (No disponible)

{
	"success": true,
	"result": {
		"dni": "44274795",
		"digito_control": 0,
		"nombres": "JOSUE",
		"apellidos": "MAZCO PUMA",
		"gvotacion": "244954",
		"distrito": "AZANGARO",
		"provincia": "AZANGARO",
		"departamento": "PUNO"
	}
}

Mostrar Resultados en JSON / XML

<?php
	...
	if( $search->success == true )
	{
		echo $search->json( );
		echo $search->json( 'callback_js' );
	}

	if( $search->success == true )
	{
		echo PHP_EOL . $search->xml( );
		echo PHP_EOL . $search->xml( 'persona' ); // define nodo raiz
	}
?>

Donaciones: PayPal

Copyright (C), 2018 Josue Mazco GNU General Public License 3 (http://www.gnu.org/licenses/)

datos-peru's People

Contributors

jossmp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

datos-peru's Issues

Parameter must be an array or an object that implements Countable

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\datos-peru-master\src\essalud\essalud.php on line 56

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\datos-peru-master\src\curl.php on line 202

not working

`<?php
//require_once("/vendor/autoload.php");
require_once 'vendor/autoload.php';
$rop = new \jossmp\jne\rop(); // Registro de Organicaciones Politicas
$essalud = new \jossmp\essalud\asegurado();
$servir = new \jossmp\servir\servir();
$mtc = new \jossmp\mtc\conductor(); //Miniterio de trasporte y comunicaciones

$dni = "12345678";

$search1 = $rop->consulta($dni);
$search2 = $essalud->consulta($dni);
$search3 = $servir->consulta($dni);
$search4 = $mtc->consulta($dni);

if ($search1->success == true) {
print_r($search1->json());
} else {
print 'error1';
}

if ($search2->success == true) {
print_r($search2->json());
} else {
print 'error2';
}

if ($search3->success == true) {
print ($search3->json());
} else {
print 'error3';
}

if ($search4->success == true) {
print_r($search4->json());
} else {
print 'error3';
}`
//error1error2{"success":true,"result":{"dni":"12345678","verificacion":,"paterno":"XXXXX","materno":"XXXX","nombre":"XXXX","sexo":null,"nacimiento":null,"gvotacion":null}}error3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.