Commit 3526bec9 by Jansa Jose

cpf availability

parent b8a3dbd5
...@@ -3520,6 +3520,34 @@ class Webservice extends CI_Controller { ...@@ -3520,6 +3520,34 @@ class Webservice extends CI_Controller {
print json_encode($res); print json_encode($res);
} }
public function cpf_availability(){
header('Content-type: application/json');
$headers = apache_request_headers();
$cpf = $_GET['cpf'];
if(isset($cpf) && strlen(trim($cpf," ")) > 0 ){
$is_cpf = $this->Webservice_model->is_cpf_exist($cpf);
if($ress['status'] == 'success'){
$res = array(
"status"=> "success",
"data"=>array("is_available"=>true)
);
}else{
$res = array(
"status"=> "success",
"data"=>array("is_available"=>false)
);
}
}else{
$res = array(
"status"=> "error",
"error"=> "required",
"message"=> "CPF is required"
);
}
print json_encode($res);
}
public function cpf_valid($cpf){ public function cpf_valid($cpf){
$cpf = preg_replace('/[^0-9]/', '', (string) $cpf); $cpf = preg_replace('/[^0-9]/', '', (string) $cpf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment