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
b8d4112f
Commit
b8d4112f
authored
5 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
J: flight trawex api and organiser,event buking list changes
parent
ba8c6548
master
…
dev_production
jansa
1 merge request
!200
Master
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
2 deletions
+142
-2
Webservice.php
application/controllers/Webservice.php
+22
-0
Organizer_model.php
application/models/Organizer_model.php
+0
-0
Validation_app_model.php
application/models/Validation_app_model.php
+76
-0
Webservice_model.php
application/models/Webservice_model.php
+44
-2
No files found.
application/controllers/Webservice.php
View file @
b8d4112f
...
...
@@ -684,6 +684,28 @@ class Webservice extends CI_Controller {
}
}
public
function
flight_availability_search
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
flight_availability_search
(
$data
);
if
(
$res
[
'status'
]
==
1
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
flight_fare_rules
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
Webservice_model
->
flight_fare_rules
(
$data
);
if
(
$res
[
'status'
]
==
1
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
application/models/Organizer_model.php
View file @
b8d4112f
This diff is collapsed.
Click to expand it.
application/models/Validation_app_model.php
View file @
b8d4112f
...
...
@@ -792,6 +792,82 @@ class Validation_app_model extends CI_Model {
)
),
),
'flight_authenticate'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'User Id is null or empty'
)
)
),
'flight_availability_search'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'User Id is null or empty'
)
),
'journey_type'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Journey Type is null or empty'
)
),
'airport_from_code'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Airport From Code is null or empty'
)
),
'airport_to_code'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'airport To Code is null or empty'
)
),
'departure_date'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Departure Date is null or empty'
)
),
'return_date'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Return Date is null or empty'
)
),
'adult_flight'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Adult Flight is null or empty'
)
),
'child_flight'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Child Flight is null or empty'
)
),
'infant_flight'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Infant Flight is null or empty'
)
),
'class'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Class Field is null or empty'
)
),
'target'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'Target Field is null or empty'
)
),
),
);
public
function
validation_check
(
$method_name
,
$parms
)
{
...
...
This diff is collapsed.
Click to expand it.
application/models/Webservice_model.php
View file @
b8d4112f
...
...
@@ -2088,7 +2088,7 @@ class Webservice_model extends CI_Model {
}
$sql
=
"SELECT HC.hotel_city_id FROM hotel_cities AS HC
INNER JOIN translator_hotel_city AS THC ON(THC.hotel_city_id=HC.hotel_city_id)
WHERE HC.status=1
$cond
"
;
WHERE HC.status=1
$cond
GROUP BY HC.hotel_city_id
"
;
$count
=
$this
->
db
->
query
(
$sql
)
->
num_rows
();
if
(
$count
>=
1
){
$perPage
=
10
;
...
...
@@ -2329,13 +2329,55 @@ class Webservice_model extends CI_Model {
public
function
flight_authenticate
(
$data
){
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
){
$settings
=
getSettings
();
$url
=
"https://trawex.biz/api/flight_trawex/authenticate?user_id="
.
$settings
[
'trawex_user_id'
]
.
"&user_password="
.
$settings
[
'trawex_user_password'
]
.
"&access="
.
$settings
[
'trawex_access'
]
.
"&ip_address="
.
$settings
[
'trawex_ip_address'
]
.
""
;
$result
=
$this
->
passToJsonCurl
(
$url
,
''
);
if
(
!
empty
(
$result
)){
$result
=
json_decode
(
$result
);
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No Data Found'
,
'code'
=>
'ER06'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'User Authentication Error'
,
'code'
=>
'ER10'
);
}
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South!!'
,
'code'
=>
'ER08'
);
}
return
$res
;
}
public
function
flight_availability_search
(
$data
){
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
){
$settings
=
getSettings
();
$url
=
"https://trawex.biz/api/flight_trawex/flight_availability_search?user_id="
.
$settings
[
'trawex_user_id'
]
.
"&user_password="
.
$settings
[
'trawex_user_password'
]
.
"&access="
.
$settings
[
'trawex_access'
]
.
"&ip_address="
.
$settings
[
'trawex_ip_address'
]
.
"&session_id="
.
$data
[
'session_id'
]
.
"&journey_type="
.
$data
[
'journey_type'
]
.
"&airport_from_code="
.
$data
[
'airport_from_code'
]
.
"&airport_to_code="
.
$data
[
'airport_to_code'
]
.
"&departure_date="
.
$data
[
'departure_date'
]
.
"&return_date="
.
$data
[
'return_date'
]
.
"&adult_flight="
.
$data
[
'adult_flight'
]
.
"&child_flight="
.
$data
[
'child_flight'
]
.
"&infant_flight="
.
$data
[
'infant_flight'
]
.
"&class="
.
$data
[
'class'
]
.
"&target="
.
$data
[
'target'
]
.
""
;
$result
=
$this
->
passToJsonCurl
(
$url
,
''
);
if
(
!
empty
(
$result
)){
$result
=
json_decode
(
$result
);
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No Data Found'
,
'code'
=>
'ER06'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'User Authentication Error'
,
'code'
=>
'ER08'
);
}
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER08'
);
}
return
$res
;
}
public
function
flight_fare_rules
(
$data
){
try
{
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something Went South'
,
'code'
=>
'ER08'
);
}
}
public
function
passToJsonCurl
(
$url
=
''
,
$postData
=
array
()){
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
...
...
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