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
d19e7118
Commit
d19e7118
authored
Nov 20, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t : region issue
parent
588b5092
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
27 deletions
+2
-27
Webservice_model.php
application/models/Webservice_model.php
+2
-27
No files found.
application/models/Webservice_model.php
View file @
d19e7118
...
@@ -786,7 +786,7 @@ class Webservice_model extends CI_Model {
...
@@ -786,7 +786,7 @@ class Webservice_model extends CI_Model {
TREG.region_name AS city_name
TREG.region_name AS city_name
FROM region AS REG
FROM region AS REG
INNER JOIN translator_region AS TREG ON (TREG.region_id = REG.id)
INNER JOIN translator_region AS TREG ON (TREG.region_id = REG.id)
WHERE REG.status=1 AND (TREG.language_code='
$lang
'
OR TREG.language_code='EN'
)
WHERE REG.status=1 AND (TREG.language_code='
$lang
')
GROUP BY city_id ORDER BY city_name"
;
GROUP BY city_id ORDER BY city_name"
;
$result
=
$this
->
db
->
query
(
$sql
)
->
result
();
$result
=
$this
->
db
->
query
(
$sql
)
->
result
();
if
(
count
(
$result
)
>
0
){
if
(
count
(
$result
)
>
0
){
...
@@ -1163,10 +1163,9 @@ class Webservice_model extends CI_Model {
...
@@ -1163,10 +1163,9 @@ class Webservice_model extends CI_Model {
$bookId
=
$post_data
[
'bookId'
];
$bookId
=
$post_data
[
'bookId'
];
$lang
=
$countryData
[
'language_code'
];
$lang
=
$countryData
[
'language_code'
];
$sql
=
"SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone,
$sql
=
"SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone,
CONCAT(EDATE.date,' ',EDATE.time) AS show_time
,PDR.fcm_token
CONCAT(EDATE.date,' ',EDATE.time) AS show_time
FROM booking AS BK
FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
INNER JOIN provider AS PDR ON (EVT.provider_id=PDR.provider_id)
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_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 customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
...
@@ -1210,12 +1209,6 @@ class Webservice_model extends CI_Model {
...
@@ -1210,12 +1209,6 @@ class Webservice_model extends CI_Model {
$this
->
sendSMS
(
$phone
,
$msg
);
$this
->
sendSMS
(
$phone
,
$msg
);
}
}
}
}
if
(
$post_data
[
'status'
]
==
6
){
$userData
=
array
(
'id'
=>
$post_data
[
'event_id'
],
'title'
=>
'New Booking'
,
'message'
=>
'New Booking is There For Approval'
);
$this
->
push_sent_cancel
(
$bkData
[
'fcm_token'
],
$userData
);
}
}
}
}
else
{
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Seat booking failed'
,
'code'
=>
'ER37'
);
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Seat booking failed'
,
'code'
=>
'ER37'
);
...
@@ -1233,24 +1226,6 @@ class Webservice_model extends CI_Model {
...
@@ -1233,24 +1226,6 @@ class Webservice_model extends CI_Model {
return
'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png'
;
return
'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png'
;
}
}
public
function
push_sent_cancel
(
$fcm_token
=
''
,
$fcm_data
=
array
())
{
$settings
=
getSettings
();
$key
=
$settings
[
'app_id'
];
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
.
"
\"
}"
;
$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
);
}
function
cancel
(
$data
)
{
function
cancel
(
$data
)
{
try
{
try
{
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
...
...
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