Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Tobin
dcarfixers
Commits
637f6a6b
Commit
637f6a6b
authored
Jan 11, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
f88ec774
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
Webservices.php
application/controllers/Webservices.php
+68
-0
No files found.
application/controllers/Webservices.php
View file @
637f6a6b
...
...
@@ -237,6 +237,73 @@ class Webservices extends CI_Controller {
}
echo
json_encode
(
$respArr
);
exit
;
}
// edit_customer_profile
public
function
edit_customer_profile
(){
header
(
'Content-type: application/json'
);
$post
=
file_get_contents
(
"php://input"
);
$postData
=
json_decode
(
$post
,
true
);
$this
->
load
->
model
(
'Customer_model'
);
$respArr
=
array
(
'status'
=>
'0'
,
'message'
=>
'Something went wrong.'
);
if
(
empty
(
$postData
)){
echo
json_encode
(
$respArr
);
exit
;
}
$err
=
0
;
$msg
=
''
;
if
(
!
isset
(
$postData
[
'email'
])
||
empty
(
$postData
[
'email'
])){
$err
=
1
;
$msg
=
'Provide a valid Email ID'
;
}
else
if
(
!
isset
(
$postData
[
'first_name'
])
||
empty
(
$postData
[
'first_name'
])){
$err
=
1
;
$msg
=
'Provide valid Name'
;
}
else
if
(
!
isset
(
$postData
[
'last_name'
])
||
empty
(
$postData
[
'last_name'
])){
$err
=
1
;
$msg
=
'Provide valid Name'
;
}
else
if
(
!
isset
(
$postData
[
'phone'
])
||
empty
(
$postData
[
'phone'
])){
$err
=
1
;
$msg
=
'Provide valid Phone'
;
}
else
if
(
!
isset
(
$postData
[
'address'
])
||
empty
(
$postData
[
'address'
])){
$err
=
1
;
$msg
=
'Provide valid Address'
;
}
if
(
$err
==
1
){
$respArr
[
'message'
]
=
$msg
;
echo
json_encode
(
$respArr
);
exit
;
}
pr
(
$postData
);
unset
(
$postData
[
'cpassword'
]);
if
(
isset
(
$postData
[
'password'
])
&&
!
empty
(
$postData
[
'password'
])){
$postData
[
'password'
]
=
md5
(
$postData
[
'password'
]);
}
$custResp
=
$this
->
Customer_model
->
custProfileEdit
(
$postData
);
if
(
empty
(
$custResp
)
||
!
isset
(
$custResp
[
'status'
])
||
empty
(
$custResp
[
'status'
])){
echo
json_encode
(
$respArr
);
exit
;
}
if
(
$custResp
[
'status'
]
==
'1'
){
$respArr
[
'status'
]
=
'1'
;
$respArr
[
'message'
]
=
'Profile successfully updated'
;
echo
json_encode
(
$respArr
);
exit
;
}
else
if
(
$custResp
[
'status'
]
==
'2'
){
$respArr
[
'status'
]
=
'2'
;
$respArr
[
'message'
]
=
'Email Address already in use'
;
echo
json_encode
(
$respArr
);
exit
;
}
else
if
(
$custResp
[
'status'
]
==
'3'
){
$respArr
[
'status'
]
=
'3'
;
$respArr
[
'message'
]
=
'Phone Number already in use'
;
echo
json_encode
(
$respArr
);
exit
;
}
echo
json_encode
(
$respArr
);
exit
;
}
}
?>
\ No newline at end of file
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