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
60d292a8
Commit
60d292a8
authored
Dec 05, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
J : flight details api
parent
ffc692e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
FlightServices.php
application/controllers/FlightServices.php
+11
-0
FlightServices_model.php
application/models/FlightServices_model.php
+20
-0
Validation_flight_model.php
application/models/Validation_flight_model.php
+15
-1
No files found.
application/controllers/FlightServices.php
View file @
60d292a8
...
...
@@ -159,5 +159,16 @@ class FlightServices extends CI_Controller {
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
flight_details
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$res
=
$this
->
FlightServices_model
->
flight_details
(
$data
);
if
(
$res
[
'status'
]
==
1
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
?>
application/models/FlightServices_model.php
View file @
60d292a8
...
...
@@ -226,6 +226,26 @@ class FlightServices_model extends CI_Model {
return
$res
;
}
public
function
flight_details
(
$data
){
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
){
$sql
=
"SELECT * FROM flight_details WHERE flight_code='"
.
$data
[
'flight_code'
]
.
"'"
;
$query
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$query
)
||
empty
(
$flightDetails
=
$query
->
row_array
())){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No Data Found'
,
'code'
=>
'ER06'
);
return
$res
;
}
$res
=
array
(
'status'
=>
1
,
'data'
=>
$flightDetails
);
}
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'
=>
'ER10'
);
}
return
$res
;
}
public
function
passToJsonCurl
(
$url
=
''
,
$postData
=
array
()){
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
...
...
application/models/Validation_flight_model.php
View file @
60d292a8
...
...
@@ -415,7 +415,21 @@ class Validation_flight_model extends CI_Model {
'message'
=>
'User Id is null or empty'
)
)
)
),
'flight_details'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER02'
,
'message'
=>
'User Id is null or empty'
)
),
'flight_code'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER20'
,
'message'
=>
'Flight Code is null or empty'
)
),
),
);
public
function
validation_check
(
$method_name
,
$parms
)
{
...
...
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