From d3b9cc3425becc61066d51722d8084ca4ce41dfc Mon Sep 17 00:00:00 2001 From: JokoPrasetio Date: Thu, 11 Jun 2026 11:53:45 +0700 Subject: [PATCH] add detail data path akreditasi --- app/Http/Controllers/DashboardController.php | 51 ++++++++ .../views/dataAkreditasi/index.blade.php | 116 +++++++++++++++++- routes/web.php | 1 + 3 files changed, 167 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index b81cdbe..f1a3e6e 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -2833,6 +2833,57 @@ class DashboardController extends Controller ]); } + public function dataAkreditasiRecap() + { + $rows = FileDirectory::query() + ->select(['file']) + ->where('statusenabled', true) + ->where('status_action', 'approved') + ->where('is_akre', true) + ->get(); + + $folderCounts = []; + $totalFiles = 0; + + foreach ($rows as $row) { + $filePath = trim((string) ($row->file ?? '')); + if ($filePath === '' || !str_contains($filePath, '/')) { + continue; + } + + $folderPath = preg_replace('~/[^/]+$~', '', $filePath); + $folderPath = trim((string) $folderPath, '/'); + if ($folderPath === '') { + continue; + } + + $folderCounts[$folderPath] = ($folderCounts[$folderPath] ?? 0) + 1; + $totalFiles++; + } + + $detailRows = collect($folderCounts) + ->map(fn ($count, $path) => [ + 'path' => $path, + 'total' => $count, + ]) + ->sortBy([ + ['total', 'desc'], + ['path', 'asc'], + ]) + ->values() + ->all(); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil mendapatkan rekap akreditasi', + 'summary' => [ + 'total_files' => $totalFiles, + 'total_folders' => count($folderCounts), + ], + 'data' => $detailRows, + ]); + } + public function expDokumen(){ $katDok = MasterKategori::where('statusenabled', true)->select('master_kategori_directory_id', 'nama_kategori_directory')->get(); $authMapping = auth()->user()?->dataUser?->mappingUnitKerjaPegawai[0]; diff --git a/resources/views/dataAkreditasi/index.blade.php b/resources/views/dataAkreditasi/index.blade.php index 7d2fb0f..1048bc0 100644 --- a/resources/views/dataAkreditasi/index.blade.php +++ b/resources/views/dataAkreditasi/index.blade.php @@ -305,6 +305,19 @@ .akre-selection-status { color: #7b8aa0; } + .akre-recap-bar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 10px 12px; + border-top: 1px solid #edf2f7; + color: #64748b; + font-size: 12px; + } + .akre-recap-bar strong { + color: #1e293b; + } .akre-parent-chip { display: inline-flex; align-items: center; @@ -397,7 +410,7 @@
-
Struktur Akreditasi
+
Struktur Dokumen

Pilih folder di kiri untuk memfilter dokumen di panel kanan.

@@ -489,6 +502,12 @@
Pilih folder pada struktur kiri untuk melihat isinya.
+
+ Memuat ringkasan dokumen akreditasi... + +
@@ -542,6 +561,35 @@ @endif + +