diff --git a/app/Exports/DebitureExport.php b/app/Exports/DebitureExport.php index 37cbc8c..83bea98 100644 --- a/app/Exports/DebitureExport.php +++ b/app/Exports/DebitureExport.php @@ -21,7 +21,7 @@ { return [ $row->id, - $row->branch->name . + $row->branch->name, $row->cif, $row->nomor_rekening, $row->name, diff --git a/app/Exports/PermohonanExport.php b/app/Exports/PermohonanExport.php new file mode 100644 index 0000000..07b83fe --- /dev/null +++ b/app/Exports/PermohonanExport.php @@ -0,0 +1,67 @@ +id, + $row->nomor_registrasi, + $row->tanggal_permohonan, + $row->user->name, + $row->branch->name, + $row->tujuanPenilaian->name, + $row->debiture->name, + $row->status, + $row->authorized_at, + $row->authorized_status, + $row->authorized_by, + $row->created_at + ]; + } + + public function headings() + : array + { + return [ + 'ID', + 'Nomor Registrasi', + 'Tanggal Permohonan', + 'User Pemohon', + 'Branch Pemohon', + 'Tujuan Penilaian', + 'Debitur', + 'Status', + 'Tanggal Pengesahan', + 'Status Pengesahan', + 'Pengesah', + 'Tanggal Dibuat' + ]; + } + + public function columnFormats() + : array + { + return [ + 'A' => NumberFormat::FORMAT_NUMBER, + 'C' => NumberFormat::FORMAT_DATE_DATETIME, + 'L' => NumberFormat::FORMAT_DATE_DATETIME + ]; + } + } diff --git a/app/Exports/StatusPermohonanExport.php b/app/Exports/StatusPermohonanExport.php new file mode 100644 index 0000000..7255ab5 --- /dev/null +++ b/app/Exports/StatusPermohonanExport.php @@ -0,0 +1,53 @@ +id, + $row->name, + $row->slug, + $row->description, + $row->status, + $row->created_at + ]; + } + + public function headings() + : array + { + return [ + 'ID', + 'Name', + 'Slug', + 'Description', + 'Status', + 'Created At' + ]; + } + + public function columnFormats() + : array + { + return [ + 'A' => NumberFormat::FORMAT_NUMBER, + 'F' => NumberFormat::FORMAT_DATE_DATETIME + ]; + } + } diff --git a/app/Http/Controllers/DokumenJaminanController.php b/app/Http/Controllers/DokumenJaminanController.php index ddceb55..1907fbf 100644 --- a/app/Http/Controllers/DokumenJaminanController.php +++ b/app/Http/Controllers/DokumenJaminanController.php @@ -54,10 +54,11 @@ 'address' => $debitur->address, ]; - $pemilikJaminan = PemilikJaminan::updateOrCreate([ + $pemilikJaminan = PemilikJaminan::updateOrCreate([ 'debiture_id' => $id, 'name' => $debitur->name, ], $pemilik_jaminan); + $validate['pemilik_jaminan_id'] = $pemilikJaminan->id; } if ($request->hasFile('dokumen_jaminan')) { @@ -67,14 +68,15 @@ $validate['dokumen_jaminan'] = 'jaminan/' . $debitur->id . '/' . $file_name; } - $validate['pemilik_jaminan_id'] = $pemilikJaminan->id; + DokumenJaminan::create($validate); - - return redirect()->route('debitur.jaminan.index', $id); + return redirect()->route('debitur.jaminan.index', $id)->with( + 'success', + 'Dokumen Jaminan berhasil ditambahkan', + ); } catch (Exception $e) { - print_r($e->getMessage()); - exit; + return redirect()->route('debitur.jaminan.index', $id)->with('error', $e->getMessage()); } } } @@ -85,10 +87,11 @@ $provinces = Province::all(); $jenisJaminan = JenisJaminan::all(); $jenisLegalitasJaminan = JenisLegalitasJaminan::all(); + $pemilikJaminan = PemilikJaminan::where('debiture_id', $id)->get(); return view( 'lpj::debitur.jaminan', - compact('debitur', 'provinces', 'jenisJaminan', 'jenisLegalitasJaminan'), + compact('debitur', 'provinces', 'jenisJaminan', 'jenisLegalitasJaminan', 'pemilikJaminan'), ); } @@ -131,11 +134,12 @@ $document = DokumenJaminan::find($jaminan); $document->update($validate); - - return redirect()->route('debitur.jaminan.index', $id); + return redirect()->route('debitur.jaminan.index', $id)->with( + 'success', + 'Dokumen Jaminan berhasil diubah', + ); } catch (Exception $e) { - print_r($e->getMessage()); - exit; + return redirect()->route('debitur.jaminan.index', $id)->with('error', $e->getMessage()); } } } @@ -150,7 +154,7 @@ $villages = Village::where('district_code', $document->district_code)->get(); $jenisJaminan = JenisJaminan::all(); $jenisLegalitasJaminan = JenisLegalitasJaminan::all(); - $pemilikJaminan = PemilikJaminan::all(); + $pemilikJaminan = PemilikJaminan::where('debiture_id', $document->debiture_id)->get(); return view( 'lpj::debitur.jaminan', diff --git a/app/Http/Controllers/PemilikJaminanController.php b/app/Http/Controllers/PemilikJaminanController.php index 63a0724..7c38601 100644 --- a/app/Http/Controllers/PemilikJaminanController.php +++ b/app/Http/Controllers/PemilikJaminanController.php @@ -38,10 +38,12 @@ try { PemilikJaminan::create($validate); - return redirect()->route('debitur.pemilik.index', $id); + if($request->get('from') == 'create-document'){ + return redirect()->route('debitur.document.create', $id)->with('success', 'Pemilik Jaminan berhasil ditambahkan'); + } + return redirect()->route('debitur.pemilik.index', $id)->with('success', 'Pemilik Jaminan berhasil ditambahkan'); } catch (Exception $e) { - print_r($e->getMessage()); - exit; + return redirect()->route('debitur.pemilik.index', $id)->with('error', $e->getMessage()); } } } @@ -66,10 +68,13 @@ $pemilik = PemilikJaminan::find($pemilik); $pemilik->update($validate); - return redirect()->route('debitur.pemilik.index', $id); + if($request->get('from') == 'update-document'){ + return redirect()->route('debitur.document.edit', [$id, $request->document])->with('success', 'Pemilik Jaminan berhasil diubah'); + } + + return redirect()->route('debitur.pemilik.index', $id)->with('success', 'Pemilik Jaminan berhasil diubah'); } catch (Exception $e) { - print_r($e->getMessage()); - exit; + return redirect()->route('debitur.pemilik.index', $id)->with('error',$e->getMessage()); } } } diff --git a/app/Http/Controllers/PermohonanController.php b/app/Http/Controllers/PermohonanController.php new file mode 100644 index 0000000..d45c873 --- /dev/null +++ b/app/Http/Controllers/PermohonanController.php @@ -0,0 +1,201 @@ +validated(); + + if ($validate) { + try { + // Save to database + Permohonan::create($validate); + return redirect() + ->route('permohonan.index') + ->with('success', 'Permohonan created successfully'); + } catch (Exception $e) { + return redirect() + ->route('permohonan.create') + ->with('error', 'Failed to create permohonan'. $e->getMessage()); + } + } else { + return redirect() + ->route('permohonan.create') + ->with('success', 'error naon iye') + ->withInput(); + } + } + + public function create() + { + $branches = Branch::all(); + $debitures = Debiture::all(); + $tujuanPenilaian = TujuanPenilaian::all(); + $status = [ + 'order' => 'Order', + 'revisi' => 'Revisi', + 'register' => 'Register', + 'assign' => 'Assign', + 'survey' => 'Survey', + 'finalisasi' => 'Proses Laporan', + 'approved' => 'Diterima', + 'rejected' => 'Ditolak', + 'cancel' => 'Dibatalkan', + 'finished' => 'Selesai', + 'not_started' => 'Belum dimulai', + ]; + + return view('lpj::permohonan.form', compact('branches', 'debitures', 'tujuanPenilaian','status')); + } + + public function edit($id) + { + $permohonan = Permohonan::find($id); + $branches = Branch::all(); + $debitures = Debiture::all(); + $tujuanPenilaian = TujuanPenilaian::all(); + $status = [ + 'order' => 'Order', + 'revisi' => 'Revisi', + 'register' => 'Register', + 'assign' => 'Assign', + 'survey' => 'Survey', + 'finalisasi' => 'Proses Laporan', + 'approved' => 'Diterima', + 'rejected' => 'Ditolak', + 'cancel' => 'Dibatalkan', + 'finished' => 'Selesai', + 'not_started' => 'Belum dimulai', + ]; + + return view( + 'lpj::permohonan.form', + compact('permohonan', 'branches', 'debitures', 'tujuanPenilaian','status'), + ); + } + + public function update(PermohonanRequest $request, $id) + { + $validate = $request->validated(); + + if ($validate) { + try { + // Update in database + $permohonan = Permohonan::find($id); + $permohonan->update($validate); + return redirect() + ->route('permohonan.index') + ->with('success', 'Permohonan updated successfully'); + } catch (Exception $e) { + return redirect() + ->route('permohonan.edit', $id) + ->with('error', 'Failed to update permohonan'); + } + } + } + + public function destroy($id) + { + try { + // Delete from database + $permohonan = Permohonan::find($id); + $permohonan->delete(); + + echo json_encode(['success' => true, 'message' => 'Permohonan deleted successfully']); + } catch (Exception $e) { + echo json_encode(['success' => false, 'message' => 'Failed to delete permohonan']); + } + } + + public function dataForDatatables(Request $request) + { + if (is_null($this->user) || !$this->user->can('debitur.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + $query = Permohonan::query(); + + // 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->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%'); + $q->orWhere('status', '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'])->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, + ]); + } + + public function export() + { + return Excel::download(new PermohonanExport, 'permohonan.xlsx'); + } + } diff --git a/app/Http/Controllers/StatusPermohonanController.php b/app/Http/Controllers/StatusPermohonanController.php new file mode 100644 index 0000000..afcb128 --- /dev/null +++ b/app/Http/Controllers/StatusPermohonanController.php @@ -0,0 +1,150 @@ +validated(); + + if ($validate) { + try { + // Save to database + StatusPermohonan::create($validate); + return redirect() + ->route('basicdata.status-permohonan.index') + ->with('success', 'Status Permohonan created successfully'); + } catch (Exception $e) { + return redirect() + ->route('basicdata.status-permohonan.create') + ->with('error', 'Failed to create status permohonan'); + } + } + } + + public function create() + { + return view('lpj::status_permohonan.form'); + } + + public function edit($id) + { + $statusPermohonan = StatusPermohonan::find($id); + return view('lpj::status_permohonan.form', compact('statusPermohonan')); + } + + public function update(StatusPermohonanRequest $request, $id) + { + $validate = $request->validated(); + + if ($validate) { + try { + // Update in database + $statusPermohonan = StatusPermohonan::find($id); + $statusPermohonan->update($validate); + return redirect() + ->route('basicdata.status-permohonan.index') + ->with('success', 'Status Permohonan updated successfully'); + } catch (Exception $e) { + return redirect() + ->route('basicdata.status-permohonan.edit', $id) + ->with('error', 'Failed to update status permohonan'); + } + } + } + + public function destroy($id) + { + try { + // Delete from database + $statusPermohonan = StatusPermohonan::find($id); + $statusPermohonan->delete(); + + echo json_encode(['success' => true, 'message' => 'Status Permohonan deleted successfully']); + } catch (Exception $e) { + echo json_encode(['success' => false, 'message' => 'Failed to delete status permohonan']); + } + } + + public function dataForDatatables(Request $request) + { + if (is_null($this->user) || !$this->user->can('status_permohonan.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + $query = StatusPermohonan::query(); + + // 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('name', 'LIKE', "%$search%"); + $q->orWhere('description', '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->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, + ]); + } + + public function export() + { + return Excel::download(new StatusPermohonanExport, 'status_permohonan.xlsx'); + } + } diff --git a/app/Http/Requests/DokumenJaminanRequest.php b/app/Http/Requests/DokumenJaminanRequest.php index 427b732..4cb22ce 100644 --- a/app/Http/Requests/DokumenJaminanRequest.php +++ b/app/Http/Requests/DokumenJaminanRequest.php @@ -13,7 +13,7 @@ : array { $rules = [ - 'debiture_id' => 'required|exists:debtures,id', + 'debiture_id' => 'required|exists:debitures,id', 'pemilik_jaminan_id' => 'required', 'jenis_jaminan_id' => 'required', 'jenis_legalitas_jaminan_id' => 'required', diff --git a/app/Http/Requests/PermohonanRequest.php b/app/Http/Requests/PermohonanRequest.php new file mode 100644 index 0000000..5a576dd --- /dev/null +++ b/app/Http/Requests/PermohonanRequest.php @@ -0,0 +1,50 @@ + 'nullable|string|max:10', + 'tanggal_permohonan' => 'nullable|date', + 'user_id' => 'nullable|exists:users,id', + 'branch_id' => 'required|exists:branches,id', + 'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id', + 'debiture_id' => 'required|exists:debitures,id', + 'status' => 'required|string', + ]; + + return $rules; + } + + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } + + public function prepareForValidation() + { + if (!$this->id) { + $this->merge([ + 'nomor_registrasi' => IdGenerator::generate( + ['table' => 'permohonan', 'length' => 10, 'prefix'=>'REG', 'field' => 'nomor_registrasi'], + ), + 'tanggal_permohonan' => date('Y-m-d'), + 'user_id' => auth()->user()->id, + ]); + } + } + } diff --git a/app/Http/Requests/StatusPermohonanRequest.php b/app/Http/Requests/StatusPermohonanRequest.php new file mode 100644 index 0000000..21bd8e5 --- /dev/null +++ b/app/Http/Requests/StatusPermohonanRequest.php @@ -0,0 +1,45 @@ + 'nullable|max:255', + 'status' => 'required|boolean', + ]; + + if ($this->method() == 'PUT') { + $rules['name'] = 'required|max:50|unique:status_permohonan,name,' . $this->id; + } else { + $rules['name'] = 'required|max:50|unique:status_permohonan,name'; + } + return $rules; + } + + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } + + public function prepareForValidation() + { + $this->merge([ + 'status' => isset($this->status) ? 1 : 0, + 'slug'=> Str::slug($this->name) + ]); + } + } diff --git a/app/Models/DokumenJaminan.php b/app/Models/DokumenJaminan.php index 8c5b944..83886f6 100644 --- a/app/Models/DokumenJaminan.php +++ b/app/Models/DokumenJaminan.php @@ -13,6 +13,7 @@ protected $table = 'dokumen_jaminan'; protected $fillable = [ 'debiture_id', + 'permohonan_id', 'pemilik_jaminan_id', 'jenis_jaminan_id', 'jenis_legalitas_jaminan_id', @@ -66,4 +67,8 @@ public function jenisLegalitasJaminan(){ return $this->belongsTo(JenisLegalitasJaminan::class, 'jenis_legalitas_jaminan_id', 'id'); } + + public function permohonan(){ + return $this->belongsTo(Permohonan::class, 'permohonan_id', 'id'); + } } diff --git a/app/Models/Permohonan.php b/app/Models/Permohonan.php new file mode 100644 index 0000000..28b6de5 --- /dev/null +++ b/app/Models/Permohonan.php @@ -0,0 +1,45 @@ +belongsTo(User::class); + } + + public function branch(){ + return $this->belongsTo(Branch::class); + } + + public function tujuanPenilaian(){ + return $this->belongsTo(TujuanPenilaian::class); + } + + public function debiture(){ + return $this->belongsTo(Debiture::class); + } + + public function documents(){ + return $this->hasMany(DokumenJaminan::class); + } +} diff --git a/app/Models/StatusPermohonan.php b/app/Models/StatusPermohonan.php new file mode 100644 index 0000000..093b78b --- /dev/null +++ b/app/Models/StatusPermohonan.php @@ -0,0 +1,9 @@ +id(); $table->string('name'); $table->foreignIdFor(Debiture::class)->constrained('debitures')->onDelete('cascade'); + $table->foreignIdFor(Permohonan::class)->nullable()->constrained('permohonan')->onDelete('cascade'); $table->foreignIdFor(JenisJaminan::class)->constrained('jenis_jaminan')->onDelete('cascade'); $table->foreignIdFor(PemilikJaminan::class)->constrained('pemilik_jaminan')->onDelete('cascade'); $table->foreignIdFor(JenisLegalitasJaminan::class)->constrained('jenis_legalitas_jaminan')->onDelete('cascade'); diff --git a/database/migrations/2024_08_22_080122_create_permohonan_table.php b/database/migrations/2024_08_22_080122_create_permohonan_table.php new file mode 100644 index 0000000..c31814f --- /dev/null +++ b/database/migrations/2024_08_22_080122_create_permohonan_table.php @@ -0,0 +1,46 @@ +id(); + $table->string('nomor_registrasi')->unique(); + $table->date('tanggal_permohonan'); + $table->foreignIdFor(User::class)->constrained(); + $table->foreignIdFor(Branch::class)->constrained(); + $table->foreignIdFor(TujuanPenilaian::class)->constrained('tujuan_penilaian')->onDelete('cascade'); + $table->foreignIdFor(Debiture::class)->constrained('debitures')->onDelete('cascade'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); + + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('permohonan'); + } +}; diff --git a/database/migrations/2024_08_24_082504_create_status_permohonan_table.php b/database/migrations/2024_08_24_082504_create_status_permohonan_table.php new file mode 100644 index 0000000..b1404d1 --- /dev/null +++ b/database/migrations/2024_08_24_082504_create_status_permohonan_table.php @@ -0,0 +1,39 @@ +id(); + $table->string('name')->unique(); + $table->string('slug')->nullable(); + $table->string('description')->nullable(); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); + + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('status_permohonan'); + } +}; diff --git a/module.json b/module.json index a534cd2..a3feab5 100644 --- a/module.json +++ b/module.json @@ -13,7 +13,7 @@ "main": [ { "title": "Permohonan", - "path": "", + "path": "permohonan", "icon": "ki-filled ki-questionnaire-tablet text-lg", "classes": "", "attributes": [], @@ -174,6 +174,14 @@ "attributes": [], "permission": "", "roles": [] + }, + { + "title": "Status Permohonan", + "path": "basicdata.status-permohonan", + "classes": "", + "attributes": [], + "permission": "", + "roles": [] } ] } diff --git a/resources/views/debitur/components/dokumen.blade.php b/resources/views/debitur/components/dokumen.blade.php index 0361015..91b2827 100644 --- a/resources/views/debitur/components/dokumen.blade.php +++ b/resources/views/debitur/components/dokumen.blade.php @@ -36,9 +36,15 @@ @endforeach @endif - - Tambah Pemilik Jaminan - + @if(isset($document->id)) + + Tambah Pemilik Jaminan + + @else + + Tambah Pemilik Jaminan + + @endif @error('pemilik_jaminan_id') {{ $message }} diff --git a/resources/views/debitur/index.blade.php b/resources/views/debitur/index.blade.php index 8b0b357..a36b711 100644 --- a/resources/views/debitur/index.blade.php +++ b/resources/views/debitur/index.blade.php @@ -92,6 +92,9 @@ @push('scripts') + + +@endpush diff --git a/resources/views/status_permohonan/form.blade.php b/resources/views/status_permohonan/form.blade.php new file mode 100644 index 0000000..a216493 --- /dev/null +++ b/resources/views/status_permohonan/form.blade.php @@ -0,0 +1,71 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{ Breadcrumbs::render(request()->route()->getName()) }} +@endsection + +@section('content') +
+
+ @if(isset($statusPermohonan->id)) + @method('PUT') + + @endif + @csrf +
+
+

+ {{ isset($statusPermohonan->id) ? 'Edit' : 'Tambah' }} Status Permohonan +

+
+ Back +
+
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('description') + {{ $message }} + @enderror +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+
+@endsection diff --git a/resources/views/status_permohonan/index.blade.php b/resources/views/status_permohonan/index.blade.php new file mode 100644 index 0000000..d684445 --- /dev/null +++ b/resources/views/status_permohonan/index.blade.php @@ -0,0 +1,162 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{ Breadcrumbs::render('basicdata.status-permohonan') }} +@endsection + +@section('content') +
+
+
+

+ Daftar Status Permohonan +

+ +
+
+
+ + + + + + + + + + + +
+ + + Code + + + Status Permohonan + + + Deskripsi + + + Status + + Action
+
+ +
+
+
+@endsection + +@push('scripts') + + + +@endpush + diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 980dc6f..162cfff 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -188,6 +188,21 @@ $trail->push('Edit Arah Mata Angin'); }); + Breadcrumbs::for('basicdata.status-permohonan', function (BreadcrumbTrail $trail) { + $trail->parent('basicdata'); + $trail->push('Status Permohonan', route('basicdata.status-permohonan.index')); + }); + + Breadcrumbs::for('basicdata.status-permohonan.create', function (BreadcrumbTrail $trail) { + $trail->parent('basicdata.status-permohonan'); + $trail->push('Tambah Status Permohonan', route('basicdata.status-permohonan.create')); + }); + + Breadcrumbs::for('basicdata.status-permohonan.edit', function (BreadcrumbTrail $trail) { + $trail->parent('basicdata.status-permohonan'); + $trail->push('Edit Status Permohonan'); + }); + Breadcrumbs::for('debitur', function (BreadcrumbTrail $trail) { $trail->push('Debitur', route('debitur.index')); }); @@ -239,3 +254,17 @@ }); // andy add + Breadcrumbs::for('permohonan.index', function (BreadcrumbTrail $trail) { + $trail->push('Permohonan', route('permohonan.index')); + }); + + Breadcrumbs::for('permohonan.create', function (BreadcrumbTrail $trail) { + $trail->parent('permohonan.index'); + $trail->push('Tambah Permohonan', route('permohonan.create')); + }); + + Breadcrumbs::for('permohonan.edit', function (BreadcrumbTrail $trail) { + $trail->parent('permohonan.index'); + $trail->push('Data Permohonan'); + }); + diff --git a/routes/web.php b/routes/web.php index ba38e3e..86c6f6e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,6 +15,8 @@ use Modules\Lpj\Http\Controllers\JenisLegalitasJaminanController; use Modules\Lpj\Http\Controllers\NilaiPlafondController; use Modules\Lpj\Http\Controllers\PemilikJaminanController; + use Modules\Lpj\Http\Controllers\PermohonanController; + use Modules\Lpj\Http\Controllers\StatusPermohonanController; use Modules\Lpj\Http\Controllers\TujuanPenilaianController; use Modules\Lpj\Http\Controllers\AuthorizationController; @@ -148,8 +150,27 @@ Route::get('export', [ArahMataAnginController::class, 'export'])->name('export'); }); Route::resource('arah-mata-angin', ArahMataAnginController::class); + + + Route::name('status-permohonan.')->prefix('status-permohonan')->group(function () { + Route::get('restore/{id}', [StatusPermohonanController::class, 'restore'])->name('restore'); + Route::get('datatables', [StatusPermohonanController::class, 'dataForDatatables']) + ->name('datatables'); + Route::get('export', [StatusPermohonanController::class, 'export'])->name('export'); + }); + Route::resource('status-permohonan', StatusPermohonanController::class); }); + Route::name('permohonan.')->prefix('permohonan')->group(function () { + Route::get('download/{id}', [PermohonanController::class, 'download'])->name('download'); + Route::get('restore/{id}', [PermohonanController::class, 'restore'])->name('restore'); + Route::get('datatables', [PermohonanController::class, 'dataForDatatables']) + ->name('datatables'); + Route::get('export', [PermohonanController::class, 'export'])->name('export'); + }); + + Route::resource('permohonan', PermohonanController::class); + Route::name('debitur.')->prefix('debitur')->group(function () { Route::get('download/{id}', [DebitureController::class, 'download'])->name('download'); Route::get('restore/{id}', [DebitureController::class, 'restore'])->name('restore');