Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Reinol Simangunsong
Web BKPSDM
Commits
2fe29962
Commit
2fe29962
authored
7 months ago
by
Christo Gustawan Nugraha
Browse files
Options
Download
Email Patches
Plain Diff
fix ekatalog + arsip
unggah laporan editarsip belum fix
parent
88dccd43
main
BE-akpk
ChristoTA
be-pelatihan
fe-akpk
models-lama
No related merge requests found
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
app/Http/Controllers/ArsipLaporanController.php
+25
-23
app/Http/Controllers/ArsipLaporanController.php
app/Models/ArsipLaporan.php
+20
-6
app/Models/ArsipLaporan.php
app/Models/Diklat.php
+6
-3
app/Models/Diklat.php
database/migrations/2024_10_18_120435_create_diklats_table.php
+8
-2
...ase/migrations/2024_10_18_120435_create_diklats_table.php
public/uploads/excel/1730895176_JEE.xlsx
+0
-0
public/uploads/excel/1730895176_JEE.xlsx
public/uploads/pdf/1730895176_Laporan Rangkuman Pengujian Perangkat Lunak.pdf
+0
-0
...730895176_Laporan Rangkuman Pengujian Perangkat Lunak.pdf
public/uploads/reports/1730894997_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
+0
-0
...94997_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
public/uploads/reports/1730899413_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
+0
-0
...99413_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
resources/views/ekatalog/viewdiklat.blade.php
+15
-17
resources/views/ekatalog/viewdiklat.blade.php
resources/views/laporan/editarsip.blade.php
+1
-1
resources/views/laporan/editarsip.blade.php
with
75 additions
and
52 deletions
+75
-52
app/Http/Controllers/ArsipLaporanController.php
View file @
2fe29962
...
...
@@ -28,46 +28,48 @@ public function edit($id)
// Update the specified ArsipLaporan record in storage
public
function
update
(
Request
$request
,
$id
)
{
// Validate the incoming request data
$laporan_arsip
=
ArsipLaporan
::
findOrFail
(
$id
);
// Validate the incoming request
$request
->
validate
([
'nip'
=>
'required'
,
'nama_penulis'
=>
'required'
,
'jabatan'
=>
'required'
,
'golongan'
=>
'required'
,
'unit_kerja'
=>
'required'
,
'jenis_pelatihan'
=>
'required'
,
'nama_pelatihan'
=>
'required'
,
'nip'
=>
'required
|string|max:255
'
,
'nama_penulis'
=>
'required
|string|max:255
'
,
'jabatan'
=>
'required
|string|max:255
'
,
'golongan'
=>
'required
|string|max:255
'
,
'unit_kerja'
=>
'required
|string|max:255
'
,
'jenis_pelatihan'
=>
'required
|string|max:255
'
,
'nama_pelatihan'
=>
'required
|string|max:255
'
,
'tahun_pelatihan'
=>
'required|integer'
,
'pelaksanaan'
=>
'required'
,
'mode_pelatihan'
=>
'required'
,
'waktu_pelaksanaan'
=>
'required'
,
'judul_laporan'
=>
'required'
,
'latar_belakang'
=>
'required'
,
'unggah_laporan'
=>
'file|mimes:pdf
|max:2048
'
,
// Optional file validation
'pelaksanaan'
=>
'required
|string|max:255
'
,
'mode_pelatihan'
=>
'required
|string|max:255
'
,
'waktu_pelaksanaan'
=>
'required
|string|max:255
'
,
'judul_laporan'
=>
'required
|string|max:255
'
,
'latar_belakang'
=>
'required
|string
'
,
'unggah_laporan'
=>
'
nullable|
file|mimes:pdf
,docx,jpg,jpeg,png|max:10240
'
,
// Optional file validation
]);
// Retrieve the record by ID
$laporan_arsip
=
ArsipLaporan
::
findOrFail
(
$id
);
// Update the record's attributes
// Update the record's attributes (excluding file handling here for now)
$laporan_arsip
->
fill
(
$request
->
except
(
'unggah_laporan'
));
// Handle file upload if a new file is provided
if
(
$request
->
hasFile
(
'unggah_laporan'
))
{
// Delete the old file if it exists
if
(
$laporan_arsip
->
unggah_laporan
)
{
Storage
::
delete
(
$laporan_arsip
->
unggah_laporan
);
}
// Store the new file
$filePath
=
$request
->
file
(
'unggah_laporan'
)
->
store
(
'uploads/reports'
);
$laporan_arsip
->
unggah_laporan
=
$filePath
;
}
// Save the updated record
$laporan_arsip
->
save
();
// Redirect back
to the list or another desired p
age
return
redirect
()
->
route
(
'laporan.arsip'
)
->
with
(
'success'
,
'Laporan
arsip updated
successfully
.
'
);
// Redirect back
with a success mess
age
return
redirect
()
->
route
(
'laporan.arsip'
)
->
with
(
'success'
,
'Laporan successfully
updated
'
);
}
}
This diff is collapsed.
Click to expand it.
app/Models/ArsipLaporan.php
View file @
2fe29962
...
...
@@ -6,19 +6,33 @@
class
ArsipLaporan
extends
Model
{
//
Tentukan nama tabel yang digunakan
//
Specify the table name
protected
$table
=
'laporan_arsip'
;
//
Tentukan kolom y
an
g
b
isa diisi melalui
mass-assign
ment
//
Specify the columns that c
an b
e
mass-assign
ed
protected
$fillable
=
[
'nip'
,
'nama_penulis'
,
'j
udul_lapor
an'
,
'
nama_pelatih
an'
,
'j
abat
an'
,
'
golong
an'
,
'unit_kerja'
,
'jenis_pelatihan'
,
'nama_pelatihan'
,
'tahun_pelatihan'
,
'pelaksanaan'
,
'mode_pelatihan'
,
'waktu_pelaksanaan'
,
'judul_laporan'
,
'latar_belakang'
,
'unggah_laporan'
,
// Add this if it's part of your fillable fields (file uploads)
'status'
,
'tanggal_ajuan'
];
// Kolom timestamp created_at dan updated_at diaktifkan (default dari Laravel)
}
// If you don't have 'created_at' and 'updated_at' in the table,
// you can disable timestamps by setting this property to false.
// If these timestamps are in your table, leave this as true (default).
public
$timestamps
=
true
;
// Or false if you don't have these columns
// Define the relationship if needed (e.g., belongsTo, hasMany, etc.)
}
This diff is collapsed.
Click to expand it.
app/Models/Diklat.php
View file @
2fe29962
...
...
@@ -17,8 +17,11 @@ class Diklat extends Model
'rumpun'
,
'kode_jabatan'
,
'penyelenggara'
,
'link_katalog'
,
'tanggal_pelaksanaan'
,
// Add this field
'tempat_pelaksanaan'
,
// Add this field
'metode_pelaksanaan'
,
// Add this field
'jenis_biaya'
,
// Add this field
'biaya_per_orang'
,
// Add this field
'link_katalog'
,
// Add this field
];
}
This diff is collapsed.
Click to expand it.
database/migrations/2024_10_18_120435_create_diklats_table.php
View file @
2fe29962
...
...
@@ -20,8 +20,13 @@ public function up()
$table
->
string
(
'rumpun'
);
$table
->
string
(
'kode_jabatan'
);
$table
->
string
(
'penyelenggara'
);
$table
->
string
(
'link_katalog'
);
$table
->
timestamps
();
$table
->
date
(
'tanggal_pelaksanaan'
);
// Kolom tanggal_pelaksanaan
$table
->
string
(
'tempat_pelaksanaan'
);
// Kolom tempat_pelaksanaan
$table
->
string
(
'metode_pelaksanaan'
);
// Kolom metode_pelaksanaan
$table
->
string
(
'jenis_biaya'
);
// Kolom jenis_biaya
$table
->
decimal
(
'biaya_per_orang'
,
10
,
2
);
// Kolom biaya_per_orang
$table
->
string
(
'link_katalog'
)
->
nullable
();
// Kolom link_katalog
$table
->
timestamps
();
// Menambahkan kolom created_at dan updated_at
});
}
...
...
@@ -35,3 +40,4 @@ public function down()
Schema
::
dropIfExists
(
'diklats'
);
}
}
This diff is collapsed.
Click to expand it.
public/uploads/excel/1730895176_JEE.xlsx
0 → 100644
View file @
2fe29962
File added
This diff is collapsed.
Click to expand it.
public/uploads/pdf/1730895176_Laporan Rangkuman Pengujian Perangkat Lunak.pdf
0 → 100644
View file @
2fe29962
File added
This diff is collapsed.
Click to expand it.
public/uploads/reports/1730894997_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
0 → 100644
View file @
2fe29962
File added
This diff is collapsed.
Click to expand it.
public/uploads/reports/1730899413_Christo Gustawan Nugraha_V3422071_UAS SKD TEORI.pdf
0 → 100644
View file @
2fe29962
File added
This diff is collapsed.
Click to expand it.
resources/views/ekatalog/viewdiklat.blade.php
View file @
2fe29962
...
...
@@ -12,84 +12,82 @@
<
div
class
=
"card-body"
style
=
"background-color: #f8f5f1;"
>
<
div
class
=
"form-container mx-auto"
style
=
"max-width: 900px; padding: 40px; background-color: #ffffff; border-radius: 10px; border: 1px solid #ccc; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);"
>
<
form
action
=
"{{ route('ekatalog.storediklat') }}"
method
=
"POST"
enctype
=
"multipart/form-data"
>
@
csrf
<
form
>
<!--
Display
Diklat
data
-->
<
div
class
=
"mb-3"
>
<
label
for
=
"jenis_diklat"
class
=
"form-label"
>
Jenis
Diklat
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"jenis_diklat"
name
=
"jenis_diklat"
placeholder
=
"Masukkan
jenis
diklat"
re
quired
>
value
=
"{{
$diklat->
jenis
_
diklat
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"nama_diklat"
class
=
"form-label"
>
Nama
Diklat
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"nama_diklat"
name
=
"nama_diklat"
placeholder
=
"Masukkan
nama
diklat"
re
quired
>
value
=
"{{
$diklat->
nama
_
diklat
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"rumpun"
class
=
"form-label"
>
Rumpun
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"rumpun"
name
=
"rumpun"
placeholder
=
"Masukkan
rumpun"
re
quired
>
value
=
"{{
$diklat->
rumpun
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"kode_jabatan"
class
=
"form-label"
>
Kode
Jabatan
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"kode_jabatan"
name
=
"kode_jabatan"
placeholder
=
"Masukkan
kode
jabatan"
re
quired
>
value
=
"{{
$diklat->
kode
_
jabatan
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"penyelenggara"
class
=
"form-label"
>
Penyelenggara
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"penyelenggara"
name
=
"penyelenggara"
placeholder
=
"Masukkan
penyelenggara"
re
quired
>
value
=
"{{
$diklat->
penyelenggara
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"tanggal_pelaksanaan"
class
=
"form-label"
>
Tanggal
Pelaksanaan
</
label
>
<
input
type
=
"date"
class
=
"form-control"
id
=
"tanggal_pelaksanaan"
name
=
"tanggal_pelaksanaan"
required
>
name
=
"tanggal_pelaksanaan"
value
=
"{{
$diklat->tanggal_pelaksanaan
}}"
readonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"tempat_pelaksanaan"
class
=
"form-label"
>
Tempat
Pelaksanaan
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"tempat_pelaksanaan"
name
=
"tempat_pelaksanaan"
placeholder
=
"Masukkan
tempat
pelaksanaan"
re
quired
>
name
=
"tempat_pelaksanaan"
value
=
"{{
$diklat->
tempat
_
pelaksanaan
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"metode_pelaksanaan"
class
=
"form-label"
>
Metode
Pelaksanaan
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"metode_pelaksanaan"
name
=
"metode_pelaksanaan"
placeholder
=
"Masukkan
metode
pelaksanaan"
re
quired
>
name
=
"metode_pelaksanaan"
value
=
"{{
$diklat->
metode
_
pelaksanaan
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"jenis_biaya"
class
=
"form-label"
>
Jenis
Biaya
</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"jenis_biaya"
name
=
"jenis_biaya"
placeholder
=
"Masukkan
jenis
biaya"
re
quired
>
value
=
"{{
$diklat->
jenis
_
biaya
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"biaya_per_orang"
class
=
"form-label"
>
Biaya
/
Orang
</
label
>
<
input
type
=
"number"
class
=
"form-control"
id
=
"biaya_per_orang"
name
=
"biaya_per_orang"
placeholder
=
"Masukkan
biaya
per
orang"
re
quired
>
value
=
"{{
$diklat->
biaya
_
per
_
orang
}}
"
re
adonly
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"link_katalog"
class
=
"form-label"
>
Link
Katalog
</
label
>
<
input
type
=
"url"
class
=
"form-control"
id
=
"link_katalog"
name
=
"link_katalog"
placeholder
=
"Masukkan
link
katalog"
re
quired
>
value
=
"{{
$diklat->
link
_
katalog
}}
"
re
adonly
>
</
div
>
</
form
>
</
div
>
</
form
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
style
>
/* Add your CSS styles here */
</
style
>
@
endsection
\ No newline at end of file
@
endsection
This diff is collapsed.
Click to expand it.
resources/views/laporan/editarsip.blade.php
View file @
2fe29962
...
...
@@ -84,7 +84,7 @@
<
div
class
=
"mb-3"
>
<
label
for
=
"unggah_laporan"
class
=
"form-label"
>
Unggah
Laporan
</
label
>
<
input
type
=
"file"
class
=
"form-control"
id
=
"unggah_laporan"
name
=
"unggah_laporan"
accept
=
".pdf
"
>
<
input
type
=
"file"
class
=
"form-control"
id
=
"unggah_laporan"
name
=
"unggah_laporan"
accept
=
".pdf
,.doc,.docx"
required
>
@
if
(
$laporan_arsip
->
unggah_laporan
)
<
p
>
File
saat
ini
:
<
a
href
=
"{{ asset(
$laporan_arsip->unggah_laporan
) }}"
target
=
"_blank"
>
Lihat
Laporan
</
a
></
p
>
@
else
...
...
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
Menu
Projects
Groups
Snippets
Help