Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
TimeOut
TimeOutAdmin
Commits
7c42cc24
Commit
7c42cc24
authored
Nov 07, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
b4187439
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
8 deletions
+47
-8
Api.php
application/controllers/Api.php
+5
-6
Webservice.php
application/controllers/Webservice.php
+12
-0
Api_model.php
application/models/Api_model.php
+2
-1
Validation_app_model.php
application/models/Validation_app_model.php
+9
-1
Webservice_model.php
application/models/Webservice_model.php
+19
-0
No files found.
application/controllers/Api.php
View file @
7c42cc24
...
...
@@ -49,12 +49,11 @@ class Api extends CI_Controller {
$res
=
$this
->
Validation_model
->
validation_check
(
'login'
,
array
(
'email_id'
=>
'adarsh'
));
}
public
function
response
(
$data
)
{
$result
=
array
(
'code'
=>
1
,
'message'
=>
'Success'
,
'responseResult'
=>
$data
);
public
function
response
(
$data
=
''
)
{
$result
=
array
(
'code'
=>
1
,
'message'
=>
'Success'
);
if
(
!
empty
(
$data
)){
$result
[
'responseResult'
]
=
$data
;
}
print
json_encode
(
$result
);
exit
;
}
...
...
application/controllers/Webservice.php
View file @
7c42cc24
...
...
@@ -580,5 +580,17 @@ class Webservice extends CI_Controller {
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
update_user_visibility
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Api_model
->
update_user_visibility
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
();
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
?>
application/models/Api_model.php
View file @
7c42cc24
...
...
@@ -1819,4 +1819,5 @@ class Api_model extends CI_Model {
}
return
$res
;
}
}
?>
}
?>
application/models/Validation_app_model.php
View file @
7c42cc24
...
...
@@ -169,7 +169,15 @@ class Validation_app_model extends CI_Model {
)
)
),
'create_guest_user'
=>
array
()
'create_guest_user'
=>
array
(),
'update_user_visibility'
=>
array
(
'visible'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Required field is null or empty'
)
)
)
);
public
function
validation_check
(
$method_name
,
$parms
)
{
...
...
application/models/Webservice_model.php
View file @
7c42cc24
...
...
@@ -2058,5 +2058,24 @@ class Webservice_model extends CI_Model {
return
array
(
'status'
=>
'success'
,
'data'
=>
array
(
'auth_token'
=>
$auth_token
));
}
public
function
update_user_visibility
(
$data
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
)
{
$status
=
$this
->
db
->
update
(
'customer'
,
array
(
'enable_chat'
=>
$data
[
'visible'
]),
array
(
'customer_id'
=>
$user_id
));
$res
=
array
(
'status'
=>
1
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid user'
,
'code'
=>
'ER19'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
}
?>
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