Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IPok_Web
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IPok
IPok_Web
Commits
29738495
Commit
29738495
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jansa'
parents
bb316e76
3526bec9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Webservice.php
admin/application/controllers/Webservice.php
+28
-0
No files found.
admin/application/controllers/Webservice.php
View file @
29738495
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment