diff --git a/app/Models/listform.php b/app/Models/listform.php index f0303a24..df0a2a19 100644 --- a/app/Models/listform.php +++ b/app/Models/listform.php @@ -1,88 +1,88 @@ 'decimal:7', - 'nilai_tingkatan_desil' => 'decimal:7', - 'nilai_kondisi_ekonomi' => 'decimal:7', - 'total_nilai' => 'decimal:7', - ]; +// protected $casts = [ +// 'nilai_kepemilikan_kip' => 'decimal:7', +// 'nilai_tingkatan_desil' => 'decimal:7', +// 'nilai_kondisi_ekonomi' => 'decimal:7', +// 'total_nilai' => 'decimal:7', +// ]; - public function mahasiswa(): BelongsTo - { - return $this->belongsTo(Mahasiswa::class); - } +// public function mahasiswa(): BelongsTo +// { +// return $this->belongsTo(Mahasiswa::class); +// } - protected static function boot() - { - parent::boot(); +// protected static function boot() +// { +// parent::boot(); - static::saving(function ($listform) { - // Hitung jumlah berkas yang diupload - $berkasCount = 0; - if (!empty($listform->berkas_sktm)) $berkasCount++; - if (!empty($listform->berkas_ppke)) $berkasCount++; - if (!empty($listform->berkas_pmk)) $berkasCount++; - if (!empty($listform->berkas_pkh)) $berkasCount++; - if (!empty($listform->berkas_kks)) $berkasCount++; +// static::saving(function ($listform) { +// // Hitung jumlah berkas yang diupload +// $berkasCount = 0; +// if (!empty($listform->berkas_sktm)) $berkasCount++; +// if (!empty($listform->berkas_ppke)) $berkasCount++; +// if (!empty($listform->berkas_pmk)) $berkasCount++; +// if (!empty($listform->berkas_pkh)) $berkasCount++; +// if (!empty($listform->berkas_kks)) $berkasCount++; - // Tentukan kondisi ekonomi dan nilai berdasarkan jumlah berkas - if ($berkasCount >= 4) { - $listform->kondisi_ekonomi = 'Sangat Kurang Mampu'; - $listform->nilai_kondisi_ekonomi = 0.4; - } elseif ($berkasCount >= 2) { - $listform->kondisi_ekonomi = 'Kurang Mampu'; - $listform->nilai_kondisi_ekonomi = 0.3; - } else { - $listform->kondisi_ekonomi = 'Cukup Mampu'; - $listform->nilai_kondisi_ekonomi = 0.3; - } +// // Tentukan kondisi ekonomi dan nilai berdasarkan jumlah berkas +// if ($berkasCount >= 4) { +// $listform->kondisi_ekonomi = 'Sangat Kurang Mampu'; +// $listform->nilai_kondisi_ekonomi = 0.4; +// } elseif ($berkasCount >= 2) { +// $listform->kondisi_ekonomi = 'Kurang Mampu'; +// $listform->nilai_kondisi_ekonomi = 0.3; +// } else { +// $listform->kondisi_ekonomi = 'Cukup Mampu'; +// $listform->nilai_kondisi_ekonomi = 0.3; +// } - // Hitung total nilai - $totalNilai = 0; +// // Hitung total nilai +// $totalNilai = 0; - // Nilai dari Kepemilikan KIP - if ($listform->kepemilikan_kip === 'Memiliki KIP') { - $totalNilai += 0.6; - } else { - $totalNilai += 0.4; - } +// // Nilai dari Kepemilikan KIP +// if ($listform->kepemilikan_kip === 'Memiliki KIP') { +// $totalNilai += 0.6; +// } else { +// $totalNilai += 0.4; +// } - // Nilai dari Tingkatan Desil - switch ($listform->tingkatan_desil) { - case 'Desil 1': - $totalNilai += 0.35; - break; - case 'Desil 2': - $totalNilai += 0.25; - break; - case 'Desil 3': - $totalNilai += 0.20; - break; - case 'Desil 4': - $totalNilai += 0.15; - break; - case 'Desil 5': - $totalNilai += 0.05; - break; - } +// // Nilai dari Tingkatan Desil +// switch ($listform->tingkatan_desil) { +// case 'Desil 1': +// $totalNilai += 0.35; +// break; +// case 'Desil 2': +// $totalNilai += 0.25; +// break; +// case 'Desil 3': +// $totalNilai += 0.20; +// break; +// case 'Desil 4': +// $totalNilai += 0.15; +// break; +// case 'Desil 5': +// $totalNilai += 0.05; +// break; +// } - // Tambahkan nilai kondisi ekonomi - $totalNilai += $listform->nilai_kondisi_ekonomi; +// // Tambahkan nilai kondisi ekonomi +// $totalNilai += $listform->nilai_kondisi_ekonomi; - $listform->total_nilai = $totalNilai; - }); - } +// $listform->total_nilai = $totalNilai; +// }); +// } -} +// } diff --git a/app/Policies/FormulirPolicy.php b/app/Policies/FormulirPolicy.php new file mode 100644 index 00000000..79649a15 --- /dev/null +++ b/app/Policies/FormulirPolicy.php @@ -0,0 +1,108 @@ +can('view_any_formulir'); + } + + /** + * Determine whether the user can view the model. + */ + public function view(User $user, Formulir $formulir): bool + { + return $user->can('view_formulir'); + } + + /** + * Determine whether the user can create models. + */ + public function create(User $user): bool + { + return $user->can('create_formulir'); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Formulir $formulir): bool + { + return $user->can('update_formulir'); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, Formulir $formulir): bool + { + return $user->can('delete_formulir'); + } + + /** + * Determine whether the user can bulk delete. + */ + public function deleteAny(User $user): bool + { + return $user->can('delete_any_formulir'); + } + + /** + * Determine whether the user can permanently delete. + */ + public function forceDelete(User $user, Formulir $formulir): bool + { + return $user->can('force_delete_formulir'); + } + + /** + * Determine whether the user can permanently bulk delete. + */ + public function forceDeleteAny(User $user): bool + { + return $user->can('force_delete_any_formulir'); + } + + /** + * Determine whether the user can restore. + */ + public function restore(User $user, Formulir $formulir): bool + { + return $user->can('restore_formulir'); + } + + /** + * Determine whether the user can bulk restore. + */ + public function restoreAny(User $user): bool + { + return $user->can('restore_any_formulir'); + } + + /** + * Determine whether the user can replicate. + */ + public function replicate(User $user, Formulir $formulir): bool + { + return $user->can('replicate_formulir'); + } + + /** + * Determine whether the user can reorder. + */ + public function reorder(User $user): bool + { + return $user->can('reorder_formulir'); + } +} diff --git a/app/Policies/KriteriaPolicy.php b/app/Policies/KriteriaPolicy.php new file mode 100644 index 00000000..70dc28ba --- /dev/null +++ b/app/Policies/KriteriaPolicy.php @@ -0,0 +1,108 @@ +can('view_any_kriteria'); + } + + /** + * Determine whether the user can view the model. + */ + public function view(User $user, Kriteria $kriteria): bool + { + return $user->can('view_kriteria'); + } + + /** + * Determine whether the user can create models. + */ + public function create(User $user): bool + { + return $user->can('create_kriteria'); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Kriteria $kriteria): bool + { + return $user->can('update_kriteria'); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, Kriteria $kriteria): bool + { + return $user->can('delete_kriteria'); + } + + /** + * Determine whether the user can bulk delete. + */ + public function deleteAny(User $user): bool + { + return $user->can('delete_any_kriteria'); + } + + /** + * Determine whether the user can permanently delete. + */ + public function forceDelete(User $user, Kriteria $kriteria): bool + { + return $user->can('force_delete_kriteria'); + } + + /** + * Determine whether the user can permanently bulk delete. + */ + public function forceDeleteAny(User $user): bool + { + return $user->can('force_delete_any_kriteria'); + } + + /** + * Determine whether the user can restore. + */ + public function restore(User $user, Kriteria $kriteria): bool + { + return $user->can('restore_kriteria'); + } + + /** + * Determine whether the user can bulk restore. + */ + public function restoreAny(User $user): bool + { + return $user->can('restore_any_kriteria'); + } + + /** + * Determine whether the user can replicate. + */ + public function replicate(User $user, Kriteria $kriteria): bool + { + return $user->can('replicate_kriteria'); + } + + /** + * Determine whether the user can reorder. + */ + public function reorder(User $user): bool + { + return $user->can('reorder_kriteria'); + } +} diff --git a/app/Policies/MahasiswaPolicy.php b/app/Policies/MahasiswaPolicy.php new file mode 100644 index 00000000..149d5305 --- /dev/null +++ b/app/Policies/MahasiswaPolicy.php @@ -0,0 +1,108 @@ +can('view_any_mahasiswa'); + } + + /** + * Determine whether the user can view the model. + */ + public function view(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('view_mahasiswa'); + } + + /** + * Determine whether the user can create models. + */ + public function create(User $user): bool + { + return $user->can('create_mahasiswa'); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('update_mahasiswa'); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('delete_mahasiswa'); + } + + /** + * Determine whether the user can bulk delete. + */ + public function deleteAny(User $user): bool + { + return $user->can('delete_any_mahasiswa'); + } + + /** + * Determine whether the user can permanently delete. + */ + public function forceDelete(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('force_delete_mahasiswa'); + } + + /** + * Determine whether the user can permanently bulk delete. + */ + public function forceDeleteAny(User $user): bool + { + return $user->can('force_delete_any_mahasiswa'); + } + + /** + * Determine whether the user can restore. + */ + public function restore(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('restore_mahasiswa'); + } + + /** + * Determine whether the user can bulk restore. + */ + public function restoreAny(User $user): bool + { + return $user->can('restore_any_mahasiswa'); + } + + /** + * Determine whether the user can replicate. + */ + public function replicate(User $user, Mahasiswa $mahasiswa): bool + { + return $user->can('replicate_mahasiswa'); + } + + /** + * Determine whether the user can reorder. + */ + public function reorder(User $user): bool + { + return $user->can('reorder_mahasiswa'); + } +} diff --git a/app/Policies/SubkriteriaPolicy.php b/app/Policies/SubkriteriaPolicy.php new file mode 100644 index 00000000..446b546b --- /dev/null +++ b/app/Policies/SubkriteriaPolicy.php @@ -0,0 +1,108 @@ +can('view_any_sub::kriteria'); + } + + /** + * Determine whether the user can view the model. + */ + public function view(User $user, SubKriteria $subKriteria): bool + { + return $user->can('view_sub::kriteria'); + } + + /** + * Determine whether the user can create models. + */ + public function create(User $user): bool + { + return $user->can('create_sub::kriteria'); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, SubKriteria $subKriteria): bool + { + return $user->can('update_sub::kriteria'); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, SubKriteria $subKriteria): bool + { + return $user->can('delete_sub::kriteria'); + } + + /** + * Determine whether the user can bulk delete. + */ + public function deleteAny(User $user): bool + { + return $user->can('delete_any_sub::kriteria'); + } + + /** + * Determine whether the user can permanently delete. + */ + public function forceDelete(User $user, SubKriteria $subKriteria): bool + { + return $user->can('force_delete_sub::kriteria'); + } + + /** + * Determine whether the user can permanently bulk delete. + */ + public function forceDeleteAny(User $user): bool + { + return $user->can('force_delete_any_sub::kriteria'); + } + + /** + * Determine whether the user can restore. + */ + public function restore(User $user, SubKriteria $subKriteria): bool + { + return $user->can('restore_sub::kriteria'); + } + + /** + * Determine whether the user can bulk restore. + */ + public function restoreAny(User $user): bool + { + return $user->can('restore_any_sub::kriteria'); + } + + /** + * Determine whether the user can replicate. + */ + public function replicate(User $user, SubKriteria $subKriteria): bool + { + return $user->can('replicate_sub::kriteria'); + } + + /** + * Determine whether the user can reorder. + */ + public function reorder(User $user): bool + { + return $user->can('reorder_sub::kriteria'); + } +} diff --git a/app/Policies/parameterPolicy.php b/app/Policies/parameterPolicy.php new file mode 100644 index 00000000..c3ced267 --- /dev/null +++ b/app/Policies/parameterPolicy.php @@ -0,0 +1,116 @@ +can('view_any_pengumuman'); + } + + /** + * Determine whether the user can view the model. + */ + public function view(User $user, Parameter $parameter): bool + { + return $user->can('view_pengumuman'); + } + + /** + * Determine whether the user can create models. + */ + public function create(User $user): bool + { + return $user->can('create_pengumuman'); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Parameter $parameter): bool + { + return $user->can('update_pengumuman'); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, Parameter $parameter): bool + { + return $user->can('delete_pengumuman'); + } + + /** + * Determine whether the user can bulk delete. + */ + public function deleteAny(User $user): bool + { + return $user->can('delete_any_pengumuman'); + } + + /** + * Determine whether the user can permanently delete. + */ + public function forceDelete(User $user, Parameter $parameter): bool + { + return $user->can('force_delete_pengumuman'); + } + + /** + * Determine whether the user can permanently bulk delete. + */ + public function forceDeleteAny(User $user): bool + { + return $user->can('force_delete_any_pengumuman'); + } + + /** + * Determine whether the user can restore. + */ + public function restore(User $user, Parameter $parameter): bool + { + return $user->can('restore_pengumuman'); + } + + /** + * Determine whether the user can bulk restore. + */ + public function restoreAny(User $user): bool + { + return $user->can('restore_any_pengumuman'); + } + + /** + * Determine whether the user can replicate. + */ + public function replicate(User $user, Parameter $parameter): bool + { + return $user->can('replicate_pengumuman'); + } + + /** + * Determine whether the user can reorder. + */ + public function reorder(User $user): bool + { + return $user->can('reorder_pengumuman'); + } + + public function show() + { + $pengumuman = Parameter::where('mahasiswa_id', auth()->user()->mahasiswa->id) + ->first(); + + return view('pengumuman', compact('pengumuman')); + } +} diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index a1a3bd9b..3aa8dad3 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -20,6 +20,7 @@ use Illuminate\View\Middleware\ShareErrorsFromSession; use App\Filament\Pages\WizardForm; use App\Filament\Widgets\CustomAccountWidget; +use App\Filament\Pages\Auth\Register; class AdminPanelProvider extends PanelProvider { @@ -30,6 +31,7 @@ public function panel(Panel $panel): Panel ->id('admin') ->path('admin') ->login() + ->registration(Register::class) ->plugin(FilamentShieldPlugin::make()) ->brandLogo(asset('images/logo-polije.png')) ->brandLogoHeight('3rem') diff --git a/resources/views/filament/pages/beranda.blade.php b/resources/views/filament/pages/beranda.blade.php new file mode 100644 index 00000000..55df346f --- /dev/null +++ b/resources/views/filament/pages/beranda.blade.php @@ -0,0 +1,21 @@ + +
+
+

Selamat Datang di Sistem KIP-K

+

+ Sistem ini digunakan untuk pendaftaran dan pengelolaan Kartu Indonesia Pintar Kuliah (KIP-K). + Silakan gunakan menu navigasi di sebelah kiri untuk mengakses fitur-fitur yang tersedia. +

+
+ +
+

Informasi Penting

+
    +
  • Pastikan data diri Anda sudah lengkap dan valid
  • +
  • Lengkapi semua berkas yang diperlukan sesuai dengan persyaratan
  • +
  • Periksa status pengajuan Anda secara berkala
  • +
  • Jika ada kendala, silakan hubungi admin
  • +
+
+
+
\ No newline at end of file diff --git a/resources/views/filament/pages/form.blade.php b/resources/views/filament/pages/form.blade.php new file mode 100644 index 00000000..4e98b55c --- /dev/null +++ b/resources/views/filament/pages/form.blade.php @@ -0,0 +1,12 @@ + +
+
+

Form Pendaftaran KIP-K

+

+ Silakan lengkapi form pendaftaran berikut untuk mengajukan KIP-K. Pastikan semua data yang Anda masukkan valid dan lengkap. +

+ + +
+
+
\ No newline at end of file diff --git a/resources/views/filament/pages/pengumuman.blade.php b/resources/views/filament/pages/pengumuman.blade.php new file mode 100644 index 00000000..789263b7 --- /dev/null +++ b/resources/views/filament/pages/pengumuman.blade.php @@ -0,0 +1,12 @@ + +
+
+

Pengumuman Hasil Seleksi KIP-K

+

+ Berikut adalah status pengajuan dan hasil seleksi KIP-K Anda. Silakan periksa secara berkala untuk mendapatkan informasi terbaru. +

+ + {{ $this->table }} +
+
+
\ No newline at end of file