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
8ebc5c67
Commit
8ebc5c67
authored
6 years ago
by
Tobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'dev_production'
Master See merge request
!35
parents
4fc71c83
0a6e2ead
master
…
dev_production
jansa
live_production
uat_staging
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
notificationRemainder.php
application/controllers/notificationRemainder.php
+49
-0
left-menu.php
application/views/Templates/left-menu.php
+1
-1
No files found.
application/controllers/notificationRemainder.php
0 → 100644
View file @
8ebc5c67
<?php
$conn
=
mysqli_connect
(
"localhost"
,
"nuvento_timeout"
,
"Golden_123"
,
"nuvento_timeout"
);
if
(
$conn
->
connect_error
){
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
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 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 Remainder
\"
,
\"
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
();
?>
This diff is collapsed.
Click to expand it.
application/views/Templates/left-menu.php
View file @
8ebc5c67
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
<li>
<li>
<a
href=
"
<?=
base_url
(
'Notification/notification'
)
?>
"
>
<a
href=
"
<?=
base_url
(
'Notification/notification'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
<i
class=
"fa fa-circle-o text-aqua"
></i>
Notification Temp
al
tes
Notification Temp
la
tes
</a>
</a>
</li>
</li>
</ul>
</ul>
...
...
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