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

	
	$cookie = array(
		'cookie' 		=> array(
			'use' 		=> true,
			'file' 		=> __DIR__ . "/cookie.txt"
		)
	);
	$config = array(
		'representantes_legales' 	=> true,
		'cantidad_trabajadores' 	=> true,
		'establecimientos' 			=> true,
		'cookie' 					=> $cookie
	);
	$sunat = new \Sunat\ruc( $config );
	
	$dni = $_POST['dni'];

	$search2 = $sunat->consulta( $dni );
	
	
	if( $search2->success == true )
	{
		echo "Persona: " . $search1->result->razon_social;
	}
	

	echo $search2->json( NULL, true );
?>
