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
6e8849e4
Commit
6e8849e4
authored
Jul 05, 2024
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add registrasi kelompok
parent
8262df37
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
94 deletions
+122
-94
app/Http/Controllers/RegistrasiController.php
+76
-56
resources/views/email/invoice.blade.php
+23
-18
resources/views/form_registrasi_kelompok.blade.php
+4
-4
resources/views/invoice.blade.php
+17
-15
resources/views/preview.blade.php
+2
-1
No files found.
app/Http/Controllers/RegistrasiController.php
View file @
6e8849e4
...
...
@@ -19,6 +19,7 @@
use
Illuminate\Support\Facades\Log
;
use
RealRashid\SweetAlert\Facades\Alert
;
use
Str
;
use
function
PHPUnit
\Framework\isEmpty
;
class
RegistrasiController
extends
Controller
{
...
...
@@ -79,7 +80,7 @@ public function group_kegiatan(Request $request){
'instansi'
=>
'required|string'
,
'jabatan'
=>
'required|string'
,
'alamat'
=>
'required|string'
,
'kodepos'
=>
'required|string'
,
'kode
_
pos'
=>
'required|string'
,
'kota'
=>
'required|string'
,
'nik'
=>
'required|unique:registrasi,nik'
];
...
...
@@ -109,7 +110,7 @@ public function preview(Request $request){
'instansi'
=>
'required|string'
,
'jabatan'
=>
'required|string'
,
'alamat'
=>
'required|string'
,
'kodepos'
=>
'required|string'
,
'kode
_
pos'
=>
'required|string'
,
'kota'
=>
'required|string'
,
];
$request
->
validate
(
$rules
,
ValidationRule
::
getErrorMessage
(
$rules
));
...
...
@@ -194,10 +195,12 @@ public function preview(Request $request){
}
}
else
{
$kegiatan
=
Kegiatan
::
select
(
'id'
,
'nama'
,
'harga'
)
->
where
(
'id'
,
$request
->
kegiatan
[
0
])
->
first
();
$hargaKonferensi
=
null
;
$kegiatanpeserta
[]
=
[
'id_kegiatan'
=>
$request
->
kegiatan
0
[
0
],
'id_kegiatan'
=>
$request
->
kegiatan
[
0
],
'id_konferensi'
=>
null
,
'nama_kegiatan'
=>
$kegiatan
->
nama
];
}
...
...
@@ -209,6 +212,7 @@ public function preview(Request $request){
'hargaKonferensi'
=>
$hargaKonferensi
,
'totalHarga'
=>
$totalHarga
,
'anggota'
=>
$request
->
anggota
??
[],
'kegiatan_anggota'
=>
$request
->
kegiatan_anggota
];
return
view
(
'preview'
,
$data
)
->
with
(
'success'
,
'Data saved successfully'
);
...
...
@@ -225,7 +229,7 @@ public function preview(Request $request){
public
function
store
(
Request
$request
)
{
DB
::
beginTransaction
();
// dd($request);
try
{
$registrasi
=
json_decode
(
$request
->
registrasi
,
true
);
$kegiatanpeserta
=
json_decode
(
$request
->
kegiatanpeserta
,
true
);
...
...
@@ -234,7 +238,7 @@ public function store(Request $request) {
$anggota
=
json_decode
(
$request
->
anggota
,
true
);
$tglRegistrasi
=
$request
->
tglRegistrasi
;
// $totalHargas = $request->totalHarga;
$kegiatan_anggota
=
json_decode
(
$request
->
kegiatan_anggota
);
$registrasi
=
Registrasi
::
query
()
->
create
(
$registrasi
);
$id_registrasi
=
$registrasi
->
id
;
$jumlahKeg
=
count
(
$kegiatanpeserta
);
...
...
@@ -246,18 +250,42 @@ public function store(Request $request) {
$anggota
[
$key
][
'created_at'
]
=
Carbon
::
now
()
->
toDateTimeString
();
$anggota
[
$key
][
'updated_at'
]
=
Carbon
::
now
()
->
toDateTimeString
();
}
// dd($anggota, $kegiatanpeserta);
Anggota
::
query
()
->
insert
(
$anggota
);
//inisial harga
$konvensi
=
Kegiatan
::
find
(
$konaspi
[
'id'
]);
$konv
=
$konvensi
->
toArray
();
$jumlahPeserta
=
count
(
$anggota
);
$totalHarga
=
((
int
)
$konvensi
->
harga
)
*
$jumlahPeserta
;
// dd($kegiatanpeserta, $totalHarga, $anggota, $registrasi['kode_registrasi']);
if
(
$jumlahPeserta
>
0
){
$totalHarga
=
((
int
)
$konvensi
->
harga
)
*
$jumlahPeserta
;
}
else
{
$totalHarga
=
((
int
)
$konvensi
->
harga
);
}
if
(
!
isEmpty
(
$anggota
)
&&
!
is_null
(
$kegiatan_anggota
)){
$anggotaIndices
=
array_keys
(
$anggota
);
$kegiatanAnggotaValues
=
array_values
(
$kegiatan_anggota
);
$konvensi_anggota
=
array_values
(
array_diff
(
$anggotaIndices
,
$kegiatanAnggotaValues
));
if
(
$konvensi_anggota
){
foreach
(
$konvensi_anggota
as
$key
=>
$value
)
{
$convention_only
=
[
'id_registrasi'
=>
$anggota
[
$value
][
'id_registrasi'
],
'id_kegiatan'
=>
$konv
[
'id'
],
'id_konferensi'
=>
null
,
'id_anggota'
=>
$anggota
[
$value
][
'id'
]
];
KegiatanPeserta
::
query
()
->
create
(
$convention_only
);
}
}
}
foreach
(
$kegiatanpeserta
as
$keg
){
// dd($kegiatanpeserta, $keg, $jumlahPeserta);
$arrayKeg
=
$keg
;
if
(
isset
(
$arrayKeg
[
'anggota'
][
'key'
])){
...
...
@@ -273,9 +301,8 @@ public function store(Request $request) {
'id_konferensi'
=>
$keg
[
'id_konferensi'
],
'id_anggota'
=>
$idPeserta
];
// dd($kegpeserta, $kegiatanpeserta);
KegiatanPeserta
::
query
()
->
create
(
$kegpeserta
);
// dd($kegpeserta, $kegiatanpeserta);
if
(
$keg
[
'id_kegiatan'
]
!=
'498633a9-082c-4a4a-9dbd-e20b678ec15e'
){
$konferensi
=
Konferensi
::
query
()
->
where
(
'id'
,
$keg
[
'id_konferensi'
])
->
first
();
...
...
@@ -288,42 +315,38 @@ public function store(Request $request) {
'hargakon'
=>
$konferensi
->
harga
,
'namakeg'
=>
$kegkonaspi
->
nama
];
// dd($kegPeserta);
}
else
{
$kegPeserta
=
null
;
}
}
// dd($kegPeserta);
$multipartData
=
[
'noid'
=>
$registrasi
[
'kode_registrasi'
],
'nama'
=>
$registrasi
[
'nama'
],
'tagihan'
=>
$totalHarga
];
// dd($kegPeserta, $multipartData);
$registrasi
->
save
();
// ditutup sementara
// $generatedVa = $this->generateVa($multipartData);
// $arrResponse = json_decode($generatedVa, true);
// $registrasi['status_va'] = $arrResponse['BTNresponse'];
$registrasi
[
'status_va'
]
=
'status_vA'
;
$generatedVa
=
$this
->
generateVa
(
$multipartData
);
$arrResponse
=
json_decode
(
$generatedVa
,
true
);
$registrasi
[
'status_va'
]
=
$arrResponse
[
'BTNresponse'
];
$registrasi
[
'tagihan'
]
=
$totalHarga
;
//
$registrasi['nomor_va'] = $arrResponse['BTNVirtualAccount'];
$registrasi
[
'nomor_va'
]
=
$registrasi
[
'kode_registrasi'
];
$registrasi
[
'nomor_va'
]
=
$arrResponse
[
'BTNVirtualAccount'
];
$registrasi
->
save
();
// ditutup sementara
// if($arrResponse['BTNresponse'] != 'Request has been processed successfully'){
// DB::rollBack();
// Log::error('---');
// Log::error($multipartData);
// Log::error($arrResponse['BTNresponse']);
// Log::error('---');
if
(
$arrResponse
[
'BTNresponse'
]
!=
'Request has been processed successfully'
){
DB
::
rollBack
();
Log
::
error
(
'---'
);
Log
::
error
(
$multipartData
);
Log
::
error
(
$arrResponse
[
'BTNresponse'
]);
Log
::
error
(
'---'
);
//
return redirect()->route('user.create')
//
->with('error', 'Data failed to save');
//
}
return
redirect
()
->
route
(
'user.create'
)
->
with
(
'error'
,
'Data failed to save'
);
}
DB
::
commit
();
...
...
@@ -346,34 +369,31 @@ public function store(Request $request) {
Log
::
error
(
$e
);
DB
::
rollBack
();
dd
(
$e
);
return
redirect
()
->
route
(
'user.create'
)
->
with
(
'error'
,
'Data failed to save'
);
}
}
// ditutup sementara
// private function generateVa($multipartData)
// {
// $client = new Client();
// $options = [
// 'form_params' => [
// // 'credential' => '$2a$08$xSX/XuObiJ3GoJWhjDTyXepT64o1ze.A/.OVYB15uzKW3V7pxgZ6O',
// 'credential' => '$1$OkLGZt6i$FzuqzUwZ8nNS/xbzyPN/R/',
// 'noid' => $multipartData['noid'],
// 'nama' => $multipartData['nama'],
// 'tagihan' => $multipartData['tagihan'],
// 'flag' => 'F',
// 'expired_date' => '2024-08-01T23:59:59+07:00',
// 'deskripsi' => 'pembayaran konaspi'
// ]
// ];
// $response = $client->request('POST', 'https://neosidata.unesa.ac.id/btn_v2/create', $options);
// return $response->getBody()->getContents();
// }
private
function
generateVa
(
$multipartData
)
{
$client
=
new
Client
();
$options
=
[
'form_params'
=>
[
// 'credential' => '$2a$08$xSX/XuObiJ3GoJWhjDTyXepT64o1ze.A/.OVYB15uzKW3V7pxgZ6O',
'credential'
=>
'$1$OkLGZt6i$FzuqzUwZ8nNS/xbzyPN/R/'
,
'noid'
=>
$multipartData
[
'noid'
],
'nama'
=>
$multipartData
[
'nama'
],
'tagihan'
=>
$multipartData
[
'tagihan'
],
'flag'
=>
'F'
,
'expired_date'
=>
'2024-08-01T23:59:59+07:00'
,
'deskripsi'
=>
'pembayaran konaspi'
]
];
$response
=
$client
->
request
(
'POST'
,
'https://neosidata.unesa.ac.id/btn_v2/create'
,
$options
);
return
$response
->
getBody
()
->
getContents
();
}
private
function
getDataUniv
(){
$client
=
new
Client
();
...
...
resources/views/email/invoice.blade.php
View file @
6e8849e4
...
...
@@ -71,25 +71,30 @@
Convention
</td>
<td class="
text
-
center
">Rp
{
{$konaspi['harga']??'param'}
}
</td>
<td class="
text
-
center
">
1
</td>
<td class="
text
-
right
">Rp
{
{
$konaspi['harga']??'param'
}
}
</td>
<td class="
text
-
center
">
{{ (
$jumlah_peserta
!= 0) ?
$jumlah_peserta
: 1 }}
</td>
<td class="
text
-
right
">Rp {{
$totalHarga
}}</td>
</tr>
@if (isset(
$
hargaKonferensi
))
@foreach (
$
hargaKonferensi
as
$kon
)
@if (isset(
$
kegiatanpeserta
))
@foreach (
$
kegiatanpeserta
as
$kon
)
@php
$subtotal
=
$subtotal
+
$kon['hargakon']
;
//
$subtotal
=
$subtotal
+
$kon['hargakon']
;
@endphp
<tr>
<td>
{
{$no}
}
</td>
<td>
{
{$kon['namakeg']}
}
<br> Konferensi : <b>
{
{$kon['namakon']??'param'}
}
</b>
</td>
{{-- <td class="
text
-
center
">Rp
{
{$kon['hargakon']??'param'}
}
</td> --}}
<td class="
text
-
center
">-</td>
<td class="
text
-
center
">1</td>
{{-- <td class="
text
-
right
">Rp
{
{$kon['hargakon']??'param'}
}
</td> --}}
<td class="
text
-
right
">-</td>
</tr>
@if (
$kon['id_konferensi']
)
<tr>
<td>
{
{$no}
}
</td>
<td>
{
{$kon['nama_kegiatan']}
}
<br> Konferensi : <b>
{
{$kon['nama_konferensi']}
}
</b>
@isset(
$kon['anggota']['nama']
)
<br>Anggota : <b>{{
$kon['anggota']['nama']
}}</b>
@endisset
</td>
{{-- <td class="
text
-
center
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
center
">-</td>
<td class="
text
-
center
">1</td>
{{-- <td class="
text
-
right
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
right
">-</td>
</tr>
@endif
@php
$i
++;
$no
++;
...
...
@@ -118,13 +123,13 @@
<div class="
invoice
-
detail
-
item
">
<div class="
invoice
-
detail
-
name
">Subtotal</div>
{{-- <div class="
invoice
-
detail
-
value
">Rp
{
{$subtotal}
}
</div> --}}
<div class="
invoice
-
detail
-
value
">Rp
{
{$
initialh
arga}
}
</div>
<div class="
invoice
-
detail
-
value
">Rp
{
{$
totalH
arga}
}
</div>
</div>
<hr class="
mt
-
2
mb
-
2
">
<div class="
invoice
-
detail
-
item
">
<div class="
invoice
-
detail
-
name
">Total</div>
{{-- <div class="
invoice
-
detail
-
value
invoice
-
detail
-
value
-
lg
">Rp
{
{$subtotal}
}
</div> --}}
<div class="
invoice
-
detail
-
value
invoice
-
detail
-
value
-
lg
">Rp
{
{$
initialh
arga}
}
</div>
<div class="
invoice
-
detail
-
value
invoice
-
detail
-
value
-
lg
">Rp
{
{$
totalH
arga}
}
</div>
</div>
</div>
</div>
...
...
resources/views/form_registrasi_kelompok.blade.php
View file @
6e8849e4
...
...
@@ -109,11 +109,11 @@
<label id="
login
-
error
" class="
error
" for="
alamat
" style="
color
:
red
">
{
{$errors->first('alamat')}
}
</label>
@endif
</div>
<div class="
form
-
group
" @if (
$errors->has
('kodepos')) has-error @endif>
<div class="
form
-
group
" @if (
$errors->has
('kode
_
pos')) has-error @endif>
<label>Kode Pos</label>
<input type="
number
" id="
kode
pos
" name="
kodepos
" class="
form
-
control
number
" required="
true
" placeholder="" value="
{{
old
(
'kode
pos'
)}}
">
@if (
$errors->has
('kodepos'))
<label id="
login
-
error
" class="
error
" for="
kode
pos
" style="
color
:
red
">
{
{$errors->first('kode
pos')}
}
</label>
<input type="
number
" id="
kode
_pos
" name="
kode_pos
" class="
form
-
control
number
" required="
true
" placeholder="" value="
{{
old
(
'kode_
pos'
)}}
">
@if (
$errors->has
('kode
_
pos'))
<label id="
login
-
error
" class="
error
" for="
kode
_pos
" style="
color
:
red
">
{
{$errors->first('kode_
pos')}
}
</label>
@endif
{{-- <div class="
invalid
-
feedback
">Isikan Kode Pos yg sesuai</div> --}}
</div>
...
...
resources/views/invoice.blade.php
View file @
6e8849e4
...
...
@@ -81,7 +81,7 @@
Convention
</td>
<td class="
text
-
center
">Rp
{
{$konaspi['harga']}
}
</td>
<td class="
text
-
center
">{{
$jumlah_peserta
}}</td>
<td class="
text
-
center
">{{
(
$jumlah_peserta
!= 0) ?
$jumlah_peserta
: 1
}}</td>
<td class="
text
-
right
">Rp {{
$totalHarga
}}</td>
</tr>
@if (isset(
$kegiatanpeserta
))
...
...
@@ -89,20 +89,22 @@
{{-- @php
$subtotal
=
$subtotal
+
$kon['hargakon']
;
@endphp --}}
<tr>
<td>
{
{$no}
}
</td>
<td>
{
{$kon['nama_kegiatan']}
}
<br> Konferensi : <b>
{
{$kon['nama_konferensi']}
}
</b>
@isset(
$kon['anggota']['nama']
)
@if (
$kon['id_konferensi']
)
<tr>
<td>
{
{$no}
}
</td>
<td>
{
{$kon['nama_kegiatan']}
}
<br> Konferensi : <b>
{
{$kon['nama_konferensi']}
}
</b>
@isset(
$kon['anggota']['nama']
)
<br>Anggota : <b>{{
$kon['anggota']['nama']
}}</b>
@endisset
</td>
{{-- <td class="
text
-
center
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
center
">-</td>
<td class="
text
-
center
">1</td>
{{-- <td class="
text
-
right
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
right
">-</td>
</tr>
@endisset
</td>
{{-- <td class="
text
-
center
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
center
">-</td>
<td class="
text
-
center
">1</td>
{{-- <td class="
text
-
right
">Rp
{
{$kon['hargakon']}
}
</td> --}}
<td class="
text
-
right
">-</td>
</tr>
@endif
@php
$i
++;
$no
++;
...
...
@@ -160,7 +162,7 @@
<input type="
hidden
" id="
totalHarga
" name="
totalHarga
" value="
{{
json_encode
(
$totalHarga
)
}}
"> --}}
{{-- <button type="
submit
" class="
btn
btn
-
primary
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
credit
-
card
"></i> Bayar</button> --}}
{{-- <a href="
{{
route
(
'user.create'
)}}
" class="
btn
btn
-
primary
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
credit
-
card
"></i> Bayar</a> --}}
<a href="
{{
route
(
'
user.create
'
)}}
" class="
btn
btn
-
danger
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
times
"></i>Close</a>
<a href="
{{
route
(
'
pre-register
'
)}}
" class="
btn
btn
-
danger
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
times
"></i>Close</a>
</div>
</div>
</div>
...
...
resources/views/preview.blade.php
View file @
6e8849e4
...
...
@@ -154,7 +154,8 @@
<input type="
hidden
" id="
konaspi
" name="
konaspi
" value="
{{
json_encode
(
$konaspi
)
}}
">
<input type="
hidden
" id="
hargaKonferensi
" name="
hargaKonferensi
" value="
{{
json_encode
(
$hargaKonferensi
)
}}
">
<input type="
hidden
" id="
totalHarga
" name="
totalHarga
" value="
{{
json_encode
(
$totalHarga
)
}}
">
<input type="
hidden
" id="
totalHarga
" name="
anggota
" value="
{{
json_encode
(
$anggota
)
}}
">
<input type="
hidden
" id="
anggota
" name="
anggota
" value="
{{
json_encode
(
$anggota
)
}}
">
<input type="
hidden
" id="
kegiatan_anggota
" name="
kegiatan_anggota
" value="
{{
json_encode
(
$kegiatan_anggota
)
}}
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
credit
-
card
"></i> Daftar</button>
<button class="
btn
btn
-
danger
btn
-
icon
icon
-
left
"><i class="
fas
fa
-
times
"></i> Cancel</button>
</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