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
5900be34
Commit
5900be34
authored
Nov 20, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
J : push notification in update payment
parent
cb18672b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Api_model.php
application/models/Api_model.php
+10
-3
Webservice_model.php
application/models/Webservice_model.php
+2
-2
No files found.
application/models/Api_model.php
View file @
5900be34
...
...
@@ -701,7 +701,7 @@ class Api_model extends CI_Model {
}
$this
->
sendSMS
(
$bkData
[
'phone'
],
$msgContent
);
if
(
$post_data
[
'status'
]
==
6
){
$userData
=
array
(
'id'
=>
$post_data
[
'
event_i
d'
],
$userData
=
array
(
'id'
=>
$post_data
[
'
bookI
d'
],
'title'
=>
'New Booking'
,
'message'
=>
'New Booking is There For Approval'
);
$this
->
push_sent_cancel
(
$bkData
[
'fcm_token'
],
$userData
);
...
...
@@ -1399,14 +1399,15 @@ class Api_model extends CI_Model {
$book_id
=
$trBook
[
'booking_id'
];
$sql
=
"SELECT TEVT.event_name,CONCAT(EDATE.date,' ',EDATE.time) AS show_time,
CUST.name,CUST.email,CUST.phone,EVT.approve_booking
CUST.name,CUST.email,CUST.phone,EVT.approve_booking
,PDR.fcm_token
FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
INNER JOIN provider AS PDR ON (PDR.provider_id=EVT.provider_id)
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
WHERE BK.bookId='"
.
$trBook
[
'booking_id'
]
.
"' AND EVT.status='1' AND
BK.status
='3'
AND EDATE.status='1' AND TEVT.language_code='EN'"
;
BK.status
IN('3','6')
AND EDATE.status='1' AND TEVT.language_code='EN'"
;
$bkData
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
$bokStatus
=
'1'
;
...
...
@@ -1434,6 +1435,12 @@ class Api_model extends CI_Model {
$template
[
'booking_sms'
]);
}
$this
->
sendSMS
(
$bkData
[
'phone'
],
$msgContent
);
if
(
$bokStatus
==
'6'
){
$userData
=
array
(
'id'
=>
$book_id
,
'title'
=>
'New Booking'
,
'message'
=>
'New Booking is There For Approval'
);
$this
->
push_sent_cancel
(
$bkData
[
'fcm_token'
],
$userData
);
}
}
$this
->
db
->
update
(
'booking'
,
array
(
'status'
=>
$bokStatus
),
array
(
'bookId'
=>
$book_id
));
$this
->
db
->
update
(
'event_invites'
,
array
(
'status'
=>
'1'
),
array
(
'book_id'
=>
$book_id
));
...
...
application/models/Webservice_model.php
View file @
5900be34
...
...
@@ -1211,7 +1211,7 @@ class Webservice_model extends CI_Model {
}
}
if
(
$post_data
[
'status'
]
==
6
){
$userData
=
array
(
'id'
=>
$post_data
[
'
event_i
d'
],
$userData
=
array
(
'id'
=>
$post_data
[
'
bookI
d'
],
'title'
=>
'New Booking'
,
'message'
=>
'New Booking is There For Approval'
);
$this
->
push_sent_cancel
(
$bkData
[
'fcm_token'
],
$userData
);
...
...
@@ -1239,7 +1239,7 @@ class Webservice_model extends CI_Model {
if
(
empty
(
$key
)
||
empty
(
$fcm_token
)
||
empty
(
$fcm_data
)){
return
;
}
$data
=
"{
\"
notification
\"
: {
\"
title
\"
:
\"
"
.
$fcm_data
[
'title'
]
.
"
\"
,
\"
text
\"
:
\"
"
.
$fcm_data
[
'message'
]
.
"
\"
,
\"
sound
\"
:
\"
default
\"
},
\"
time_to_live
\"
: 60,
\"
data
\"
: {\"
response
\
" : {\"
status
\
" :
\"
success
\"
,
\"
data
\"
: {\"
event
_id
\
" :
\"
"
.
$fcm_data
[
'id'
]
.
"
\"
,
\"
user_type
\"
: 2}}},
\"
collapse_key
\"
:
\"
trip
\"
,
\"
priority
\"
:
\"
high
\"
,
\"
to
\"
:
\"
"
.
$fcm_token
.
"
\"
}"
;
$data
=
"{
\"
notification
\"
: {
\"
title
\"
:
\"
"
.
$fcm_data
[
'title'
]
.
"
\"
,
\"
text
\"
:
\"
"
.
$fcm_data
[
'message'
]
.
"
\"
,
\"
sound
\"
:
\"
default
\"
},
\"
time_to_live
\"
: 60,
\"
data
\"
: {\"
response
\
" : {\"
status
\
" :
\"
success
\"
,
\"
data
\"
: {\"
booking
_id
\
" :
\"
"
.
$fcm_data
[
'id'
]
.
"
\"
,
\"
user_type
\"
: 2}}},
\"
collapse_key
\"
:
\"
trip
\"
,
\"
priority
\"
:
\"
high
\"
,
\"
to
\"
:
\"
"
.
$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
);
...
...
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