Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
konaspi2024
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
konaspi2024
Commits
2c8d8459
Commit
2c8d8459
authored
Mar 19, 2024
by
Muhammad Iskandar Java
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add check registrasi
parent
e5736e04
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
3 deletions
+57
-3
app/Http/Controllers/RegistrasiController.php
+54
-1
resources/views/email/selesai_pembayaran.blade.php
+2
-2
routes/web.php
+1
-0
No files found.
app/Http/Controllers/RegistrasiController.php
View file @
2c8d8459
...
@@ -190,6 +190,8 @@ public function store(Request $request) {
...
@@ -190,6 +190,8 @@ public function store(Request $request) {
'tagihan'
=>
$totalHarga
'tagihan'
=>
$totalHarga
];
];
$registrasi
->
save
();
$generatedVa
=
$this
->
generateVa
(
$multipartData
);
$generatedVa
=
$this
->
generateVa
(
$multipartData
);
$arrResponse
=
json_decode
(
$generatedVa
,
true
);
$arrResponse
=
json_decode
(
$generatedVa
,
true
);
$registrasi
->
status_va
=
$arrResponse
[
'BTNresponse'
];
$registrasi
->
status_va
=
$arrResponse
[
'BTNresponse'
];
...
@@ -197,6 +199,7 @@ public function store(Request $request) {
...
@@ -197,6 +199,7 @@ public function store(Request $request) {
$registrasi
->
save
();
$registrasi
->
save
();
if
(
$arrResponse
[
'BTNresponse'
]
!=
'Request has been processed successfully'
){
if
(
$arrResponse
[
'BTNresponse'
]
!=
'Request has been processed successfully'
){
DB
::
rollBack
();
DB
::
rollBack
();
Log
::
error
(
'---'
);
Log
::
error
(
'---'
);
...
@@ -261,6 +264,46 @@ public function addFormKegiatan(Request $request)
...
@@ -261,6 +264,46 @@ public function addFormKegiatan(Request $request)
return
view
(
'form_kegiatan'
,
$data
);
return
view
(
'form_kegiatan'
,
$data
);
}
}
public
function
getDataRegis
(
$va
)
{
$registrasi
=
Registrasi
::
query
()
->
with
(
'pkKegiatan'
,
'pkRegistrasiPeserta.rKegiatanPeserta'
,
'pkRegistrasiPeserta.rKonferensiPeserta'
)
->
where
(
'kode_registrasi'
,
$va
)
->
first
();
$konvensi
=
Kegiatan
::
query
()
->
find
(
'498633a9-082c-4a4a-9dbd-e20b678ec15e'
);
$konv
=
$konvensi
->
toArray
();
$totalHarga
=
$totalHarga
=
(
int
)
$konvensi
->
harga
;
foreach
(
$registrasi
->
pkRegistrasiPeserta
as
$item
){
if
(
is_null
(
$item
->
rKonferensiPeserta
)){
continue
;
}
$konferensi
=
$item
->
rKonferensiPeserta
;
$kegkonaspi
=
$item
->
rKegiatanPeserta
;
$totalHarga
+=
(
int
)
$konferensi
->
harga
;
$kegPeserta
[]
=
[
'idkon'
=>
$konferensi
->
id
,
'namakon'
=>
$konferensi
->
nama
,
'hargakon'
=>
$konferensi
->
harga
,
'namakeg'
=>
$kegkonaspi
->
nama
];
}
$data
=
[
'registrasi'
=>
$registrasi
,
'tglRegistrasi'
=>
$registrasi
->
created_at
,
'konaspi'
=>
$konv
,
'hargaKonferensi'
=>
$kegPeserta
,
'totalHarga'
=>
$totalHarga
,
];
return
$data
;
}
public
function
updatePembayaran
(
Request
$request
,
$va
)
public
function
updatePembayaran
(
Request
$request
,
$va
)
{
{
if
(
$request
->
bearerToken
()
!=
'zGKEX7CDNLOvVtetz6lqFZzhZv11Gr9Y2MKVIQmqusAyD5STPPEt7ZC1gl8P'
){
if
(
$request
->
bearerToken
()
!=
'zGKEX7CDNLOvVtetz6lqFZzhZv11Gr9Y2MKVIQmqusAyD5STPPEt7ZC1gl8P'
){
...
@@ -271,12 +314,15 @@ public function updatePembayaran(Request $request, $va)
...
@@ -271,12 +314,15 @@ public function updatePembayaran(Request $request, $va)
}
}
$registrasi
=
Registrasi
::
query
()
$registrasi
=
Registrasi
::
query
()
->
with
(
'pkKegiatan'
,
'pkRegistrasiPeserta.rKegiatanPeserta'
,
'pkRegistrasiPeserta.rKonferensiPeserta'
)
->
where
(
'kode_registrasi'
,
$va
)
->
where
(
'kode_registrasi'
,
$va
)
->
update
([
->
update
([
'tanggal_bayar'
=>
Carbon
::
now
()
'tanggal_bayar'
=>
Carbon
::
now
()
]);
]);
//SendMail::dispatch($data, 'email.selesai_pembayaran', $data['registrasi']->email, 'registrasi', 'email_pembayaran_sent_at');
$data
=
$this
->
getDataRegis
(
$va
);
SendMail
::
dispatch
(
$data
,
'email.selesai_pembayaran'
,
$data
[
'registrasi'
]
->
email
,
'registrasi'
,
'email_pembayaran_sent_at'
);
return
response
([
return
response
([
'status'
=>
200
,
'status'
=>
200
,
...
@@ -290,5 +336,12 @@ public function testEmail(Request $request)
...
@@ -290,5 +336,12 @@ public function testEmail(Request $request)
SendMail
::
dispatch
(
$data
,
'email.invoice'
,
$data
[
'registrasi'
]
->
email
,
'registrasi'
,
'email_regis_sent_at'
);
SendMail
::
dispatch
(
$data
,
'email.invoice'
,
$data
[
'registrasi'
]
->
email
,
'registrasi'
,
'email_regis_sent_at'
);
}
}
public
function
checkRegistrasi
(
Request
$request
,
$va
)
{
$data
=
$this
->
getDataRegis
(
$va
);
return
view
(
'email.selesai_pembayaran'
,
$data
);
}
}
}
resources/views/email/selesai_pembayaran.blade.php
View file @
2c8d8459
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<div class="
invoice
-
print
">
<div class="
invoice
-
print
">
<div class="
row
">
<div class="
row
">
<div class="
col
-
lg
-
12
">
<div class="
col
-
lg
-
12
">
<p class="
section
-
lead
" style="
font
-
size
:
12
pt
">Terimakasih telah mendaftar KONASPI XI 2024.
Pembayaran kegiatan telah kami terima
</p>
<p class="
section
-
lead
" style="
font
-
size
:
12
pt
">Terimakasih telah mendaftar KONASPI XI 2024.
({{ !is_null(
$registrasi->tanggal_bayar
) ? 'LUNAS' : 'Menunggu Pembayaran' }})
</p>
<div class="
invoice
-
title
">
<div class="
invoice
-
title
">
<h2>Invoice</h2>
<h2>Invoice</h2>
<div class="
invoice
-
number
">No. Transaksi #{{$registrasi['kode_registrasi'] ?? 'param' }}</div>
<div class="
invoice
-
number
">No. Transaksi #{{$registrasi['kode_registrasi'] ?? 'param' }}</div>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<div class="
row
mt
-
4
">
<div class="
row
mt
-
4
">
<div class="
col
-
md
-
12
" style="
font
-
size
:
12
pt
">
<div class="
col
-
md
-
12
" style="
font
-
size
:
12
pt
">
<p class="
section
-
lead
">Rincian (
Lunas
)</p>
<p class="
section
-
lead
">Rincian (
{{ !is_null(
$registrasi->tanggal_bayar
) ? 'LUNAS' : 'Menunggu Pembayaran' }}
)</p>
<div class="
table
-
responsive
">
<div class="
table
-
responsive
">
<table class="
table
table
-
striped
table
-
hover
table
-
md
">
<table class="
table
table
-
striped
table
-
hover
table
-
md
">
<tr>
<tr>
...
...
routes/web.php
View file @
2c8d8459
...
@@ -46,3 +46,4 @@
...
@@ -46,3 +46,4 @@
return
view
(
'email.invoice'
);
return
view
(
'email.invoice'
);
});
});
Route
::
get
(
'test/email'
,
[
RegistrasiController
::
class
,
'testEmail'
]);
Route
::
get
(
'test/email'
,
[
RegistrasiController
::
class
,
'testEmail'
]);
Route
::
get
(
'check/regis/{va}'
,
[
RegistrasiController
::
class
,
'checkRegistrasi'
]);
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