Exemplo n.º 1
0
<?php

define('APPID_CEDULA', 'APP-ID-AQUI');
define('TOKEN_CEDULA', 'TOKEN-AQUI');
function getCurlData($url)
{
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_TIMEOUT, 10);
    $curlData = curl_exec($curl);
    curl_close($curl);
    return $curlData;
}
function getCI($cedula, $return_raw = false)
{
    $res = getCurlData("https://cuado.co:444/api/v1?app_id=" . APPID_CEDULA . "&token=" . TOKEN_CEDULA . "&cedula=" . (int) $cedula);
    if ($return_raw) {
        return strlen($res) > 3 ? $res : false;
    }
    $res = json_decode($res, true);
    return isset($res['data']) && $res['data'] ? $res['data'] : $res['error_str'];
}
$consulta = getCI(00);
if (is_array($consulta)) {
    print_r($consulta);
} else {
    echo "Ocurrio un error en la consulta: " . $consulta;
}
Exemplo n.º 2
0
                 break;
         }
     }
 }
 if (!checkRecaptchar(RECAPTCHAR_SECRET, $_POST['g-recaptcha-response'])) {
     $error = '- reCAPTCHA Inválido<br />';
 }
 if (!$error) {
     $_SESSION['valid_register'] = $_POST['country'];
     if ($_POST['country'] == 'VE') {
         if (!$isRif || $_POST['vat'][0] == 'V' || $_POST['vat'][0] == 'E') {
             $cedula = $_POST['vat'];
             if ($isRif) {
                 $cedula = substr($cedula, 1, strlen($cedula) - 2) * 1;
             }
             $consulta_api = getCI($cedula);
             if ($consulta_api) {
                 $_POST['name'] = $consulta_api['primer_nombre'] . " " . $consulta_api['primer_apellido'] . (isset($consulta_api['segundo_apellido']) ? " " . $consulta_api['segundo_apellido'] : "");
                 if (isset($consulta_api['cne'])) {
                     $_POST['address'] = $consulta_api['cne']['estado'] . ", " . $consulta_ap['cne']['municipio'] . ", " . $consulta_api['cne']['parroquia'];
                 }
             }
         }
         if (!isset($_POST['name']) && $isRif) {
             $consulta_seniat = getRifSeniat($_POST['vat'], true);
             if ($consulta_seniat && $consulta_seniat['ok'] && $consulta_seniat['result']['name']) {
                 $_POST['name'] = preg_replace('/[^0-9a-zA-ZñÑáéíóúÁÉÍÓÚ., ]+/', '', $consulta_seniat['result']['name']);
             }
         }
     }
 } else {
Exemplo n.º 3
0
function aprovar($data)
{
    $CI = getCI();
    $CI->load->model('candidato_vaga_model');
    $CI->candidato_vaga_model->status($data['candidato_vaga_id'], $data['proximo_passo_id']);
    return;
}
Exemplo n.º 4
0
<?php

/**
* Api de Consultas de Cedulas Venezolanas - Modulo de 'Pruébalo Gratis'
*
* @author    Kijam Lopez <*****@*****.**>
* @copyright 2015 Desarrollos Cuado C.A.
* @license   GPLv3
*/
include_once "./lib/classDBAndUser.php";
if ($_POST['vat']) {
    if (!checkRecaptchar(RECAPTCHAR_SECRET, $_POST['g-recaptcha-response'])) {
        $error = 'reCAPTCHA Inválido';
    } else {
        $consulta = getCI($_POST['vat'], true);
        if (!$consulta) {
            $error = 'Ocurrio un error en el servidor';
        }
    }
}
function prettyPrint($json)
{
    $result = '';
    $level = 0;
    $in_quotes = false;
    $in_escape = false;
    $ends_line_level = NULL;
    $json_length = strlen($json);
    for ($i = 0; $i < $json_length; $i++) {
        $char = $json[$i];
        $new_line_level = NULL;