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
10a8a4bd
Commit
10a8a4bd
authored
Sep 24, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jansa' into 'master'
Jansa See merge request
!96
parents
c5265aab
be763f0b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
138 deletions
+69
-138
database.php
application/config/database.php
+3
-3
Webservice.php
application/controllers/Webservice.php
+32
-46
Validation_app_model.php
application/models/Validation_app_model.php
+34
-89
Webservice_model.php
application/models/Webservice_model.php
+0
-0
No files found.
application/config/database.php
View file @
10a8a4bd
...
@@ -75,10 +75,10 @@ $query_builder = TRUE;
...
@@ -75,10 +75,10 @@ $query_builder = TRUE;
$db
[
'default'
]
=
array
(
$db
[
'default'
]
=
array
(
'dsn'
=>
''
,
'dsn'
=>
''
,
'hostname'
=>
'
localhost
'
,
'hostname'
=>
'
192.168.140.123
'
,
'username'
=>
'
nuvento_timeou
t'
,
'username'
=>
'
roo
t'
,
'password'
=>
'Golden_123'
,
'password'
=>
'Golden_123'
,
'database'
=>
'
nuvento_timeo
ut'
,
'database'
=>
'
tobin_eventTimeO
ut'
,
'dbdriver'
=>
'mysqli'
,
'dbdriver'
=>
'mysqli'
,
'dbprefix'
=>
''
,
'dbprefix'
=>
''
,
'pconnect'
=>
FALSE
,
'pconnect'
=>
FALSE
,
...
...
application/controllers/Webservice.php
View file @
10a8a4bd
...
@@ -63,7 +63,6 @@ class Webservice extends CI_Controller {
...
@@ -63,7 +63,6 @@ class Webservice extends CI_Controller {
}
}
}
}
public
function
check_email_availability
()
{
public
function
check_email_availability
()
{
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Webservice_model
->
availability
(
$data
);
$res
=
$this
->
Webservice_model
->
availability
(
$data
);
...
@@ -86,17 +85,17 @@ class Webservice extends CI_Controller {
...
@@ -86,17 +85,17 @@ class Webservice extends CI_Controller {
}
}
}
}
public
function
get_events_list
()
{
public
function
get_events_list
()
{
$data
=
$_GET
;
$data
=
$_GET
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
discover
(
$data
);
$res
=
$this
->
Webservice_model
->
discover
(
$data
);
if
(
$res
[
'status'
]
!=
0
&&
sizeof
(
$res
[
'data'
])){
if
(
$res
[
'status'
]
!=
0
&&
sizeof
(
$res
[
'data'
])){
$this
->
responseEventList
(
$res
[
'data'
]);
$this
->
responseEventList
(
$res
[
'data'
]);
}
elseif
(
$res
[
'status'
]
!=
0
&&
sizeof
(
$res
[
'data'
]
==
0
)){
}
elseif
(
$res
[
'status'
]
!=
0
&&
sizeof
(
$res
[
'data'
]
==
0
)){
$this
->
response
(
$res
[
'data'
]);
$this
->
response
(
$res
[
'data'
]);
}
else
{
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
public
function
events_details
(
$event_id
=
null
)
{
public
function
events_details
(
$event_id
=
null
)
{
...
@@ -134,8 +133,7 @@ class Webservice extends CI_Controller {
...
@@ -134,8 +133,7 @@ class Webservice extends CI_Controller {
print
json_encode
(
$result
);
print
json_encode
(
$result
);
}
}
public
function
successResponse
(
$data
)
{
public
function
successResponse
(
$data
)
{
$result
=
array
(
$result
=
array
(
'status'
=>
'success'
,
'status'
=>
'success'
,
);
);
...
@@ -151,8 +149,7 @@ class Webservice extends CI_Controller {
...
@@ -151,8 +149,7 @@ class Webservice extends CI_Controller {
print
json_encode
(
$result
);
print
json_encode
(
$result
);
}
}
public
function
get_category_list
(
$query
=
null
)
{
public
function
get_category_list
(
$query
=
null
)
{
$data
[
'query'
]
=
!
empty
(
$_GET
[
'query'
])
?
$_GET
[
'query'
]
:
''
;
$data
[
'query'
]
=
!
empty
(
$_GET
[
'query'
])
?
$_GET
[
'query'
]
:
''
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
get_category_list
(
$data
);
$res
=
$this
->
Webservice_model
->
get_category_list
(
$data
);
...
@@ -164,7 +161,7 @@ class Webservice extends CI_Controller {
...
@@ -164,7 +161,7 @@ class Webservice extends CI_Controller {
}
}
}
}
public
function
add_favorites
(){
public
function
add_favorites
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
add_favorites
(
$data
);
$res
=
$this
->
Webservice_model
->
add_favorites
(
$data
);
...
@@ -176,8 +173,7 @@ class Webservice extends CI_Controller {
...
@@ -176,8 +173,7 @@ class Webservice extends CI_Controller {
}
}
}
}
public
function
get_cities_list
()
{
public
function
get_cities_list
()
{
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
get_cities_list
(
$data
);
$res
=
$this
->
Webservice_model
->
get_cities_list
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
if
(
$res
[
'status'
]
!=
0
){
...
@@ -186,11 +182,9 @@ class Webservice extends CI_Controller {
...
@@ -186,11 +182,9 @@ class Webservice extends CI_Controller {
else
{
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
public
function
update_city
(){
public
function
update_city
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
update_city
(
$data
);
$res
=
$this
->
Webservice_model
->
update_city
(
$data
);
...
@@ -291,6 +285,7 @@ class Webservice extends CI_Controller {
...
@@ -291,6 +285,7 @@ class Webservice extends CI_Controller {
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
public
function
cancel_booking
()
{
public
function
cancel_booking
()
{
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
...
@@ -319,12 +314,12 @@ class Webservice extends CI_Controller {
...
@@ -319,12 +314,12 @@ class Webservice extends CI_Controller {
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
bookedlist
(
$data
);
$res
=
$this
->
Webservice_model
->
bookedlist
(
$data
);
if
(
sizeof
(
$res
[
'data'
])
&&
$res
[
'status'
]
!=
0
){
if
(
sizeof
(
$res
[
'data'
])
&&
$res
[
'status'
]
!=
0
){
$this
->
responseBookList
(
$res
[
'data'
]);
$this
->
responseBookList
(
$res
[
'data'
]);
}
elseif
(
sizeof
(
$res
[
'data'
]
==
0
)
&&
$res
[
'status'
]
!=
0
){
}
elseif
(
sizeof
(
$res
[
'data'
]
==
0
)
&&
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
$this
->
response
(
$res
[
'data'
]);
}
else
{
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
public
function
settings
()
{
public
function
settings
()
{
...
@@ -338,7 +333,7 @@ class Webservice extends CI_Controller {
...
@@ -338,7 +333,7 @@ class Webservice extends CI_Controller {
}
}
}
}
public
function
forgot_password
()
{
public
function
forgot_password
()
{
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Webservice_model
->
forgot_password
(
$data
);
$res
=
$this
->
Webservice_model
->
forgot_password
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
if
(
$res
[
'status'
]
!=
0
){
...
@@ -364,8 +359,7 @@ class Webservice extends CI_Controller {
...
@@ -364,8 +359,7 @@ class Webservice extends CI_Controller {
}
}
public
function
get_last_booking
()
{
public
function
get_last_booking
()
{
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
get_last_booking
(
$data
);
$res
=
$this
->
Webservice_model
->
get_last_booking
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
$this
->
response
(
$res
[
'data'
]);
...
@@ -376,12 +370,12 @@ class Webservice extends CI_Controller {
...
@@ -376,12 +370,12 @@ class Webservice extends CI_Controller {
}
}
public
function
responseBookList
(
$data
)
{
public
function
responseBookList
(
$data
)
{
$result
=
array
(
$result
=
array
(
'status'
=>
'success'
,
'status'
=>
'success'
,
'data'
=>
array
(
'data'
=>
array
(
'bookings'
=>
$data
[
'bookings'
]),
'bookings'
=>
$data
[
'bookings'
]),
'meta'
=>
$data
[
'meta'
]
'meta'
=>
$data
[
'meta'
]
);
);
print
json_encode
(
$result
);
print
json_encode
(
$result
);
}
}
...
@@ -410,7 +404,6 @@ class Webservice extends CI_Controller {
...
@@ -410,7 +404,6 @@ class Webservice extends CI_Controller {
public
function
get_app_version
(){
public
function
get_app_version
(){
$res
=
$this
->
Webservice_model
->
get_app_version
();
$res
=
$this
->
Webservice_model
->
get_app_version
();
if
(
$res
[
'status'
]
!=
0
)
if
(
$res
[
'status'
]
!=
0
)
$this
->
response
(
$res
[
'data'
]);
$this
->
response
(
$res
[
'data'
]);
else
else
...
@@ -421,7 +414,6 @@ class Webservice extends CI_Controller {
...
@@ -421,7 +414,6 @@ class Webservice extends CI_Controller {
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
logout
(
$data
);
$res
=
$this
->
Webservice_model
->
logout
(
$data
);
if
(
$res
[
'status'
]
!=
0
)
if
(
$res
[
'status'
]
!=
0
)
$this
->
successResponse
(
$res
);
$this
->
successResponse
(
$res
);
else
else
...
@@ -435,7 +427,6 @@ class Webservice extends CI_Controller {
...
@@ -435,7 +427,6 @@ class Webservice extends CI_Controller {
}
}
$data
=
$_GET
;
$data
=
$_GET
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
event_search
(
$data
);
$res
=
$this
->
Webservice_model
->
event_search
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
$this
->
response
(
$res
[
'data'
]);
...
@@ -452,7 +443,6 @@ class Webservice extends CI_Controller {
...
@@ -452,7 +443,6 @@ class Webservice extends CI_Controller {
empty
(
$settings
[
'currency_api'
])){
empty
(
$settings
[
'currency_api'
])){
return
;
return
;
}
}
$sourceCur
=
(
!
empty
(
$settings
[
'currency'
]))
?
$settings
[
'currency'
]
:
'SAR'
;
$sourceCur
=
(
!
empty
(
$settings
[
'currency'
]))
?
$settings
[
'currency'
]
:
'SAR'
;
$coma
=
''
;
$coma
=
''
;
$convertCur
=
''
;
$convertCur
=
''
;
...
@@ -460,20 +450,16 @@ class Webservice extends CI_Controller {
...
@@ -460,20 +450,16 @@ class Webservice extends CI_Controller {
$convertCur
.=
$coma
.
$curr
[
'currency'
];
$convertCur
.=
$coma
.
$curr
[
'currency'
];
$coma
=
','
;
$coma
=
','
;
}
}
$params
=
'currencies='
.
$convertCur
;
$params
=
'currencies='
.
$convertCur
;
$params
.=
'&source='
.
$sourceCur
;
$params
.=
'&source='
.
$sourceCur
;
$params
.=
'&access_key='
.
$settings
[
'currency_api'
];
$params
.=
'&access_key='
.
$settings
[
'currency_api'
];
$apiUrl
=
"http://apilayer.net/api/live?"
.
$params
;
$apiUrl
=
"http://apilayer.net/api/live?"
.
$params
;
$ch
=
curl_init
(
$apiUrl
);
$ch
=
curl_init
(
$apiUrl
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
$json
=
curl_exec
(
$ch
);
$json
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
curl_close
(
$ch
);
$exchangeRates
=
json_decode
(
$json
,
true
);
$exchangeRates
=
json_decode
(
$json
,
true
);
if
(
empty
(
$exchangeRates
)
||
!
isset
(
$exchangeRates
[
'quotes'
])
||
empty
(
$conversion
=
$exchangeRates
[
'quotes'
])){
if
(
empty
(
$exchangeRates
)
||
!
isset
(
$exchangeRates
[
'quotes'
])
||
empty
(
$conversion
=
$exchangeRates
[
'quotes'
])){
return
;
return
;
}
}
foreach
(
$conversion
AS
$curr
=>
$rate
)
{
foreach
(
$conversion
AS
$curr
=>
$rate
)
{
...
...
application/models/Validation_app_model.php
View file @
10a8a4bd
This diff is collapsed.
Click to expand it.
application/models/Webservice_model.php
View file @
10a8a4bd
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