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
43c2b010
Commit
43c2b010
authored
5 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'dev_production'
Master See merge request
!253
parents
696d2711
61d5dc8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
Api_model.php
application/models/Api_model.php
+18
-7
Validation_model.php
application/models/Validation_model.php
+0
-6
No files found.
application/models/Api_model.php
View file @
43c2b010
...
...
@@ -381,12 +381,12 @@ class Api_model extends CI_Model {
$bookedData
=
$this
->
db
->
query
(
"
SELECT ODR.order_id,ODR.order_type,ODR.booking_id FROM orders AS ODR
LEFT JOIN booking AS BOK ON
(ODR.booking_id=BOK.bookId AND
BOK.status IN (0,1,2,3,5,6))
LEFT JOIN flight_booking AS FBK ON
(ODR.booking_id=FBK.flight_book_id AND
FBK.status IN (0,1,2,3,5))
LEFT JOIN hotel_booking AS HBK ON
(ODR.booking_id=HBK.hotel_book_id AND
HBK.status IN (0,1,2,3,5))
LEFT JOIN booking AS BOK ON
(ODR.booking_id=BOK.bookId AND
BOK.status IN (0,1,2,3,5,6))
LEFT JOIN flight_booking AS FBK ON
(ODR.booking_id=FBK.flight_book_id AND
FBK.status IN (0,1,2,3,5))
LEFT JOIN hotel_booking AS HBK ON
(ODR.booking_id=HBK.hotel_book_id AND
HBK.status IN (0,1,2,3,5))
WHERE ODR.customer_id='
$user_id
'
GROUP BY ODR.order_id ORDER BY ODR.order_id DESC
$cond
"
);
if
(
$per_page
==
0
&&
$page
==
0
){
...
...
@@ -445,6 +445,7 @@ class Api_model extends CI_Model {
WHERE booking.bookId='
$booking_id
'"
;
$eventData
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
$eventData
[
'order_type'
]
=
1
;
$evtLang
=
langTranslator
(
$eventData
[
'event_id'
],
'EVT'
);
array_merge
(
$eventData
,
$evtLang
);
...
...
@@ -471,6 +472,7 @@ class Api_model extends CI_Model {
$hotelData
[
'event_time'
]
=
'11:00'
;
$hotelData
[
'book_id'
]
=
$hotelData
[
'event_id'
];
$hotelData
[
'venue_id'
]
=
$hotelData
[
'event_id'
];
$hotelData
[
'order_type'
]
=
2
;
$hotelData
[
'has_payment'
]
=
1
;
unset
(
$hotelData
[
'traveller_details'
]);
return
$hotelData
;
...
...
@@ -496,6 +498,7 @@ class Api_model extends CI_Model {
unset
(
$flightData
[
'traveller_details'
],
$flightData
[
'event_date'
]);
$flightData
[
'event_date'
]
=
(
isset
(
$fghtTme
[
0
])
&&
!
empty
(
$fghtTme
[
0
]))
?
$fghtTme
[
0
]
:
''
;
$flightData
[
'event_time'
]
=
(
isset
(
$fghtTme
[
1
])
&&
!
empty
(
$fghtTme
[
1
]))
?
$fghtTme
[
1
]
:
''
;
$flightData
[
'order_type'
]
=
3
;
$flightData
[
'has_payment'
]
=
1
;
$flightData
[
'book_id'
]
=
$flightData
[
'event_id'
];
$flightData
[
'venue_id'
]
=
$flightData
[
'event_id'
];
...
...
@@ -683,6 +686,13 @@ class Api_model extends CI_Model {
$post_data
[
'amount'
]
=
0
;
}
$evtData
=
$this
->
db
->
get_where
(
'event_date_time'
,
array
(
'event_id'
=>
$post_data
[
'event_id'
],
'date'
=>
$post_data
[
'event_date'
],
'time'
=>
$post_data
[
'event_time'
]));
if
(
empty
(
$evtData
=
$evtData
->
row_array
())
||
!
isset
(
$evtData
[
'id'
])
||
empty
(
$post_data
[
'event_date_id'
]
=
$evtData
[
'id'
])){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Event date or time is invalid'
,
'code'
=>
'ER06'
);
}
$evtData
=
$this
->
db
->
get_where
(
'events'
,
array
(
'event_id'
=>
$post_data
[
'event_id'
]));
$evtData
=
$evtData
->
row_array
();
if
(
!
empty
(
$evtData
)
&&
isset
(
$evtData
[
'approve_booking'
])
&&
$evtData
[
'approve_booking'
]
==
'1'
){
...
...
@@ -702,7 +712,8 @@ class Api_model extends CI_Model {
$auth_token
=
$post_data
[
'auth_token'
];
$card_data
=
(
isset
(
$post_data
[
'cardData'
]))
?
$post_data
[
'cardData'
]
:
array
();
unset
(
$post_data
[
'auth_token'
],
$post_data
[
'has_payment'
],
$post_data
[
'cardData'
],
$post_data
[
'promocode_id'
],
$post_data
[
'redeem_amount'
]);
$post_data
[
'promocode_id'
],
$post_data
[
'redeem_amount'
],
$post_data
[
'event_date'
],
$post_data
[
'event_time'
]);
$rs
=
$this
->
db
->
insert
(
'booking'
,
$post_data
);
$this
->
db
->
insert
(
'orders'
,
array
(
'booking_id'
=>
$post_data
[
'bookId'
],
'order_type'
=>
'1'
,
'created_date'
=>
date
(
'Y-m-d h:i:s'
),
'customer_id'
=>
$user_id
));
...
...
This diff is collapsed.
Click to expand it.
application/models/Validation_model.php
View file @
43c2b010
...
...
@@ -220,12 +220,6 @@ class Validation_model extends CI_Model {
'message'
=>
'Event id is null or empty'
)
)
,
'event_date_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER33'
,
'message'
=>
'Event date and time is null or empty'
)
),
'no_of_ticket'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER36'
,
...
...
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