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
1750c8ca
Commit
1750c8ca
authored
Oct 25, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
f00c9ece
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
207 additions
and
139 deletions
+207
-139
Api.php
application/controllers/Api.php
+49
-27
Booking.php
application/controllers/Booking.php
+17
-1
Event.php
application/controllers/Event.php
+15
-14
Webservice.php
application/controllers/Webservice.php
+2
-2
bookingStatusCrone.php
application/controllers/bookingStatusCrone.php
+10
-9
notificationRemainder.php
application/controllers/notificationRemainder.php
+44
-44
Api_model.php
application/models/Api_model.php
+31
-25
Booking_model.php
application/models/Booking_model.php
+12
-13
Event_model.php
application/models/Event_model.php
+1
-1
Validation_app_model.php
application/models/Validation_app_model.php
+1
-2
Webservice_model.php
application/models/Webservice_model.php
+0
-0
generate.php
application/views/Booking/generate.php
+2
-1
viewBookingDetails.php
application/views/Booking/viewBookingDetails.php
+23
-0
No files found.
application/controllers/Api.php
View file @
1750c8ca
...
@@ -338,7 +338,7 @@ class Api extends CI_Controller {
...
@@ -338,7 +338,7 @@ class Api extends CI_Controller {
}
}
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
(),
$cardData
=
''
){
$custData
=
array
(),
$cardData
=
array
()
){
$customerName
=
array
();
$customerName
=
array
();
if
(
isset
(
$custData
->
name
)
&&
!
empty
(
$custData
->
name
)){
if
(
isset
(
$custData
->
name
)
&&
!
empty
(
$custData
->
name
)){
$customerName
=
explode
(
' '
,
$custData
->
name
);
$customerName
=
explode
(
' '
,
$custData
->
name
);
...
@@ -352,25 +352,58 @@ class Api extends CI_Controller {
...
@@ -352,25 +352,58 @@ class Api extends CI_Controller {
$add1
=
$add2
=
$city
=
$state
=
'Saudi Arabia'
;
$add1
=
$add2
=
$city
=
$state
=
'Saudi Arabia'
;
$pincode
=
'61961'
;
$pincode
=
'61961'
;
$holder
=
'Basanta Mahunta'
;
$noCard
=
0
;
$cardType
=
'MasterCard'
;
$saveCard
=
1
;
$cardNo
=
'5111111111111118'
;
$savedCard
=
0
;
$cvv
=
'100'
;
if
(
!
empty
(
$cardData
)){
$expMonth
=
'06'
;
if
(
isset
(
$cardData
[
'cvv'
])
&&
!
empty
(
$cardData
[
'cvv'
])
&&
$expYear
=
'2022'
;
isset
(
$cardData
[
'tocken'
])
&&
!
empty
(
$cardData
[
'tocken'
])){
// if(!empty($cardData)){
$savedCard
=
1
;
// if(isset($cardData['tocken'])){
}
else
if
(
isset
(
$cardData
[
'cvv'
])
&&
!
empty
(
$cardData
[
'cvv'
])
||
isset
(
$cardData
[
'cardType'
])
&&
!
empty
(
$cardData
[
'cardType'
])
||
// } else {
isset
(
$cardData
[
'cardNumber'
])
&&
!
empty
(
$cardData
[
'cardNumber'
])
||
isset
(
$cardData
[
'expMonthYear'
])
&&
!
empty
(
$cardData
[
'expMonthYear'
])
||
// }
isset
(
$cardData
[
'cardHolderName'
])
&&
!
empty
(
$cardData
[
'cardHolderName'
])){
// }
$cvv
=
$cardData
[
'cvv'
];
$cardNo
=
$cardData
[
'cardNumber'
];
$holder
=
$cardData
[
'cardHolderName'
];
$cardType
=
$cardData
[
'cardType'
];
$expMonth
=
substr
(
$cardData
[
'expMonthYear'
],
0
,
2
);
$expYear
=
'20'
.
substr
(
$cardData
[
'expMonthYear'
],
2
,
2
);
$saveCard
=
(
isset
(
$cardData
[
'saveCard'
])
&&!
empty
(
$cardData
[
'saveCard'
])
&&
$cardData
[
'saveCard'
]
==
0
)
?
0
:
1
;
}
else
{
$noCard
=
1
;
}
}
else
{
$noCard
=
1
;
}
$failureUrl
=
base_url
(
'Api/paymentFailureUrl'
);
$failureUrl
=
base_url
(
'Api/paymentFailureUrl'
);
$successUrl
=
base_url
(
'Api/paymentSuccessUrl'
);
$successUrl
=
base_url
(
'Api/paymentSuccessUrl'
);
$pText
=
'1111110||11111111|'
.
$last_id
.
'|'
.
$amount
.
'|'
.
$successUrl
.
'|'
.
$failureUrl
.
'|INTERNET|DD|01|SAR||1111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$email
.
'|'
.
$phone
.
'|34|344|34355344||111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$phone
.
'|34|344|34355344||11111100000|'
.
$cardNo
.
'|'
.
$expMonth
.
'|'
.
$expYear
.
'|'
.
$cvv
.
'|'
.
$holder
.
'|'
.
$cardType
.
'||1110000|'
.
$last_id
.
'|'
.
$event_id
.
'|'
.
$booking_id
.
'||1000000|'
.
$userId
;
$pText
=
'1111110||'
;
$pText
.=
'11111111|'
.
$last_id
.
'|'
.
$amount
.
'|'
.
$successUrl
.
'|'
.
$failureUrl
.
'|INTERNET|DD|01|SAR||'
;
$pText
.=
'1111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$email
.
'|'
.
$phone
.
'|34|344|34355344||'
;
$pText
.=
'111111111111|'
.
$f_Name
.
'|'
.
$l_Name
.
'|'
.
$add1
.
'|'
.
$add2
.
'|'
.
$city
.
'|'
.
$state
.
'|'
.
$pincode
.
'|SA|'
.
$phone
.
'|34|344|34355344||'
;
if
(
$savedCard
==
1
){
$pText
.=
'00010000001|'
.
$cardData
[
'cvv'
]
.
'|'
.
$cardData
[
'tocken'
]
.
'||'
;
}
else
{
if
(
$noCard
==
0
){
$pText
.=
'11111100000|'
.
$cardNo
.
'|'
.
$expMonth
.
'|'
.
$expYear
.
'|'
.
$cvv
.
'|'
.
$holder
.
'|'
.
$cardType
.
'||'
;
}
else
{
// No Card Payment Method Logic.
// $holder = 'Basanta Mahunta'; $cardType = 'MasterCard'; $cardNo = '5111111111111118';
// $cvv = '100'; $expMonth = '06'; $expYear = '2022';
}
}
$pText
.=
'1110000|'
.
$last_id
.
'|'
.
$event_id
.
'|'
.
$booking_id
.
'||'
;
if
(
$saveCard
==
1
){
$pText
.=
'1000000|'
.
$userId
;
}
$settings
=
getSettings
();
$settings
=
getSettings
();
$iv
=
$settings
[
'merchant_iv'
];
$iv
=
$settings
[
'merchant_iv'
];
...
@@ -660,17 +693,6 @@ class Api extends CI_Controller {
...
@@ -660,17 +693,6 @@ class Api extends CI_Controller {
}
}
}
}
public
function
getCheckerEventList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
getCheckerBookList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
/*================ END : Checker API ================*/
/*================ END : Checker API ================*/
}
}
?>
?>
application/controllers/Booking.php
View file @
1750c8ca
...
@@ -190,6 +190,19 @@ class Booking extends CI_Controller {
...
@@ -190,6 +190,19 @@ class Booking extends CI_Controller {
}
}
}
}
if
(
isset
(
$data
[
'trans_status'
])){
switch
(
$data
[
'trans_status'
])
{
case
'0'
:
$reportData
[
$key
][
'trans_status'
]
=
'Failed '
;
break
;
case
'1'
:
$reportData
[
$key
][
'trans_status'
]
=
'Completed '
;
break
;
case
'2'
:
$reportData
[
$key
][
'trans_status'
]
=
'Processing '
;
break
;
case
'3'
:
$reportData
[
$key
][
'trans_status'
]
=
'Payment Timeout '
;
break
;
}
}
if
(
isset
(
$data
[
'has_payment'
])){
$reportData
[
$key
][
'has_payment'
]
=
(
$data
[
'has_payment'
]
==
1
)
?
'Yes '
:
'No '
;
}
if
(
!
empty
(
$data
[
'Ticket_Details'
])){
if
(
!
empty
(
$data
[
'Ticket_Details'
])){
$tktDtls
=
json_decode
(
$data
[
'Ticket_Details'
],
true
);
$tktDtls
=
json_decode
(
$data
[
'Ticket_Details'
],
true
);
if
(
isset
(
$tktDtls
[
'price'
],
$tktDtls
[
'no_ticket'
],
$tktDtls
[
'total_price'
])
&&
if
(
isset
(
$tktDtls
[
'price'
],
$tktDtls
[
'no_ticket'
],
$tktDtls
[
'total_price'
])
&&
...
@@ -200,8 +213,11 @@ class Booking extends CI_Controller {
...
@@ -200,8 +213,11 @@ class Booking extends CI_Controller {
$pDiv
.=
$tktDtls
[
'price'
]
.
' * '
.
$tktDtls
[
'no_ticket'
]
.
'(Seats) = '
.
$tktDtls
[
'total_price'
];
$pDiv
.=
$tktDtls
[
'price'
]
.
' * '
.
$tktDtls
[
'no_ticket'
]
.
'(Seats) = '
.
$tktDtls
[
'total_price'
];
$reportData
[
$key
][
'Ticket_Details'
]
=
$pDiv
;
$reportData
[
$key
][
'Ticket_Details'
]
=
$pDiv
;
}
else
{
$reportData
[
$key
][
'Ticket_Details'
]
=
''
;
}
}
}
else
{
$reportData
[
$key
][
'Ticket_Details'
]
=
''
;
}
}
}
}
return
$reportData
;
return
$reportData
;
...
...
application/controllers/Event.php
View file @
1750c8ca
...
@@ -109,10 +109,10 @@ class Event extends CI_Controller {
...
@@ -109,10 +109,10 @@ class Event extends CI_Controller {
'weekend_price'
=>
$_POST
[
'weekend_price'
][
$i
]);
'weekend_price'
=>
$_POST
[
'weekend_price'
][
$i
]);
}
}
$_POST
[
'custom_seat_layout'
]
=
json_encode
(
$cstmSeatLayout
);
$_POST
[
'custom_seat_layout'
]
=
json_encode
(
$cstmSeatLayout
);
}
else
{
}
else
if
(
isset
(
$_POST
[
'price'
])
&&
!
empty
(
$_POST
[
'price'
])
&&
isset
(
$_POST
[
'capacity'
])
&&
!
empty
(
$_POST
[
'capacity'
])){
$seatPriceArr
=
array
(
'price'
=>
$_POST
[
'price'
],
'capacity'
=>
$_POST
[
'capacity'
]);
$seatPriceArr
=
array
(
'price'
=>
$_POST
[
'price'
],
'capacity'
=>
$_POST
[
'capacity'
]);
foreach
(
$language
AS
$lang
)
{
foreach
(
$language
AS
$lang
)
{
$details
=
$_POST
[
'price_details_EN'
];
if
(
isset
(
$_POST
[
'price_details_'
.
$lang
])
&&
!
empty
(
$_POST
[
'price_details_'
.
$lang
])){
if
(
isset
(
$_POST
[
'price_details_'
.
$lang
])
&&
!
empty
(
$_POST
[
'price_details_'
.
$lang
])){
$details
=
$_POST
[
'price_details_'
.
$lang
];
$details
=
$_POST
[
'price_details_'
.
$lang
];
}
}
...
@@ -179,15 +179,17 @@ class Event extends CI_Controller {
...
@@ -179,15 +179,17 @@ class Event extends CI_Controller {
}
}
// START - NEW EVENT NOTIFICATION MAIL \\
// START - NEW EVENT NOTIFICATION MAIL \\
$settings
=
getSettings
();
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
$this
->
load
->
model
(
'Api_model'
);
$settings
=
getSettings
();
$this
->
load
->
model
(
'Api_model'
);
$subject
=
"TimeOut, New Event Created"
;
$emailId
=
$settings
[
'admin_mail_id'
];
$subject
=
"TimeOut, New Event Created"
;
$message
=
"<html><body>
$emailId
=
$settings
[
'admin_mail_id'
];
New Event Created, event name: <strong>"
.
$_POST
[
'event_name_en'
]
.
"</strong>. Event URL : "
.
base_url
()
.
"eventdetail?event_id=
$event_id
$message
=
"<html><body>
</body></html>"
;
New Event Created, event name: <strong>"
.
$_POST
[
'event_name_en'
]
.
"</strong>. Event URL : "
.
base_url
()
.
"eventdetail?event_id=
$event_id
$this
->
Api_model
->
send_mail
(
$subject
,
$emailId
,
$message
);
</body></html>"
;
$this
->
Api_model
->
send_mail
(
$subject
,
$emailId
,
$message
);
}
// END - NEW EVENT NOTIFICATION MAIL \\
// END - NEW EVENT NOTIFICATION MAIL \\
$flashMsg
[
'class'
]
=
'success'
;
$flashMsg
[
'class'
]
=
'success'
;
...
@@ -275,7 +277,6 @@ class Event extends CI_Controller {
...
@@ -275,7 +277,6 @@ class Event extends CI_Controller {
}
}
$_POST
[
'has_payment'
]
=
(
isset
(
$_POST
[
'has_payment'
])
&&
$_POST
[
'has_payment'
]
==
1
)
?
'1'
:
'0'
;
$_POST
[
'has_payment'
]
=
(
isset
(
$_POST
[
'has_payment'
])
&&
$_POST
[
'has_payment'
]
==
1
)
?
'1'
:
'0'
;
$_POST
[
'seat_pricing'
]
=
$_POST
[
'custom_seat_layout'
]
=
''
;
$_POST
[
'seat_pricing'
]
=
$_POST
[
'custom_seat_layout'
]
=
''
;
if
(
isset
(
$_POST
[
'fare_type'
])
&&
$_POST
[
'fare_type'
]
==
1
){
if
(
isset
(
$_POST
[
'fare_type'
])
&&
$_POST
[
'fare_type'
]
==
1
){
$cstmSeatLayout
=
array
();
$cstmSeatLayout
=
array
();
...
@@ -289,10 +290,10 @@ class Event extends CI_Controller {
...
@@ -289,10 +290,10 @@ class Event extends CI_Controller {
'weekend_price'
=>
$_POST
[
'weekend_price'
][
$i
]);
'weekend_price'
=>
$_POST
[
'weekend_price'
][
$i
]);
}
}
$_POST
[
'custom_seat_layout'
]
=
json_encode
(
$cstmSeatLayout
);
$_POST
[
'custom_seat_layout'
]
=
json_encode
(
$cstmSeatLayout
);
}
else
{
}
else
if
(
isset
(
$_POST
[
'price'
])
&&
!
empty
(
$_POST
[
'price'
])
&&
isset
(
$_POST
[
'capacity'
])
&&
!
empty
(
$_POST
[
'capacity'
])){
$seatPriceArr
=
array
(
'price'
=>
$_POST
[
'price'
],
'capacity'
=>
$_POST
[
'capacity'
]);
$seatPriceArr
=
array
(
'price'
=>
$_POST
[
'price'
],
'capacity'
=>
$_POST
[
'capacity'
]);
foreach
(
$language
AS
$lang
)
{
foreach
(
$language
AS
$lang
)
{
$details
=
$_POST
[
'price_details_EN'
];
if
(
isset
(
$_POST
[
'price_details_'
.
$lang
])
&&
!
empty
(
$_POST
[
'price_details_'
.
$lang
])){
if
(
isset
(
$_POST
[
'price_details_'
.
$lang
])
&&
!
empty
(
$_POST
[
'price_details_'
.
$lang
])){
$details
=
$_POST
[
'price_details_'
.
$lang
];
$details
=
$_POST
[
'price_details_'
.
$lang
];
}
}
...
...
application/controllers/Webservice.php
View file @
1750c8ca
...
@@ -29,8 +29,8 @@ class Webservice extends CI_Controller {
...
@@ -29,8 +29,8 @@ class Webservice extends CI_Controller {
if
(
$method
==
'profile'
)
{
if
(
$method
==
'profile'
)
{
$data
=
$_POST
;
$data
=
$_POST
;
}
}
if
(
isset
(
apache_request_headers
()[
'Auth'
]))
{
if
(
isset
(
apache_request_headers
()[
'Auth'
])
||
isset
(
apache_request_headers
()[
'auth'
])
)
{
$this
->
auth_token
=
apache_request_headers
()[
'A
uth'
];
$this
->
auth_token
=
(
isset
(
apache_request_headers
()[
'Auth'
]))
?
apache_request_headers
()[
'Auth'
]
:
apache_request_headers
()[
'a
uth'
];
$data
[
'auth_token'
]
=
$this
->
auth_token
;
$data
[
'auth_token'
]
=
$this
->
auth_token
;
}
}
$res
=
$this
->
Validation_app_model
->
validation_check
(
$method
,
$data
);
$res
=
$this
->
Validation_app_model
->
validation_check
(
$method
,
$data
);
...
...
application/controllers/bookingStatusCrone.php
View file @
1750c8ca
<?php
<?php
date_default_timezone_set
(
"Asia/Riyadh"
);
$conn
=
mysqli_connect
(
"localhost"
,
"nuvento_timeout"
,
"Golden_123"
,
"nuvento_timeout"
);
$conn
=
mysqli_connect
(
"localhost"
,
"nuvento_timeout"
,
"Golden_123"
,
"nuvento_timeout"
);
if
(
$conn
->
connect_error
){
if
(
$conn
->
connect_error
){
return
;
return
;
}
}
$todate
=
date
(
'Y-m-d'
);
$todate
=
date
(
'Y-m-d'
);
$sql
=
"UPDATE booking
$date_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'- 15 minutes'
));
$sql
=
"UPDATE booking
INNER JOIN event_date_time ON event_date_time.id = booking.event_date_id
INNER JOIN event_date_time ON event_date_time.id = booking.event_date_id
SET booking.status = '2'
SET booking.status = '2'
WHERE event_date_time.date < '
$todate
' and event_date_time.time <
now()
and booking.status='1'"
;
WHERE event_date_time.date < '
$todate
' and event_date_time.time <
'now()'
and booking.status='1'"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
$result
=
mysqli_query
(
$conn
,
$sql
);
$date_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'- 15 minutes'
));
$sql
=
"UPDATE booking
$sql
=
"UPDATE booking
INNER JOIN transaction ON transaction.booking_id = booking.bookId
INNER JOIN transaction ON transaction.booking_id = booking.bookId
SET booking.status = '5',transaction.status='3'
SET booking.status = '5',transaction.status='3'
WHERE transaction.datetime > '
$date_time
'"
;
WHERE transaction.datetime<'
$date_time
'"
;
mysqli_query
(
$conn
,
$sql
);
$conn
->
close
();
$conn
->
close
();
?>
?>
application/controllers/notificationRemainder.php
View file @
1750c8ca
<?php
<?php
date_default_timezone_set
(
"Asia/Riyadh"
);
$conn
=
mysqli_connect
(
"localhost"
,
"nuvento_timeout"
,
"Golden_123"
,
"nuvento_timeout"
);
if
(
$conn
->
connect_error
){
return
;
}
$result
=
mysqli_query
(
$conn
,
"SELECT app_id FROM setting"
);
$conn
=
mysqli_connect
(
"localhost"
,
"nuvento_timeout"
,
"Golden_123"
,
"nuvento_timeout"
);
if
(
mysqli_num_rows
(
$result
)
<=
0
||
empty
(
$row
=
mysqli_fetch_assoc
(
$result
))
||
if
(
$conn
->
connect_error
){
!
isset
(
$row
[
'app_id'
])
||
empty
(
$key
=
$row
[
'app_id'
])){
return
;
return
;
}
$result
=
mysqli_query
(
$conn
,
"SELECT app_id FROM setting"
);
if
(
mysqli_num_rows
(
$result
)
<=
0
||
empty
(
$row
=
mysqli_fetch_assoc
(
$result
))
||
!
isset
(
$row
[
'app_id'
])
||
empty
(
$key
=
$row
[
'app_id'
])){
return
;
}
$date
=
date
(
'Y-m-d'
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +30 minutes"
));
$sTime
=
date
(
'H:i'
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +30 minutes"
));
$eTime
=
date
(
"H:i"
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +31 minutes"
));
$sql
=
"SELECT CUST.customer_id,CUST.fcm_token,BOK.id AS booking_id,BOK.bookId,EVT.event_name_en
FROM booking AS BOK
INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id)
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=BOK.event_id)
WHERE EVT.status='1' AND BOK.status='1' AND USR.status='1' AND EDATE.status='1' AND
EDATE.date='
$date
' AND EDATE.time<='
$eTime
' AND EDATE.time>='
$sTime
'
GROUP BY BOK.id,CUST.customer_id"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
if
(
mysqli_num_rows
(
$result
)
>
0
)
{
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
$data
=
"{
\"
notification
\"
: {
\"
title
\"
:
\"
"
.
$row
[
'event_name_en'
]
.
"
\"
,
\"
text
\"
:
\"
Booking Reminder
\"
,
\"
sound
\"
:
\"
default
\"
},
\"
time_to_live
\"
: 60,
\"
data
\"
: {\"
response
\
" : {\"
status
\
" :
\"
success
\"
,
\"
data
\"
: {\"
booking_id
\
" :
\"
"
.
$row
[
'bookId'
]
.
"
\"
,
\"
trip_status
\"
: 0}}},
\"
collapse_key
\"
:
\"
trip
\"
,
\"
priority
\"
:
\"
high
\"
,
\"
to
\"
:
\"
"
.
$row
[
'fcm_token'
]
.
"
\"
}"
;
$ch
=
curl_init
(
"https://fcm.googleapis.com/fcm/send"
);
$header
=
array
(
'Content-Type: application/json'
,
'Authorization: key='
.
$key
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$header
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$data
);
$out
=
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_exec
(
$ch
);
curl_close
(
$ch
);
}
}
mysqli_query
(
$conn
,
"INSERT INTO crontab_notif VALUES ('',"
.
date
(
'Y-m-d'
)
.
","
.
date
(
'H:i:s'
)
.
")"
);
}
$conn
->
close
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +30 minutes"
));
$sTime
=
date
(
'H:i'
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +30 minutes"
));
$eTime
=
date
(
"H:i"
,
strtotime
(
date
(
"Y-m-d H:i:s"
)
.
" +31 minutes"
));
$sql
=
"SELECT CUST.customer_id,CUST.fcm_token,BOK.id AS booking_id,BOK.bookId,EVT.event_name
FROM booking AS BOK
INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id)
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=BOK.event_id)
WHERE EVT.status='1' AND BOK.status='1' AND USR.status='1' AND EDATE.status='1' AND
EDATE.date='
$date
' AND EDATE.time<='
$eTime
' AND EDATE.time>='
$sTime
'
GROUP BY BOK.id,CUST.customer_id"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
if
(
mysqli_num_rows
(
$result
)
>
0
)
{
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
$data
=
"{
\"
notification
\"
: {
\"
title
\"
:
\"
"
.
$row
[
'event_name'
]
.
"
\"
,
\"
text
\"
:
\"
Booking Reminder
\"
,
\"
sound
\"
:
\"
default
\"
},
\"
time_to_live
\"
: 60,
\"
data
\"
: {\"
response
\
" : {\"
status
\
" :
\"
success
\"
,
\"
data
\"
: {\"
booking_id
\
" :
\"
"
.
$row
[
'bookId'
]
.
"
\"
,
\"
trip_status
\"
: 0}}},
\"
collapse_key
\"
:
\"
trip
\"
,
\"
priority
\"
:
\"
high
\"
,
\"
to
\"
:
\"
"
.
$row
[
'fcm_token'
]
.
"
\"
}"
;
$ch
=
curl_init
(
"https://fcm.googleapis.com/fcm/send"
);
$header
=
array
(
'Content-Type: application/json'
,
'Authorization: key='
.
$key
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$header
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$data
);
$out
=
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_exec
(
$ch
);
curl_close
(
$ch
);
}
mysqli_query
(
$conn
,
"INSERT INTO crontab_notif VALUES ('',"
.
date
(
'Y-m-d'
)
.
","
.
date
(
'H:i:s'
)
.
")"
);
}
$conn
->
close
();
?>
?>
application/models/Api_model.php
View file @
1750c8ca
This diff is collapsed.
Click to expand it.
application/models/Booking_model.php
View file @
1750c8ca
...
@@ -12,11 +12,11 @@ class Booking_model extends CI_Model {
...
@@ -12,11 +12,11 @@ class Booking_model extends CI_Model {
$sql
=
"SELECT BOK.id AS booking_id,CUST.customer_id,CUST.name AS customer_name,EVT.provider_id,
$sql
=
"SELECT BOK.id AS booking_id,CUST.customer_id,CUST.name AS customer_name,EVT.provider_id,
CUST.phone AS customer_phone,CUST.email AS customer_email,CUST.gender,EVT.venue_id,
CUST.phone AS customer_phone,CUST.email AS customer_email,CUST.gender,EVT.venue_id,
CUST.dob,CUST.city,CUST.profile_image,BOK.event_id,BOK.bookId,BOK.event_date_id,
CUST.dob,CUST.
profile_
city,CUST.profile_image,BOK.event_id,BOK.bookId,BOK.event_date_id,
BOK.qrcode,BOK.no_of_ticket,BOK.ticket_details,BOK.amount,EVT.has_payment,
BOK.qrcode,BOK.no_of_ticket,BOK.ticket_details,BOK.amount,EVT.has_payment,
BOK.reserved_by,BOK.status AS book_status,EVT.category_id,EVT.max_booking,
BOK.reserved_by,BOK.status AS book_status,EVT.category_id,EVT.max_booking,
EVT.seat_pricing,EVT.custom_seat_layout,EVT.status AS evt_status,EDT.time,
EVT.seat_pricing,EVT.custom_seat_layout,EVT.status AS evt_status,EDT.time,
HCAT.host_category,HCAT.show_layout,EDT.date,PRV.name AS provider_name,
HCAT.host_category,HCAT.show_layout,EDT.date,PRV.name AS provider_name,
BOK.booking_date,
PRV.email AS provider_email,PRV.phone AS provider_phone,VEN.location,
PRV.email AS provider_email,PRV.phone AS provider_phone,VEN.location,
PRV.profile_image AS provider_image,TRANS.transaction_id,TRANS.status AS trans_status
PRV.profile_image AS provider_image,TRANS.transaction_id,TRANS.status AS trans_status
FROM booking AS BOK
FROM booking AS BOK
...
@@ -107,18 +107,17 @@ class Booking_model extends CI_Model {
...
@@ -107,18 +107,17 @@ class Booking_model extends CI_Model {
$fields
=
str_replace
(
array
(
'EVT.event_name,'
,
'EVT.event_description,'
,
'ECAT.category,'
,
'VEN.venue_name,'
,
'REG.name_en AS Region,'
),
''
,
$fields
);
$fields
=
str_replace
(
array
(
'EVT.event_name,'
,
'EVT.event_description,'
,
'ECAT.category,'
,
'VEN.venue_name,'
,
'REG.name_en AS Region,'
),
''
,
$fields
);
$sql
=
"SELECT EVT.event_id,EVT.category_id,VEN.id AS venue_id,REG.id AS region_id,"
.
$fields
.
"
$sql
=
"SELECT EVT.event_id,EVT.category_id,VEN.id AS venue_id,REG.id AS region_id,"
.
$fields
.
"
FROM booking AS BOK
FROM booking AS BOK
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id)
INNER JOIN event_category AS ECAT ON (ECAT.cat_id=EVT.category_id)
INNER JOIN event_category AS ECAT ON (ECAT.cat_id=EVT.category_id)
INNER JOIN venue AS VEN ON (VEN.id=EVT.venue_id)
INNER JOIN venue AS VEN ON (VEN.id=EVT.venue_id)
INNER JOIN host_categories AS HCAT ON (HCAT.host_cat_id=VEN.host_cat_id)
INNER JOIN host_categories AS HCAT ON (HCAT.host_cat_id=VEN.host_cat_id)
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
INNER
JOIN region AS REG ON (REG.id=VEN.region_id)
LEFT
JOIN region AS REG ON (REG.id=VEN.region_id)
LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
"
.
$where_clause
.
"
"
.
$where_clause
.
"
GROUP BY Booking_ID
ORDER BY BOK.id ASC"
;
ORDER BY BOK.id ASC"
;
$reportData
=
$this
->
db
->
query
(
$sql
);
$reportData
=
$this
->
db
->
query
(
$sql
);
...
...
application/models/Event_model.php
View file @
1750c8ca
...
@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
...
@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
if
(
empty
(
$event_id
)
||
empty
(
$eventData
)){
if
(
empty
(
$event_id
)
||
empty
(
$eventData
)){
return
0
;
return
0
;
}
}
$this
->
db
->
delete
(
'event_date_time'
,
array
(
'event_id'
=>
$event_id
));
$this
->
db
->
update
(
'event_date_time'
,
array
(
'status'
=>
'0'
)
,
array
(
'event_id'
=>
$event_id
));
$status
=
$this
->
db
->
insert_batch
(
'event_date_time'
,
$eventData
);
$status
=
$this
->
db
->
insert_batch
(
'event_date_time'
,
$eventData
);
return
$status
;
return
$status
;
}
}
...
...
application/models/Validation_app_model.php
View file @
1750c8ca
...
@@ -47,8 +47,7 @@ class Validation_app_model extends CI_Model {
...
@@ -47,8 +47,7 @@ class Validation_app_model extends CI_Model {
'customer_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER29'
,
'message'
=>
'Customer id is null or empty'
)),
'customer_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER29'
,
'message'
=>
'Customer id is null or empty'
)),
'event_date_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER30'
,
'message'
=>
'Event date id is null or empty'
)),
'event_date_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER30'
,
'message'
=>
'Event date id is null or empty'
)),
'no_of_ticket'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER31'
,
'message'
=>
'Number of ticket is null or empty'
)),
'no_of_ticket'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER31'
,
'message'
=>
'Number of ticket is null or empty'
)),
'ticket_details'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER32'
,
'message'
=>
'Ticket details is null or empty'
)),
'ticket_details'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER32'
,
'message'
=>
'Ticket details is null or empty'
))),
'amount'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER33'
,
'message'
=>
'Amount is null or empty'
)),),
'cancel_booking'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'User Id is null or empty'
)),
'cancel_booking'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'User Id is null or empty'
)),
'booking_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER34'
,
'message'
=>
'Booking Id is null or empty'
)),),
'booking_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER34'
,
'message'
=>
'Booking Id is null or empty'
)),),
'update_fcm_token'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'User Id is null or empty'
)),
'update_fcm_token'
=>
array
(
'auth_token'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'User Id is null or empty'
)),
...
...
application/models/Webservice_model.php
View file @
1750c8ca
This diff is collapsed.
Click to expand it.
application/views/Booking/generate.php
View file @
1750c8ca
...
@@ -126,6 +126,7 @@
...
@@ -126,6 +126,7 @@
'BOK.ticket_details AS Ticket_Details'
=>
'Ticked Details'
,
'BOK.ticket_details AS Ticket_Details'
=>
'Ticked Details'
,
'BOK.amount AS Amount'
=>
'Booking Amount'
,
'BOK.amount AS Amount'
=>
'Booking Amount'
,
'BOK.reserved_by AS Reserved_By'
=>
'Reserved By'
,
'BOK.reserved_by AS Reserved_By'
=>
'Reserved By'
,
'BOK.booking_date AS Booking_Time'
=>
'Booking Time'
,
'BOK.status AS Book_Status'
=>
'Booking Status'
'BOK.status AS Book_Status'
=>
'Booking Status'
)
)
),
),
...
@@ -141,7 +142,7 @@
...
@@ -141,7 +142,7 @@
array
(
'CUST.name AS Customer_Name'
=>
'Customer Name'
,
array
(
'CUST.name AS Customer_Name'
=>
'Customer Name'
,
'CUST.phone AS Customer_Phone'
=>
'Customer Phone'
,
'CUST.phone AS Customer_Phone'
=>
'Customer Phone'
,
'CUST.email AS Customer_Email'
=>
'Customer Email'
,
'CUST.email AS Customer_Email'
=>
'Customer Email'
,
'CUST.city AS Customer_City'
=>
'Customer City'
'CUST.
profile_
city AS Customer_City'
=>
'Customer City'
)
)
),
),
array
(
'name'
=>
'Provider Details'
,
array
(
'name'
=>
'Provider Details'
,
...
...
application/views/Booking/viewBookingDetails.php
View file @
1750c8ca
...
@@ -124,6 +124,18 @@
...
@@ -124,6 +124,18 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
>
<div
class=
"col-md-2"
>
Booking Time
</div>
<div
class=
"col-md-1"
style=
"padding-left: 52px;"
>
:
</div>
<div
class=
"col-md-9"
>
<?=
$bookData
->
booking_date
?>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-2"
>
Event Name
Event Name
</div>
</div>
<div
class=
"col-md-1"
style=
"padding-left: 52px;"
>
<div
class=
"col-md-1"
style=
"padding-left: 52px;"
>
...
@@ -206,6 +218,17 @@
...
@@ -206,6 +218,17 @@
</div>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<div
class=
"row"
>
<div
class=
"col-md-5"
>
Customer City
</div>
<div
class=
"col-md-1"
>
:
</div>
<div
class=
"col-md-5"
>
<?=
$bookData
->
profile_city
?>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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