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
40063f71
Commit
40063f71
authored
Mar 26, 2024
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add NIK dan ubah kode registrasi jadi 5 digit
parent
78c1c32f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
app/Http/Controllers/RegistrasiController.php
+14
-6
app/Models/Registrasi.php
+3
-1
resources/views/form_registrasi.blade.php
+8
-1
No files found.
app/Http/Controllers/RegistrasiController.php
View file @
40063f71
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
use
Exception
;
use
Exception
;
use
GuzzleHttp\Client
;
use
GuzzleHttp\Client
;
use
GuzzleHttp\Psr7\MultipartStream
;
use
GuzzleHttp\Psr7\MultipartStream
;
use
Illuminate\Contracts\Routing\Registrar
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Facades\Log
;
...
@@ -62,11 +63,16 @@ public function preview(Request $request){
...
@@ -62,11 +63,16 @@ public function preview(Request $request){
try
{
try
{
$date
=
Date
(
'Y-m-d'
);
$date
=
Date
(
'Y-m-d'
);
$lastKode
=
Registrasi
::
query
()
->
whereDate
(
'created_at'
,
$date
)
->
max
(
'kode_registrasi'
);
// $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi');
$nourut
=
sprintf
(
"%05s"
,
((
int
)
substr
(
$lastKode
,
-
5
))
+
1
);
// $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1);
$tgldaftar
=
Carbon
::
now
()
->
format
(
'd-m-Y'
);
// $tgldaftar = Carbon::now()->format('d-m-Y');
$komponen
=
explode
(
'-'
,
$tgldaftar
);
// $komponen = explode('-', $tgldaftar);
$kode_registrasi
=
$komponen
[
0
]
.
$komponen
[
1
]
.
$nourut
;
// $kode_registrasi = $komponen[0].$komponen[1].$nourut;
$urutanTerakhir
=
Registrasi
::
query
()
->
max
(
'urutan'
);
$urutan
=
(
int
)
$urutanTerakhir
+
1
;
$nourut
=
sprintf
(
"%05s"
,
$urutan
);
$kode_registrasi
=
$nourut
;
$registrasi
=
[
$registrasi
=
[
'nama'
=>
strip_tags
(
$request
->
nama
),
'nama'
=>
strip_tags
(
$request
->
nama
),
...
@@ -77,7 +83,9 @@ public function preview(Request $request){
...
@@ -77,7 +83,9 @@ public function preview(Request $request){
'alamat'
=>
strip_tags
(
$request
->
alamat
),
'alamat'
=>
strip_tags
(
$request
->
alamat
),
'kode_pos'
=>
strip_tags
(
$request
->
kodepos
),
'kode_pos'
=>
strip_tags
(
$request
->
kodepos
),
'kota'
=>
strip_tags
(
$request
->
kota
),
'kota'
=>
strip_tags
(
$request
->
kota
),
'kode_registrasi'
=>
strip_tags
(
$kode_registrasi
)
'kode_registrasi'
=>
strip_tags
(
$kode_registrasi
),
'urutan'
=>
$urutan
,
'nik'
=>
strip_tags
(
$request
->
nik
)
];
];
$tglRegistrasi
=
Carbon
::
now
()
->
format
(
'Y-m-d h:i:s'
);
$tglRegistrasi
=
Carbon
::
now
()
->
format
(
'Y-m-d h:i:s'
);
...
...
app/Models/Registrasi.php
View file @
40063f71
...
@@ -31,7 +31,9 @@ class Registrasi extends Model
...
@@ -31,7 +31,9 @@ class Registrasi extends Model
'kode_registrasi'
,
'kode_registrasi'
,
'tagihan'
,
'tagihan'
,
'status_va'
,
'status_va'
,
'tanggal_bayar'
'tanggal_bayar'
,
'urutan'
,
'nik'
];
];
public
function
pkKegiatan
(){
public
function
pkKegiatan
(){
...
...
resources/views/form_registrasi.blade.php
View file @
40063f71
...
@@ -16,13 +16,20 @@
...
@@ -16,13 +16,20 @@
<div class="
card
">
<div class="
card
">
<div class="
card
-
body
">
<div class="
card
-
body
">
<div class="
row
">
<div class="
row
">
<div class="
col
-
12
form
-
group
" @if (
$errors->has
('nama')) has-error @endif>
<div class="
col
-
6
form
-
group
" @if (
$errors->has
('nama')) has-error @endif>
<label>Nama</label>
<label>Nama</label>
<input type="
text
" id="
nama
" name="
nama
" class="
form
-
control
" required="" placeholder="" value="
{{
old
(
'nama'
)}}
">
<input type="
text
" id="
nama
" name="
nama
" class="
form
-
control
" required="" placeholder="" value="
{{
old
(
'nama'
)}}
">
@if (
$errors->has
('nama'))
@if (
$errors->has
('nama'))
<label id="
login
-
error
" class="
error
" for="
nama
" style="
color
:
red
">
{
{$errors->first('nama')}
}
</label>
<label id="
login
-
error
" class="
error
" for="
nama
" style="
color
:
red
">
{
{$errors->first('nama')}
}
</label>
@endif
@endif
</div>
</div>
<div class="
col
-
6
form
-
group
" @if (
$errors->has
('nik')) has-error @endif>
<label>NIK</label>
<input type="
text
" id="
nik
" name="
nik
" class="
form
-
control
" required="" placeholder="" value="
{{
old
(
'nik'
)}}
">
@if (
$errors->has
('nik'))
<label id="
login
-
error
" class="
error
" for="
nik
" style="
color
:
red
">
{
{$errors->first('nik')}
}
</label>
@endif
</div>
</div>
</div>
<div class="
row
">
<div class="
row
">
<div class="
col
-
6
form
-
group
" @if (
$errors->has
('email')) has-error @endif>
<div class="
col
-
6
form
-
group
" @if (
$errors->has
('email')) has-error @endif>
...
...
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