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
79eac6df
Commit
79eac6df
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jansa'
parents
29738495
6134e3a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
10 deletions
+58
-10
Webservice.php
admin/application/controllers/Webservice.php
+42
-8
Webservice_model.php
admin/application/models/Webservice_model.php
+16
-2
No files found.
admin/application/controllers/Webservice.php
View file @
79eac6df
...
...
@@ -42,8 +42,10 @@ class Webservice extends CI_Controller {
$ress
=
$this
->
cpf_valid
(
$data
[
'cpf'
]);
if
((
isset
(
$ress
))
&&
(
$ress
==
1
)){
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$data
[
'cpf'
]);
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$data
[
'cpf'
],
0
);
if
(
$is_cpf
[
'status'
]
==
'success'
){
$res
=
$this
->
registration_processing_user
(
$data
,
$type
);
}
else
{
$res
=
array
(
...
...
@@ -117,6 +119,7 @@ class Webservice extends CI_Controller {
if
(
$result
[
'status'
]
==
'success'
){
$this
->
Webservice_model
->
insert_cpf
(
$data
[
'cpf'
],
$result
[
'userdata'
][
'id'
],
0
);
$fileName
=
$result
[
'userdata'
][
'id'
]
.
'_'
.
$_FILES
[
'profile_photo'
][
'name'
];
$config
=
set_upload_options
(
'../assets/uploads/profilepic/patient/'
);
$config
[
'file_name'
]
=
$fileName
;
...
...
@@ -2068,14 +2071,14 @@ class Webservice extends CI_Controller {
// $data['dob'] = strtotime($dob);
$ress
=
$this
->
cpf_valid
(
$data
[
'dependent_cpf'
]);
if
(
$ress
==
'1'
){
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$data
[
'dependent_cpf'
]);
/*
$is_cpf = $this->Webservice_model->is_cpf_exist($data['dependent_cpf']);
if($is_cpf['status'] == 'error'){
$res = array(
"status"=> "error",
"error"=> "CPF Exist",
"message"=> "CPF Already Exist"
);
}
else
{
}else{
*/
$auth_result
=
$this
->
Webservice_model
->
get_userid_frm_authtoken
(
$headers
[
'Auth'
]);
$fileName
=
$auth_result
->
userid
.
'_'
.
$_FILES
[
'dependent_image'
][
'name'
];
$fileName
=
str_replace
(
'%'
,
'a'
,
$fileName
);
...
...
@@ -2116,7 +2119,7 @@ class Webservice extends CI_Controller {
'data'
=>
array
(
'dependent_list'
=>
$new_data
)
);
}
}
//
}
}
else
{
$res
=
array
(
"status"
=>
"error"
,
...
...
@@ -2196,14 +2199,14 @@ class Webservice extends CI_Controller {
if
((
isset
(
$data
[
'dependent_name'
]))
&&
strlen
(
trim
(
$data
[
'dependent_name'
],
" "
))
>
0
&&
isset
(
$data
[
'dependent_relation'
])
&&
strlen
(
trim
(
$data
[
'dependent_relation'
],
" "
))
>
0
&&
isset
(
$data
[
'dependent_dob'
])
&&
strlen
(
trim
(
$data
[
'dependent_dob'
],
" "
))
>
0
&&
(
isset
(
$_FILES
[
'dependent_image'
])
&&
isset
(
$data
[
'dependent_id'
])
&&
strlen
(
trim
(
$data
[
'dependent_id'
],
" "
))
>
0
)
&&
isset
(
$data
[
'dependent_cpf'
])
&&
strlen
(
trim
(
$data
[
'dependent_cpf'
],
" "
))
>
0
){
$ress
=
$this
->
cpf_valid
(
$data
[
'dependent_cpf'
]);
if
(
$ress
==
'1'
){
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$data
[
'dependent_cpf'
]);
/*
$is_cpf = $this->Webservice_model->is_cpf_exist($data['dependent_cpf']);
if($is_cpf['status'] == 'error'){
$res = array(
"status"=> "error",
"error"=> "CPF Exist",
"message"=> "CPF Already Exist"
);
}
else
{
}else{
*/
$auth_result
=
$this
->
Webservice_model
->
get_userid_frm_authtoken
(
$headers
[
'Auth'
]);
$fileName
=
$auth_result
->
userid
.
'_'
.
$_FILES
[
'dependent_image'
][
'name'
];
$config
=
set_upload_options
(
'../assets/uploads/profilepic/patient_dependent/'
);
...
...
@@ -2244,7 +2247,7 @@ class Webservice extends CI_Controller {
'data'
=>
array
(
'dependent_list'
=>
$new_data
)
);
}
}
//
}
}
else
{
$res
=
array
(
"status"
=>
"error"
,
...
...
@@ -3400,6 +3403,8 @@ class Webservice extends CI_Controller {
$data
[
'specialization'
]
=
$data
[
'specialization_id'
];
$data
[
'gender'
]
=
strtoupper
(
$data
[
'gender'
]);
$ch
=
curl_init
();
$area
=
$data
[
'zip_code'
];
$url
=
"https://maps.googleapis.com/maps/api/geocode/json?address=${area}&key=AIzaSyDMcP8sMKFPmLROvIf3g1U86_Vg5ur41nQ"
;
...
...
@@ -3419,6 +3424,7 @@ class Webservice extends CI_Controller {
$result
=
$this
->
Webservice_model
->
registration
(
$data
,
$type
);
if
(
$result
[
'status'
]
==
'success'
){
$this
->
Webservice_model
->
insert_cpf
(
$data
[
'cpf'
],
$result
[
'userdata'
][
'id'
],
1
);
$fileName
=
$result
[
'userdata'
][
'id'
]
.
'_'
.
$_FILES
[
'profile_photo'
][
'name'
];
$config
=
set_upload_options
(
'../assets/uploads/profilepic/doctors/'
);
$config
[
'file_name'
]
=
$fileName
;
...
...
@@ -3526,7 +3532,35 @@ class Webservice extends CI_Controller {
$cpf
=
$_GET
[
'cpf'
];
if
(
isset
(
$cpf
)
&&
strlen
(
trim
(
$cpf
,
" "
))
>
0
){
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$cpf
);
$is_cpf
=
$this
->
Webservice_model
->
is_cpf_exist
(
$cpf
,
0
);
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_availability_doctor
(){
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
,
1
);
if
(
$ress
[
'status'
]
==
'success'
){
$res
=
array
(
"status"
=>
"success"
,
...
...
This diff is collapsed.
Click to expand it.
admin/application/models/Webservice_model.php
View file @
79eac6df
...
...
@@ -1454,8 +1454,14 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
//............................ get clinic specialisation
function
is_cpf_exist
(
$cpf
){
$res
=
$this
->
db
->
get_where
(
'tbl_cpf_number'
,
array
(
'cpf'
=>
$cpf
))
->
row
();
function
is_cpf_exist
(
$cpf
,
$type
=
''
){
if
(
$type
==
0
){
$res
=
$this
->
db
->
get_where
(
'tbl_cpf_number'
,
array
(
'cpf'
=>
$cpf
,
'user_type'
=>
0
))
->
row
();
}
else
if
(
$type
==
1
){
$res
=
$this
->
db
->
get_where
(
'tbl_cpf_number'
,
array
(
'cpf'
=>
$cpf
,
'user_type'
=>
1
))
->
row
();
}
else
{
$res
=
$this
->
db
->
get_where
(
'tbl_cpf_number'
,
array
(
'cpf'
=>
$cpf
))
->
row
();
}
if
(
$res
){
$query
=
array
(
'status'
=>
'error'
);
}
else
{
...
...
@@ -1464,6 +1470,14 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
return
$query
;
}
function
insert_cpf
(
$cpf
,
$id
,
$type
){
if
(
$this
->
db
->
insert
(
'tbl_cpf_number'
,
array
(
'cpf'
=>
$cpf
,
'user_type'
=>
$type
,
'user_id'
=>
$id
))){
return
true
;
}
else
{
return
false
;
}
}
function
get_clinic_specialisation
(){
$this
->
db
->
select
(
"DISTINCT(tbl_specialization.specialization_name),tbl_clinic_specialization.clinic_id,tbl_specialization.id"
);
$this
->
db
->
join
(
'tbl_specialization'
,
'tbl_specialization.id = tbl_clinic_specialization.specialization_id'
);
...
...
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