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
8dd815b2
Commit
8dd815b2
authored
Dec 19, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
J : flight booking in web
parent
39eee5d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
33 deletions
+29
-33
Api.php
application/controllers/Api.php
+2
-1
Api_model.php
application/models/Api_model.php
+8
-8
FlightServices_model.php
application/models/FlightServices_model.php
+19
-24
No files found.
application/controllers/Api.php
View file @
8dd815b2
...
@@ -330,7 +330,8 @@ class Api extends CI_Controller {
...
@@ -330,7 +330,8 @@ class Api extends CI_Controller {
case
'WALLET'
:
case
'WALLET'
:
return
$this
->
Api_model
->
updateWalletTxn
(
$txnData
);
return
$this
->
Api_model
->
updateWalletTxn
(
$txnData
);
case
'HOTEL_BOOK'
:
case
'HOTEL_BOOK'
:
if
(
isset
(
$txnData
[
'bookData'
])
&&
!
empty
(
$txnData
[
'bookData'
])){
if
((
isset
(
$txnData
[
'tnx_id'
])
&&
!
empty
(
$txnData
[
'tnx_id'
]))
||
(
isset
(
$txnData
[
'bookData'
])
&&
!
empty
(
$txnData
[
'bookData'
]))){
return
$this
->
Api_model
->
hotelBooking
(
$txnData
);
return
$this
->
Api_model
->
hotelBooking
(
$txnData
);
}
}
}
}
...
...
application/models/Api_model.php
View file @
8dd815b2
...
@@ -1834,14 +1834,14 @@ class Api_model extends CI_Model {
...
@@ -1834,14 +1834,14 @@ class Api_model extends CI_Model {
"user_password"
=>
$settings
[
'trawex_user_password'
],
"user_password"
=>
$settings
[
'trawex_user_password'
],
"access"
=>
$settings
[
'trawex_access'
],
"access"
=>
$settings
[
'trawex_access'
],
"ip_address"
=>
$settings
[
'trawex_ip_address'
],
"ip_address"
=>
$settings
[
'trawex_ip_address'
],
"TraceId"
=>
$data
[
'TraceId'
],
"propertyid"
=>
$data
[
'propertyid'
]
,
"TraceId"
=>
$data
->
TraceId
,
"propertyid"
=>
$data
->
propertyid
,
"trackingId"
=>
$data
[
'trackingId'
],
"sessionId"
=>
$data
[
'sessionId'
]
,
"trackingId"
=>
$data
->
trackingId
,
"sessionId"
=>
$data
->
sessionId
,
"productId"
=>
$data
[
'productId'
],
"TokenId"
=>
$data
[
'TokenId'
]
,
"productId"
=>
$data
->
productId
,
"TokenId"
=>
$data
->
TokenId
,
"resultindex"
=>
$data
[
'resultindex'
],
"hotelcode"
=>
$data
[
'hotelcode'
]
,
"resultindex"
=>
$data
->
resultindex
,
"hotelcode"
=>
$data
->
hotelcode
,
"changedOccupancy"
=>
$data
[
'changedOccupancy'
]
,
"changedOccupancy"
=>
$data
->
changedOccupancy
,
"extrabeds"
=>
$data
[
'extrabeds'
]
,
"extrabeds"
=>
$data
->
extrabeds
,
"guests_details"
=>
$data
[
'guests_details'
],
"refcode"
=>
$data
[
'refcode'
]
,
"guests_details"
=>
$data
->
guests_details
,
"refcode"
=>
$data
->
refcode
,
"prebookingtoken"
=>
$data
[
'prebookingtoken'
]
"prebookingtoken"
=>
$data
->
prebookingtoken
);
);
$result
=
passToJsonCurl
(
$url
,
$postData
);
$result
=
passToJsonCurl
(
$url
,
$postData
);
if
(
!
empty
(
$result
)){
if
(
!
empty
(
$result
)){
...
...
application/models/FlightServices_model.php
View file @
8dd815b2
...
@@ -195,31 +195,26 @@ class FlightServices_model extends CI_Model {
...
@@ -195,31 +195,26 @@ class FlightServices_model extends CI_Model {
public
function
airportSearch
(
$data
){
public
function
airportSearch
(
$data
){
try
{
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
$cond
=
''
;
if
(
$user_id
>
0
){
if
(
isset
(
$data
[
'query'
])
&&
!
empty
(
$data
[
'query'
])){
$cond
=
''
;
$cond
=
"WHERE airport_code LIKE '%"
.
$data
[
'query'
]
.
"%' OR airport_name LIKE '%"
.
$data
[
'query'
]
.
"%'"
;
if
(
isset
(
$data
[
'query'
])
&&
!
empty
(
$data
[
'query'
])){
}
$cond
=
"WHERE airport_code LIKE '%"
.
$data
[
'query'
]
.
"%' OR airport_name LIKE '%"
.
$data
[
'query'
]
.
"%'"
;
$sql
=
"SELECT id FROM airport_details
$cond
"
;
}
$count
=
$this
->
db
->
query
(
$sql
)
->
num_rows
();
$sql
=
"SELECT id FROM airport_details
$cond
"
;
if
(
$count
>
0
){
$count
=
$this
->
db
->
query
(
$sql
)
->
num_rows
();
$perPage
=
10
;
if
(
$count
>
0
){
$page
=
(
isset
(
$data
[
'page'
]))
?
$data
[
'page'
]
:
1
;
$perPage
=
10
;
$limit
=
(
$page
-
1
)
*
$perPage
;
$page
=
(
isset
(
$data
[
'page'
]))
?
$data
[
'page'
]
:
1
;
$meta
=
array
(
'total_pages'
=>
ceil
(
$count
/
$perPage
),
'total'
=>
$count
,
$limit
=
(
$page
-
1
)
*
$perPage
;
'current_page'
=>
$page
,
'per_page'
=>
$perPage
);
$meta
=
array
(
'total_pages'
=>
ceil
(
$count
/
$perPage
),
'total'
=>
$count
,
$sql
=
"SELECT * FROM airport_details
$cond
LIMIT
$limit
,
$perPage
"
;
'current_page'
=>
$page
,
'per_page'
=>
$perPage
);
$airPortList
=
$this
->
db
->
query
(
$sql
);
$sql
=
"SELECT * FROM airport_details
$cond
LIMIT
$limit
,
$perPage
"
;
if
(
!
isset
(
$airPortList
)
||
empty
(
$airPortList
=
$airPortList
->
result_array
())){
$airPortList
=
$this
->
db
->
query
(
$sql
);
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No data Found'
,
'code'
=>
'ER04'
);
if
(
!
isset
(
$airPortList
)
||
empty
(
$airPortList
=
$airPortList
->
result_array
())){
return
$res
;
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No data Found'
,
'code'
=>
'ER04'
);
return
$res
;
}
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'airportlist'
=>
$airPortList
,
'meta'
=>
$meta
));
}
}
}
else
{
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'airportlist'
=>
$airPortList
,
'meta'
=>
$meta
));
$res
=
array
(
'status'
=>
0
,
'message'
=>
'User Authentication Error'
,
'code'
=>
'ER06'
);
}
}
}
catch
(
Exception
$e
){
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER10'
);
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER10'
);
}
}
...
...
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