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
b77dc531
Commit
b77dc531
authored
a year ago
by
Muhammad Iskandar Java
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix va bayar
parent
f79abb5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
app/Http/Controllers/RegistrasiController.php
+18
-6
config/app.php
+2
-2
No files found.
app/Http/Controllers/RegistrasiController.php
View file @
b77dc531
...
...
@@ -18,14 +18,18 @@
class
RegistrasiController
extends
Controller
{
public
function
create
(){
// $jumlahPendaftar = Registrasi::count();
// $nourut = sprintf("%05s", $jumlahPendaftar+1);
// $koderegistrasi = 'REG-'.$komponen[0].$komponen[1].$komponen[2].$nourut;
$kegiatan
=
Kegiatan
::
get
();
$konferensi
=
Konferensi
::
get
();
$jumlahPendaftar
=
Registrasi
::
count
();
$nourut
=
sprintf
(
"%05s"
,
$jumlahPendaftar
+
1
);
$date
=
Date
(
'Y-m-d'
);
$lastKode
=
Registrasi
::
query
()
->
whereDate
(
'created_at'
,
$date
)
->
max
(
'kode_registrasi'
);
$nourut
=
sprintf
(
"%05s"
,
substr
(
$lastKode
,
-
5
)
+
1
);
$tgldaftar
=
Carbon
::
now
()
->
format
(
'd-m-Y'
);
$komponen
=
explode
(
'-'
,
$tgldaftar
);
// $koderegistrasi = 'REG-'.$komponen[0].$komponen[1].$komponen[2].$nourut;
$koderegistrasi
=
$komponen
[
0
]
.
$komponen
[
1
]
.
$nourut
;
$koderegistrasi
=
'-'
;
$data
=
[
'kegiatan'
=>
$kegiatan
,
...
...
@@ -54,6 +58,13 @@ public function store(Request $request) {
DB
::
beginTransaction
();
try
{
$date
=
Date
(
'Y-m-d'
);
$lastKode
=
Registrasi
::
query
()
->
whereDate
(
'created_at'
,
$date
)
->
max
(
'kode_registrasi'
);
$nourut
=
sprintf
(
"%05s"
,
substr
(
$lastKode
,
-
5
)
+
1
);
$tgldaftar
=
Carbon
::
now
()
->
format
(
'd-m-Y'
);
$komponen
=
explode
(
'-'
,
$tgldaftar
);
$kode_registrasi
=
$komponen
[
0
]
.
$komponen
[
1
]
.
$nourut
;
$registrasi
=
[
'nama'
=>
strip_tags
(
$request
->
nama
),
'email'
=>
strip_tags
(
$request
->
email
),
...
...
@@ -63,7 +74,7 @@ public function store(Request $request) {
'alamat'
=>
strip_tags
(
$request
->
alamat
),
'kode_pos'
=>
strip_tags
(
$request
->
kodepos
),
'kota'
=>
strip_tags
(
$request
->
kota
),
'kode_registrasi'
=>
strip_tags
(
$
request
->
kode_registrasi
)
'kode_registrasi'
=>
strip_tags
(
$kode_registrasi
)
];
$tglRegistrasi
=
Carbon
::
now
()
->
format
(
'Y-m-d h:i:s'
);
...
...
@@ -72,7 +83,6 @@ public function store(Request $request) {
$konaspi
=
Kegiatan
::
query
()
->
where
(
'id'
,
'498633a9-082c-4a4a-9dbd-e20b678ec15e'
)
->
first
();
$registrasi
=
Registrasi
::
query
()
->
create
(
$registrasi
);
$id_registrasi
=
$registrasi
->
id
;
$kode_registrasi
=
$registrasi
->
kode_registrasi
;
//inisial harga
// dd($konaspi);
$totalHarga
=
(
int
)
$konaspi
->
harga
;
...
...
@@ -110,6 +120,8 @@ public function store(Request $request) {
$arrResponse
=
json_decode
(
$generatedVa
,
true
);
$registrasi
->
status_va
=
$arrResponse
[
'BTNresponse'
];
$registrasi
->
tagihan
=
$totalHarga
;
$registrasi
->
save
();
if
(
$arrResponse
[
'BTNresponse'
]
!=
'Request has been processed successfully'
){
...
...
This diff is collapsed.
Click to expand it.
config/app.php
View file @
b77dc531
...
...
@@ -70,7 +70,7 @@
|
*/
'timezone'
=>
'
UTC
'
,
'timezone'
=>
'
Asia/Jakarta
'
,
/*
|--------------------------------------------------------------------------
...
...
@@ -83,7 +83,7 @@
|
*/
'locale'
=>
'
en
'
,
'locale'
=>
'
id
'
,
/*
|--------------------------------------------------------------------------
...
...
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