This commit is contained in:
Jokoprasetio 2026-06-11 06:06:01 +07:00
parent 7bbc87d6a7
commit c7544b1868
4 changed files with 915 additions and 431 deletions

View File

@ -15,6 +15,7 @@ use App\Models\UnitKerja;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
@ -2742,16 +2743,34 @@ class DashboardController extends Controller
$katDok = MasterKategori::where('statusenabled', true) $katDok = MasterKategori::where('statusenabled', true)
->select('master_kategori_directory_id', 'nama_kategori_directory') ->select('master_kategori_directory_id', 'nama_kategori_directory')
->get(); ->get();
$akreditasiTree = $this->loadAkreditasiTree();
$data = [ $data = [
'title' => 'Akreditasi', 'title' => 'Akreditasi',
'katDok' => $katDok 'katDok' => $katDok,
'akreditasiTree' => $akreditasiTree,
]; ];
return view('dataAkreditasi.index', $data); return view('dataAkreditasi.index', $data);
} }
private function loadAkreditasiTree(): array
{
$path = public_path('json/akreditasi.jff');
if (!File::exists($path)) {
return [];
}
try {
$decoded = json_decode(File::get($path), true, 512, JSON_THROW_ON_ERROR);
return is_array($decoded) ? $decoded : [];
} catch (\Throwable $th) {
return [];
}
}
public function dataTableAkreditasi(Request $request) public function dataTableAkreditasi(Request $request)
{ {
$keyword = $request->query('keyword'); $keyword = $request->query('keyword');
$folderPath = trim((string) $request->query('folder_path', ''));
$perPage = (int) $request->query('per_page', 10); $perPage = (int) $request->query('per_page', 10);
$perPage = max(1, min(100, $perPage)); $perPage = max(1, min(100, $perPage));
@ -2770,12 +2789,19 @@ class DashboardController extends Controller
->where('status_action', 'approved') ->where('status_action', 'approved')
->where('is_akre', true); ->where('is_akre', true);
// Logic Pencarian // Filter spesifik berdasarkan path folder dari tree/explorer.
// Gunakan prefix match agar "KPS 9.c" tidak ikut mengambil "KPS 9.f".
$query->when($folderPath !== '', function ($q) use ($folderPath) {
$escapedPath = addcslashes($folderPath, '\\%_');
$q->where('file', 'ILIKE', $escapedPath . '/%');
});
// Pencarian nama file/dokumen bisa digabung dengan filter folder.
$query->when($keyword, function ($q) use ($keyword) { $query->when($keyword, function ($q) use ($keyword) {
$q->where(function ($sub) use ($keyword) { $q->where(function ($sub) use ($keyword) {
$sub->where('nama_dokumen', 'ILIKE', "%{$keyword}%") $sub->where('nama_dokumen', 'ILIKE', "%{$keyword}%")
->orWhere('no_dokumen', 'ILIKE', "%{$keyword}%") ->orWhere('no_dokumen', 'ILIKE', "%{$keyword}%")
->orWhere('file', 'ILIKE', "%{$keyword}%"); // Cari juga berdasarkan nama file di path ->orWhere('file', 'ILIKE', "%{$keyword}%");
}); });
}); });
$data = $query $data = $query

78
composer.lock generated
View File

@ -62,16 +62,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.383.2", "version": "3.384.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "11c2de39e4511dc99e44f049c7dfc8087e051867" "reference": "a6c85b3a1f5f8327076291040329214b3a2caf2b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/11c2de39e4511dc99e44f049c7dfc8087e051867", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a6c85b3a1f5f8327076291040329214b3a2caf2b",
"reference": "11c2de39e4511dc99e44f049c7dfc8087e051867", "reference": "a6c85b3a1f5f8327076291040329214b3a2caf2b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -153,9 +153,9 @@
"support": { "support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions", "forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.383.2" "source": "https://github.com/aws/aws-sdk-php/tree/3.384.2"
}, },
"time": "2026-06-01T18:08:21+00:00" "time": "2026-06-03T18:07:33+00:00"
}, },
{ {
"name": "brick/math", "name": "brick/math",
@ -873,25 +873,26 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.10.6", "version": "7.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94" "reference": "c987f8ce84b8434fa430795eca0f3430663da72b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/e7412b3180912c01650cc66647f18c1d1cbe9b94", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c987f8ce84b8434fa430795eca0f3430663da72b",
"reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94", "reference": "c987f8ce84b8434fa430795eca0f3430663da72b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"guzzlehttp/promises": "^2.3", "guzzlehttp/promises": "^2.5",
"guzzlehttp/psr7": "^2.8", "guzzlehttp/psr7": "^2.11",
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0", "psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0" "symfony/deprecation-contracts": "^2.5 || ^3.0",
"symfony/polyfill-php80": "^1.24"
}, },
"provide": { "provide": {
"psr/http-client-implementation": "1.0" "psr/http-client-implementation": "1.0"
@ -980,7 +981,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.10.6" "source": "https://github.com/guzzle/guzzle/tree/7.11.0"
}, },
"funding": [ "funding": [
{ {
@ -996,24 +997,25 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2026-06-01T13:06:22+00:00" "time": "2026-06-02T12:40:51+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "2.4.1", "version": "2.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2" "reference": "4360e982f87f5f258bf872d094647791db2f4c8e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2", "url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e",
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2", "reference": "4360e982f87f5f258bf872d094647791db2f4c8e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0" "php": "^7.2.5 || ^8.0",
"symfony/deprecation-contracts": "^2.5 || ^3.0"
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
@ -1063,7 +1065,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/2.4.1" "source": "https://github.com/guzzle/promises/tree/2.5.0"
}, },
"funding": [ "funding": [
{ {
@ -1079,27 +1081,29 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2026-05-20T22:57:30+00:00" "time": "2026-06-02T12:23:43+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.10.4", "version": "2.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "d2a1a094e396da8957e797489fddaf860c340cfc" "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/d2a1a094e396da8957e797489fddaf860c340cfc", "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f",
"reference": "d2a1a094e396da8957e797489fddaf860c340cfc", "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0", "psr/http-factory": "^1.0",
"psr/http-message": "^1.1 || ^2.0", "psr/http-message": "^1.1 || ^2.0",
"ralouphie/getallheaders": "^3.0" "ralouphie/getallheaders": "^3.0",
"symfony/deprecation-contracts": "^2.5 || ^3.0",
"symfony/polyfill-php80": "^1.24"
}, },
"provide": { "provide": {
"psr/http-factory-implementation": "1.0", "psr/http-factory-implementation": "1.0",
@ -1180,7 +1184,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.10.4" "source": "https://github.com/guzzle/psr7/tree/2.11.0"
}, },
"funding": [ "funding": [
{ {
@ -1196,7 +1200,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2026-05-29T12:59:07+00:00" "time": "2026-06-02T12:30:48+00:00"
}, },
{ {
"name": "guzzlehttp/uri-template", "name": "guzzlehttp/uri-template",
@ -7189,16 +7193,16 @@
}, },
{ {
"name": "laravel/sail", "name": "laravel/sail",
"version": "v1.61.0", "version": "v1.62.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/sail.git", "url": "https://github.com/laravel/sail.git",
"reference": "68ef35015630fe510432e63e11e21749006df688" "reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/68ef35015630fe510432e63e11e21749006df688", "url": "https://api.github.com/repos/laravel/sail/zipball/3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e",
"reference": "68ef35015630fe510432e63e11e21749006df688", "reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7248,7 +7252,7 @@
"issues": "https://github.com/laravel/sail/issues", "issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail" "source": "https://github.com/laravel/sail"
}, },
"time": "2026-05-23T23:33:57+00:00" "time": "2026-05-27T04:02:01+00:00"
}, },
{ {
"name": "mockery/mockery", "name": "mockery/mockery",
@ -9231,12 +9235,12 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {},
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.2" "php": "^8.2"
}, },
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.2.0" "plugin-api-version": "2.9.0"
} }

View File

@ -103,6 +103,188 @@
"name": "TKRS 6.f" "name": "TKRS 6.f"
} }
] ]
},
{
"name": "TKRS 7",
"turunan": [
{
"name": "TKRS 7.a"
},
{
"name": "TKRS 7.b"
},
{
"name": "TKRS 7.c"
},
{
"name": "TKRS 7.d"
},
{
"name": "TKRS 7.e"
},
{
"name": "TKRS 7.f"
}
]
},
{
"name": "TKRS 7.1",
"turunan": [
{
"name": "TKRS 7.1.a"
},
{
"name": "TKRS 7.1.b"
},
{
"name": "TKRS 7.1.c"
},
{
"name": "TKRS 7.1.d"
}
]
},
{
"name": "TKRS 8",
"turunan": [
{
"name": "TKRS 8.a"
},
{
"name": "TKRS 8.b"
},
{
"name": "TKRS 8.c"
}
]
},
{
"name": "TKRS 9",
"turunan": [
{
"name": "TKRS 9.a"
},
{
"name": "TKRS 9.b"
},
{
"name": "TKRS 9.c"
},
{
"name": "TKRS 9.d"
},
{
"name": "TKRS 9.e"
}
]
},
{
"name": "TKRS 10",
"turunan": [
{
"name": "TKRS 10.a"
},
{
"name": "TKRS 10.b"
},
{
"name": "TKRS 10.c"
},
{
"name": "TKRS 10.d"
}
]
},
{
"name": "TKRS 11",
"turunan": [
{
"name": "TKRS 11.a"
},
{
"name": "TKRS 11.b"
},
{
"name": "TKRS 11.c"
}
]
},
{
"name": "TKRS 12",
"turunan": [
{
"name": "TKRS 12.a"
},
{
"name": "TKRS 12.b"
},
{
"name": "TKRS 12.c"
},
{
"name": "TKRS 12.d"
}
]
},
{
"name": "TKRS 13",
"turunan": [
{
"name": "TKRS 13.a"
},
{
"name": "TKRS 13.b"
},
{
"name": "TKRS 13.c"
},
{
"name": "TKRS 13.d"
},
{
"name": "TKRS 13.e"
},
{
"name": "TKRS 13.f"
}
]
},
{
"name": "TKRS 14",
"turunan": [
{
"name": "TKRS 14.a"
},
{
"name": "TKRS 14.b"
}
]
},
{
"name": "TKRS 15",
"turunan": [
{
"name": "TKRS 15.a"
},
{
"name": "TKRS 15.b"
},
{
"name": "TKRS 15.c"
},
{
"name": "TKRS 15.d"
},
{
"name": "TKRS 15.e"
},
{
"name": "TKRS 15.f"
},
{
"name": "TKRS 15.g"
}
]
} }
] ]
}, },

File diff suppressed because it is too large Load Diff