diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php new file mode 100644 index 0000000..6b2a0c0 --- /dev/null +++ b/app/Http/Controllers/PenilaiController.php @@ -0,0 +1,135 @@ +find($id); + + return view('lpj::penilai.show', compact('permohonan')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + return view('lpj::edit'); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + // + } + + public function dataForDatatables(Request $request) + { + if (is_null($this->user) || !$this->user->can('penilai.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + $query = Permohonan::query()->where('status', '=', 'done'); + + // Apply search filter if provided + if ($request->has('search') && !empty($request->get('search'))) { + $search = $request->get('search'); + $query->where(function ($q) use ($search) { + $q->where('nomor_registrasi', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('jenisfasilitasKredit', 'name', 'LIKE', '%' . $search . '%'); + }); + } + + // Apply sorting if provided + if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) { + $order = $request->get('sortOrder'); + $column = $request->get('sortField'); + $query->orderBy($column, $order); + } + + // Get the total count of records + $totalRecords = $query->count(); + + // Apply pagination if provided + if ($request->has('page') && $request->has('size')) { + $page = $request->get('page'); + $size = $request->get('size'); + $offset = ($page - 1) * $size; // Calculate the offset + + $query->skip($offset)->take($size); + } + + // Get the filtered count of records + $filteredRecords = $query->count(); + + // Get the data for the current page + $data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisfasilitasKredit'])->get(); + + // Calculate the page count + $pageCount = ceil($totalRecords / $request->get('size')); + + // Calculate the current page number + $currentPage = 0 + 1; + + // Return the response data as a JSON object + return response()->json([ + 'draw' => $request->get('draw'), + 'recordsTotal' => $totalRecords, + 'recordsFiltered' => $filteredRecords, + 'pageCount' => $pageCount, + 'page' => $currentPage, + 'totalCount' => $totalRecords, + 'data' => $data, + ]); + } +} diff --git a/app/Http/Controllers/SLAController.php b/app/Http/Controllers/SLAController.php new file mode 100644 index 0000000..f411dc4 --- /dev/null +++ b/app/Http/Controllers/SLAController.php @@ -0,0 +1,65 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sla'); + } +}; diff --git a/module.json b/module.json index 6ab8ec6..f8cc66a 100644 --- a/module.json +++ b/module.json @@ -6,9 +6,7 @@ "keywords": [], "priority": 0, "providers": ["Modules\\Lpj\\Providers\\LpjServiceProvider"], - "files": [ - "app/Helpers/Lpj.php" - ], + "files": ["app/Helpers/Lpj.php"], "menu": { "main": [ { @@ -184,7 +182,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["ssenior-officero"] + "roles": ["senior-officer"] } ] }, @@ -205,7 +203,13 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin","surveyor"] + "roles": [ + "administrator", + "pemohon-ao", + "pemohon-eo", + "admin", + "surveyor" + ] }, { "title": "Laporan", @@ -214,7 +218,22 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "senior-officer"] + "roles": [ + "administrator", + "pemohon-ao", + "pemohon-eo", + "admin", + "senior-officer" + ] + }, + { + "title": "Penilai", + "path": "penilai", + "icon": "ki-filled ki-brush text-lg", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] } ], "master": [ @@ -225,7 +244,13 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "surveyor"], + "roles": [ + "administrator", + "pemohon-ao", + "pemohon-eo", + "admin", + "surveyor" + ], "sub": [ { "title": "Cabang", @@ -379,6 +404,14 @@ "permission": "", "roles": ["administrator", "admin"] }, + { + "title": "SLA", + "path": "basicdata.sla", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["administrator", "admin"] + }, { "title": "Bentuk Tanah", "path": "basicdata.bentuk-tanah", @@ -386,73 +419,72 @@ "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Kontur Tanah", "path": "basicdata.kontur-tanah", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Posisi Kavling", "path": "basicdata.posisi-kavling", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Ketinggian Tanah", "path": "basicdata.ketinggian-tanah", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Kondisi Fisik Tanah", "path": "basicdata.kondisi-fisik-tanah", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Jenis Bangunan", "path": "basicdata.jenis-bangunan", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Kondisi Bangunan", "path": "basicdata.kondisi-bangunan", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, - { + }, + { "title": "Sifat Bangunan", "path": "basicdata.sifat-bangunan", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - }, + }, - { + { "title": "Sarana Pelengkap", "path": "basicdata.sarana-pelengkap", "classes": "", "attributes": [], "permission": "", "roles": ["surveyor"] - } - + } ] } ], diff --git a/resources/views/SLA/index.blade.php b/resources/views/SLA/index.blade.php new file mode 100644 index 0000000..8fc628d --- /dev/null +++ b/resources/views/SLA/index.blade.php @@ -0,0 +1,8 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{ Breadcrumbs::render('sla') }} +@endsection + +@section('content') +@endsection diff --git a/resources/views/penilai/index.blade.php b/resources/views/penilai/index.blade.php new file mode 100644 index 0000000..196b6c3 --- /dev/null +++ b/resources/views/penilai/index.blade.php @@ -0,0 +1,200 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{ Breadcrumbs::render('penilai') }} +@endsection + +@section('content') +
| + + | ++ Nomor Registrasi + + | ++ Debitur + + | ++ Pemohon(Cabang/Direktorat) + + | ++ AO + + | ++ Tujuan Penilaian + + | ++ Fasilitas Kredit + + | ++ Tanggal Survei + + | ++ Due Date SLA + + | +Action | +
|---|
{{ $permohonan->nomor_registrasi }}
+{{ $permohonan->debiture->name }}
+{{ $permohonan->branch->name }}
+{{ $permohonan->debiture->address }}, Kel. + {{ $permohonan->debiture->village->name }}, Kec. {{ $permohonan->debiture->district->name }}, + {{ ucwords(strtolower($permohonan->debiture->city->name)) }}, Kode Pos. + {{ $permohonan->debiture->postal_code }}
+{{ $permohonan->user->name }}
++ {{ $permohonan->jenisFasilitasKredit->name }}
++ {{ formatTanggalIndonesia($permohonan->created_at) }}
++ {{ $permohonan->debiture->cif }}
++ {{ formatTanggalIndonesia($permohonan->created_at) }}
++ {{ $permohonan->penilaian->userSurveyor->name }}
++ Region 1
++ @foreach ($permohonan->penilaian->teams->teamsUsers as $index => $penilaian) + {{ $penilaian->user->name }}{{ $index + 1 < count($permohonan->penilaian->teams->teamsUsers) ? ', ' : '' }} + @endforeach +
++ {{ $permohonan->penilaian->teams->regions->name }} +
++ {{ $permohonan->tujuanPenilaian->name }}
+ ++ @foreach ($permohonan->debiture->documents as $document) + {{ $document->jenisjaminan->name }} + @endforeach +
++ {{ formatTanggalIndonesia($permohonan->created_at) }}
++ {{ formatTanggalIndonesia($permohonan->created_at) }}
++ PJ/001/001
+