Initial Commit
This commit is contained in:
0
resources/assets/.gitkeep
Normal file
0
resources/assets/.gitkeep
Normal file
35
resources/assets/js/app.js
Normal file
35
resources/assets/js/app.js
Normal file
@@ -0,0 +1,35 @@
|
||||
function hitungHariKerja(tanggalMulai, tanggalSelesai) {
|
||||
tanggalMulai = new Date(tanggalMulai);
|
||||
tanggalMulai.setHours(0, 0, 0, 0);
|
||||
tanggalSelesai = new Date(tanggalSelesai);
|
||||
tanggalSelesai.setHours(23, 59, 59, 999);
|
||||
|
||||
let hariKerja = 0;
|
||||
let tanggalSekarang = new Date(tanggalMulai);
|
||||
|
||||
// You'll need to implement a way to get holiday dates from your server
|
||||
// For this example, we'll assume you have a global variable holidayDates
|
||||
// that contains an array of holiday date strings in 'YYYY-MM-DD' format
|
||||
const tanggalLibur = window.holidayDates || [];
|
||||
|
||||
while (tanggalSekarang <= tanggalSelesai) {
|
||||
const dayOfWeek = tanggalSekarang.getDay();
|
||||
const dateString = tanggalSekarang.toISOString().split("T")[0];
|
||||
|
||||
// Check if it's not Saturday (6) or Sunday (0) and not a holiday
|
||||
if (
|
||||
dayOfWeek !== 0 &&
|
||||
dayOfWeek !== 6 &&
|
||||
!tanggalLibur.includes(dateString)
|
||||
) {
|
||||
hariKerja++;
|
||||
}
|
||||
|
||||
tanggalSekarang.setDate(tanggalSekarang.getDate() + 1);
|
||||
}
|
||||
|
||||
return hariKerja;
|
||||
}
|
||||
|
||||
// Make the function available globally
|
||||
window.hitungHariKerja = hitungHariKerja;
|
||||
0
resources/assets/sass/app.scss
Normal file
0
resources/assets/sass/app.scss
Normal file
0
resources/views/.gitkeep
Normal file
0
resources/views/.gitkeep
Normal file
77
resources/views/Ijin_usaha/create.blade.php
Normal file
77
resources/views/Ijin_usaha/create.blade.php
Normal file
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (isset($ijin_usaha->id))
|
||||
<form action="{{ route('basicdata.ijin_usaha.update', $ijin_usaha->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $ijin_usaha->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.ijin_usaha.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($ijin_usaha->id) ? 'Edit' : 'Tambah' }} Ijin Usaha
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.ijin_usaha.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
@if (isset($ijin_usaha->id))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kode Ijin Usaha
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly
|
||||
class="input border-warning bg-warning-light @error('code') border-danger bg-danger-light @enderror"
|
||||
type="text" name="code" value="{{ $ijin_usaha->code ?? old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kode Ijin Usaha
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $ijin_usaha->code ?? old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Ijin Usaha
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
||||
name="name" value="{{ $ijin_usaha->name ?? old('name') }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
151
resources/views/Ijin_usaha/index.blade.php
Normal file
151
resources/views/Ijin_usaha/index.blade.php
Normal file
@@ -0,0 +1,151 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.ijin_usaha') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="ijin-table" data-api-url="{{ route('basicdata.ijin_usaha.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Ijin Usaha
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Ijin Usaha" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.ijin_usaha.export') }}"> Export to Excel
|
||||
</a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.ijin_usaha.create') }}"> Tambah Ijin
|
||||
Usaha
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Ijin Usaha </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Ijin Usaha </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/ijin_usaha/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Ijin Usaha has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#ijin-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Kode Ijin Usaha',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Ijin Usaha',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/ijin_usaha/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
8
resources/views/SLA/index.blade.php
Normal file
8
resources/views/SLA/index.blade.php
Normal file
@@ -0,0 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('sla') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@endsection
|
||||
103
resources/views/activity/activitydetail.blade.php
Normal file
103
resources/views/activity/activitydetail.blade.php
Normal file
@@ -0,0 +1,103 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.border-l-primary {
|
||||
border-left-color: #0d6efd !important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="advanced_settings_appearance">
|
||||
<h3 class="card-title uppercase">
|
||||
Activity Permohonan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('activity.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujuan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($permohonan->status === 'done')
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'ALAT BERAT'];
|
||||
@endphp
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Hasil Laporan Penilaian
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<a class="btn btn-info" href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id ]) }}" class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success" onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@include('lpj::component.lampiran-dokumen')
|
||||
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
@include('lpj::component.history-permohonan')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
57
resources/views/activity/components/status.blade.php
Normal file
57
resources/views/activity/components/status.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<div class="pl-2.5 mb-7 text-md grow">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-sm text-gray-800">
|
||||
{{ $status->name . ' ' . $status->description }}
|
||||
</div>
|
||||
<span class="text-xs text-gray-600">
|
||||
@if (strtolower($status->name) == 'order')
|
||||
{{ $permohonan->created_at }}
|
||||
@elseif (strtolower($status->name) == strtolower($permohonan->status))
|
||||
{{ $permohonan->updated_at }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$isCurrentStatus = strtolower($status->name) == strtolower($permohonan->status);
|
||||
$hasKeterangan = isset($permohonan->keterangan);
|
||||
@endphp
|
||||
|
||||
{{-- Tampilkan keterangan jika status 'register' --}}
|
||||
@if (strtolower($status->name) == 'register' && $hasKeterangan && $isCurrentStatus)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body">
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Tampilkan dokumen dan keterangan jika status 'revisi' --}}
|
||||
@if (strtolower($status->name) == 'revisi' && $hasKeterangan)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('activity.download', $permohonan->id) }}" class="badge badge-sm badge-outline">
|
||||
{{ basename($permohonan->dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (strtolower($status->name) == 'assign' && $isCurrentStatus)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body grid grid-cols-3 gap-5">
|
||||
|
||||
<div>
|
||||
<h3 class="text-md font-medium text-gray-900">Catatan:</h3>
|
||||
<span class="text-2sm text-gray-700">{{ $permohonan->penilaian->keterangan }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
338
resources/views/activity/index.blade.php
Normal file
338
resources/views/activity/index.blade.php
Normal file
@@ -0,0 +1,338 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
margin-top: 0;
|
||||
/* Hilangkan jarak antara tombol dan dropdown */
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
||||
.dropdowns-content:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Activity
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button
|
||||
class="dropdowns-toggle btn btn-sm btn-light inline-flex justify-between w-full items-center">
|
||||
Pilih Status
|
||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||
</i>
|
||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||
</i>
|
||||
</button>
|
||||
<div
|
||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<!-- Checkbox untuk All Status -->
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input id="select-all" type="checkbox"
|
||||
class="form-checkbox h-4 w-4 text-blue-600">
|
||||
<span class="ml-2">All Status</span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Dinamis Status dari Backend -->
|
||||
@foreach ($status_permohonan as $item)
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
||||
value="{{ strtolower($item->name) }}">
|
||||
<span class="ml-2">{{ $item->name }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('activity.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('activity.datatables') }}">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"><span class="sort-label">Tanggal Permohonan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"><span class="sort-label">Cabang Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"><span class="sort-label">Debitur</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Tujuan Penilaian</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"><span class="sort-label">Status</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"></span>
|
||||
<div class="pagination" data-datatable-pagination="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const statusFilter = document.getElementById('status-filter'); // Dropdown filter element
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
} // Default order by 'nomor_registrasi' ascending
|
||||
],
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan'
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user && data.user.name ? `${data.user.name}` : '-';
|
||||
},
|
||||
},
|
||||
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.branch && data.branch.name ? `${data.branch.name}` : '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ?
|
||||
`${data.tujuan_penilaian.name}` : '-';
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = '';
|
||||
switch (data.status.toLowerCase()) {
|
||||
case 'revisi':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-warning';
|
||||
break;
|
||||
case 'order':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-info';
|
||||
break;
|
||||
case 'register':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-success';
|
||||
break;
|
||||
case 'survey':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-primary';
|
||||
break;
|
||||
case 'assign':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-dark';
|
||||
break;
|
||||
default:
|
||||
badgeClass = 'badge badge-pill badge-outline';
|
||||
}
|
||||
|
||||
return `<span class="badge ${badgeClass}">${data.status}</span>`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const status = data.status; // Anggap status berada di dalam objek data
|
||||
const dokumenjaminan = data.dokumenjaminan || [];
|
||||
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="activity/${data.id}/show" title="Lihat Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
${
|
||||
['survey', 'done', 'proses-laporan', 'laporan', 'paparan'].includes(status) ?
|
||||
dokumenjaminan.map(dokumen => {
|
||||
return `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}" title="Print Inspeksi Permohonan">
|
||||
<i class="ki-outline ki-printer"></i>
|
||||
</a>
|
||||
`;
|
||||
}).join('') : ''
|
||||
}
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', applyStatusFilter);
|
||||
});
|
||||
|
||||
// Event listener untuk "Select All"
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
applyStatusFilter();
|
||||
});
|
||||
|
||||
function applyStatusFilter() {
|
||||
const selectedStatuses = Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
|
||||
|
||||
if (selectedStatuses.length === 0) {
|
||||
dataTable.search('');
|
||||
console.log(selectedStatuses);
|
||||
|
||||
} else {
|
||||
|
||||
dataTable.search(selectedStatuses.join(','), true);
|
||||
console.log(selectedStatuses);
|
||||
|
||||
}
|
||||
|
||||
const allChecked = Array.from(statusCheckboxes).every(cb => cb.checked);
|
||||
selectAllCheckbox.checked = allChecked;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
512
resources/views/activity/progres_activity/index.blade.php
Normal file
512
resources/views/activity/progres_activity/index.blade.php
Normal file
@@ -0,0 +1,512 @@
|
||||
@extends('layouts.main')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity.progres') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.break-words {
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Team Activity</h3>
|
||||
</div>
|
||||
<div data-accordion="true">
|
||||
@php
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
return $item->team->regions->penilaiTeam
|
||||
->filter(function ($penilaiTeam) {
|
||||
$permohonan = optional($penilaiTeam->penilaian)->permohonan;
|
||||
return $permohonan !== null;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
@endphp
|
||||
|
||||
@foreach ($sortedTeamsActivity as $index => $item)
|
||||
@php
|
||||
$totalTask = countPermohonanForUser($item->user->id);
|
||||
@endphp
|
||||
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
|
||||
id="accordion_{{ $index }}">
|
||||
<button class="accordion-toggle py-4 group mx-8"
|
||||
data-accordion-toggle="#accordion_{{ $index }}content_{{ $index }}"
|
||||
style="margin-start: 10px">
|
||||
<table class="table table-auto align-middle text-gray-700 font-medium text-sm">
|
||||
<tr>
|
||||
<th class="min-w-[150px]" style="width: 600px">
|
||||
<span
|
||||
class="text-base text-gray-900 font-medium break-words">{{ $item->user->name }}</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
|
||||
@if ($totalTask >= 0 && $totalTask < 5)
|
||||
<span class="badge badge-outline badge-success rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@elseif ($totalTask >= 5 && $totalTask < 10)
|
||||
<span class="badge badge-outline badge-warning rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@else
|
||||
<span class="badge badge-outline badge-danger rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@endif
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<i
|
||||
class="ki-outline ki-plus text-gray-600 text-2sm font-medium accordion-active:hidden block"></i>
|
||||
<i
|
||||
class="ki-outline ki-minus text-gray-600 text-2sm font-medium accordion-active:block hidden"></i>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</button>
|
||||
<div class="accordion-content hidden" id="accordion_{{ $index }}content_{{ $index }}">
|
||||
<div class="mx-8 pb-4" style="margin-bottom: 20px">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false"
|
||||
id="activity-table-{{ $index }}"
|
||||
data-api-url="{{ route('activity.progres.datatables', ['id' => $item->user->id]) }}">
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table
|
||||
class="table table-auto align-middle text-gray-700 font-medium text-sm mb-4"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="min-w-[100px]">Nama Debitur</th>
|
||||
<th class="min-w-[100px]">Tujuan Penilaian</th>
|
||||
<th class="min-w-[100px]">Status Bayar</th>
|
||||
<th class="min-w-[100px]">Jenis Asset</th>
|
||||
<th class="min-w-[100px]">Penugasan</th>
|
||||
<th class="min-w-[100px]">Jenis Report</th>
|
||||
<th class="min-w-[100px]">Tgl Register</th>
|
||||
<th class="min-w-[100px]">Tgl Assign</th>
|
||||
<th class="min-w-[100px]">Tgl Kunjungan</th>
|
||||
<th class="min-w-[100px]">Progress</th>
|
||||
<th class="min-w-[100px]">SLA Laporan</th>
|
||||
<th class="min-w-[100px]">SLA Paparan</th>
|
||||
<th class="min-w-[100px]">Approve</th>
|
||||
<th class="min-w-[50px] text-center">Keterangan</th>
|
||||
<th class="min-w-[50px] text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true"
|
||||
name="perpage"></select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"></span>
|
||||
<div class="pagination" data-datatable-pagination="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const accordions = document.querySelectorAll('[data-accordion-item]');
|
||||
|
||||
accordions.forEach((accordion, index) => {
|
||||
accordion.querySelector('.accordion-toggle').addEventListener('click', () => {
|
||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||
'data-api-url');
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
columns: {
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture?.name}`
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.tujuan_penilaian?.name || ''}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
const status = data.permohonan.status_bayar.replace(
|
||||
/_/g,
|
||||
' ');
|
||||
const statusClass = data.permohonan.status_bayar ===
|
||||
'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="badge badge-sm badge-default font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) =>
|
||||
`${data.permohonan.debiture?.documents?.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
penugasan: {
|
||||
title: 'Penugasan',
|
||||
render: (item, data) => {
|
||||
|
||||
const roles = data.user_penilai?.map(d => d.role).join(
|
||||
'<br>') || '-';
|
||||
return roles;
|
||||
},
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
render: (item, data) => {
|
||||
return data.permohonan.penilai?.type_penilai || '-';
|
||||
},
|
||||
},
|
||||
register: {
|
||||
title: 'Register',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.permohonan.created_at) || ''}`,
|
||||
|
||||
},
|
||||
assign: {
|
||||
title: 'Assign',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.created_at)}`,
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tgl Kunjungan',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.waktu_penilaian) || ''}`,
|
||||
},
|
||||
progress: {
|
||||
title: 'Progress',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center ">${data.permohonan.status}</span>`;
|
||||
}
|
||||
},
|
||||
// tanggal kunjungan h+2 jika plafon di
|
||||
due_date: {
|
||||
title: 'Due Date',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return ``;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
},
|
||||
},
|
||||
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.paparan)}`;
|
||||
}
|
||||
},
|
||||
approve: {
|
||||
title: 'Approve',
|
||||
render: (item, data) => {
|
||||
// Gabungkan nama dengan <br> untuk pemisah baris baru
|
||||
let dataHtml = `
|
||||
${data.permohonan?.approve_so?.name || ''}
|
||||
<br>
|
||||
${data.permohonan?.approve_eo?.name || ''}
|
||||
<br>
|
||||
${data.permohonan?.approve_dd?.name || ''}
|
||||
`;
|
||||
return dataHtml;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
keterangan: {
|
||||
title: 'Keterangan',
|
||||
render: (item, data) => `${data.keterangan || ''}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const roles = data.user_penilai.map(d => d.role)
|
||||
let htmlData = ''
|
||||
|
||||
htmlData = `<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id}, '${roles}')" title="Ganti Team">
|
||||
<i class="ki-filled ki-user-edit"></i>
|
||||
</a>`
|
||||
|
||||
return htmlData;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize DataTable only for the active accordion
|
||||
if (!accordion.querySelector('.dataTable')) {
|
||||
const element = accordion.querySelector('.card-grid');
|
||||
new KTDataTable(element, dataTableOptions);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function formatDateFromISO(isoDateString) {
|
||||
const date = new Date(isoDateString);
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const year = String(date.getFullYear()).slice(-2);
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
|
||||
function calculateDateSLA($jenis, $date) {
|
||||
let date = new Date($date);
|
||||
return $jenis, $date;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId, roles) {
|
||||
|
||||
|
||||
const selectCategory = () => {
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
html: `
|
||||
<select id="categorySelect" class="input">
|
||||
<option value="" selected disabled>Pilih kategori Pengganti</option>
|
||||
<option value="team">Pilih dari Team</option>
|
||||
<option value="region">Pilih dari Wilayah</option>
|
||||
</select>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
const selectedCategory = document.getElementById('categorySelect').value;
|
||||
if (!selectedCategory) {
|
||||
Swal.showValidationMessage('Anda harus memilih kategori!');
|
||||
}
|
||||
return selectedCategory;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptionsHtml = '';
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
} else if (selectedCategory === 'region') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Wilayah</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: `Pilih ${selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'}`,
|
||||
html: subOptionsHtml,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
preConfirm: () => {
|
||||
const subOptionsPenugasan = document.getElementById('subOptionsPenugasan')?.value;
|
||||
const subSelected = document.getElementById('subOptionsSelect').value;
|
||||
if (!subSelected) {
|
||||
Swal.showValidationMessage('Anda harus memilih opsi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
penugasan: subOptionsPenugasan || null,
|
||||
selectedOption: subSelected || null,
|
||||
};
|
||||
}
|
||||
}).then((subResult) => {
|
||||
|
||||
console.log(subResult);
|
||||
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' : 'region_id';
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value.selectedOption,
|
||||
penugasan: subResult.value.penugasan,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message, 'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!', 'Terjadi kesalahan saat memproses permintaan.', 'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
selectCategory();
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
15
resources/views/activity/senior_officer/index.blade.php
Normal file
15
resources/views/activity/senior_officer/index.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row"></div>
|
||||
<div class="col-md-12">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
47
resources/views/arah_mata_angin/create.blade.php
Normal file
47
resources/views/arah_mata_angin/create.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($arahMataAngin->id))
|
||||
<form action="{{ route('basicdata.arah-mata-angin.update', $arahMataAngin->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $arahMataAngin->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.arah-mata-angin.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($arahMataAngin->id) ? 'Edit' : 'Tambah' }} Arah Mata Angin
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.arah-mata-angin.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $arahMataAngin->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
139
resources/views/arah_mata_angin/index.blade.php
Normal file
139
resources/views/arah_mata_angin/index.blade.php
Normal file
@@ -0,0 +1,139 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.arah-mata-angin') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="arah-mata-angin-table" data-api-url="{{ route('basicdata.arah-mata-angin.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Arah Mata Angin
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Arah Mata Angin" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.arah-mata-angin.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.arah-mata-angin.create') }}"> Tambah Arah Mata Angin </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Arah Mata Angin </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/arah-mata-angin/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#arah-mata-angin-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: 'Arah Mata Angin',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/arah-mata-angin/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
195
resources/views/assetsku/includenya.blade.php
Normal file
195
resources/views/assetsku/includenya.blade.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<style>
|
||||
.notification_success {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background-color: #51a351;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s;
|
||||
box-shadow: 0 0 12px #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.notification_error {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background-color: #AE342C;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s;
|
||||
box-shadow: 0 0 12px #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="notificationSuccess" class="notification_success" style="display: none;">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img style="margin-right: 10px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==">
|
||||
<span id="notification-message-success"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="notificationError" class="notification_error" style="display: none;">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img style="margin-right: 10px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=">
|
||||
<span id="notification-message-error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<script tipe="module">
|
||||
function removeErrorCssMsg() {
|
||||
$(".inputku").removeClass("border-danger");
|
||||
$("em").text('');
|
||||
}
|
||||
|
||||
function tandaPemisahTitik(b){
|
||||
var _minus = false;
|
||||
if (b<0) _minus = true;
|
||||
|
||||
b = b.toString();
|
||||
b=b.replace(".","");
|
||||
b=b.replace("-","");
|
||||
c = "";
|
||||
panjang = b.length;
|
||||
j = 0;
|
||||
|
||||
for (i = panjang; i > 0; i--){
|
||||
j = j + 1;
|
||||
if (((j % 3) == 1) && (j != 1)){
|
||||
c = b.substr(i-1,1) + "." + c;
|
||||
} else {
|
||||
c = b.substr(i-1,1) + c;
|
||||
}
|
||||
}
|
||||
|
||||
if (_minus) c = "-" + c ;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
function numbersonly(ini, e){
|
||||
if (e.keyCode>=49){
|
||||
|
||||
if(e.keyCode<=57){
|
||||
a = ini.value.toString().replace(".","");
|
||||
b = a.replace(/[^\d]/g,"");
|
||||
b = (b=="0")?String.fromCharCode(e.keyCode):b + String.fromCharCode(e.keyCode);
|
||||
ini.value = tandaPemisahTitik(b);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if(e.keyCode<=105){
|
||||
if(e.keyCode>=96){
|
||||
//e.keycode = e.keycode - 47;
|
||||
a = ini.value.toString().replace(".","");
|
||||
b = a.replace(/[^\d]/g,"");
|
||||
b = (b=="0")?String.fromCharCode(e.keyCode-48):b + String.fromCharCode(e.keyCode-48);
|
||||
ini.value = tandaPemisahTitik(b);
|
||||
//alert(e.keycode);
|
||||
return false;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}else if (e.keyCode==48){
|
||||
a = ini.value.replace(".","") + String.fromCharCode(e.keyCode);
|
||||
b = a.replace(/[^\d]/g,"");
|
||||
|
||||
if (parseFloat(b)!=0){
|
||||
ini.value = tandaPemisahTitik(b);
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}else if (e.keyCode==95){
|
||||
a = ini.value.replace(".","") + String.fromCharCode(e.keyCode-48);
|
||||
b = a.replace(/[^\d]/g,"");
|
||||
|
||||
if (parseFloat(b)!=0){
|
||||
ini.value = tandaPemisahTitik(b);
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}else if (e.keyCode==8 || e.keycode==46){
|
||||
a = ini.value.replace(".","");
|
||||
b = a.replace(/[^\d]/g,"");
|
||||
b = b.substr(0,b.length -1);
|
||||
|
||||
if (tandaPemisahTitik(b)!=""){
|
||||
ini.value = tandaPemisahTitik(b);
|
||||
} else {
|
||||
ini.value = "";
|
||||
}
|
||||
|
||||
return false;
|
||||
} else if (e.keyCode==9){
|
||||
return true;
|
||||
} else if (e.keyCode==17){
|
||||
return true;
|
||||
} else {
|
||||
//alert (e.keyCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toastrku(flag, message)
|
||||
{
|
||||
$.each(message, function (key, value) {
|
||||
var msg = '';
|
||||
var lengthnya = value.length;
|
||||
for (let i = 0; i < lengthnya; i++)
|
||||
{
|
||||
if(0!=i && (lengthnya-1)==i)
|
||||
msg+=", ";
|
||||
|
||||
msg+=value[i];
|
||||
|
||||
}
|
||||
if('success'==flag)
|
||||
toastrSuccessBuild(msg);
|
||||
else if('error' ==flag)
|
||||
toastrErrorBuild(msg);
|
||||
});
|
||||
}
|
||||
|
||||
function toastrSuccessBuild(message) {
|
||||
const notification = document.getElementById('notificationSuccess');
|
||||
const messageElement = document.getElementById('notification-message-success');
|
||||
|
||||
messageElement.textContent = message;
|
||||
notification.style.display = 'block';
|
||||
notification.style.opacity = '1';
|
||||
|
||||
setTimeout(() => {
|
||||
notification.style.opacity = '0';
|
||||
setTimeout(() => {
|
||||
notification.style.display = 'none';
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function toastrErrorBuild(message) {
|
||||
const notification = document.getElementById('notificationError');
|
||||
const messageElement = document.getElementById('notification-message-error');
|
||||
|
||||
messageElement.textContent = message;
|
||||
notification.style.display = 'block';
|
||||
notification.style.opacity = '1';
|
||||
|
||||
setTimeout(() => {
|
||||
notification.style.opacity = '0';
|
||||
setTimeout(() => {
|
||||
notification.style.display = 'none';
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}
|
||||
</script>
|
||||
137
resources/views/authorization/index.blade.php
Normal file
137
resources/views/authorization/index.blade.php
Normal file
@@ -0,0 +1,137 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('authorization') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="authorization-table" data-api-url="{{ route('authorization.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Authorization
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Authorization" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="#"> Tambah Authorization </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="branche_name">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="debiture_name">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="nama_tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilain </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="account_officer">
|
||||
<span class="sort"> <span class="sort-label"> Account Officer </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#authorization-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
branche_name: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
debiture_name: {
|
||||
title: 'Debitur',
|
||||
},
|
||||
nama_tujuan_penilaian: {
|
||||
title: 'Tujuan Penilain',
|
||||
},
|
||||
account_officer: {
|
||||
title: 'Account Officer',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="/debitur/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
dataTable.showSpinner();
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
587
resources/views/bank-data/index.blade.php
Normal file
587
resources/views/bank-data/index.blade.php
Normal file
@@ -0,0 +1,587 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('bank-data') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-5 lg:gap-7.5 mb-10">
|
||||
<div class="col-span-1">
|
||||
<div class="card border border-agi-100 card-grid min-w-full">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Filter
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body px-5">
|
||||
<form id="filter-form">
|
||||
<div class="grid gap-4 w-full p-5">
|
||||
|
||||
<div>
|
||||
<label for="kategori" class="block text-sm font-medium text-gray-700">Kategori</label>
|
||||
<select id="kategori" name="kategori" class="select tomselect w-full @error('kategori') border-danger bg-danger-light @enderror">
|
||||
<option value="">Semua Kategori</option>
|
||||
<option value="data_pembanding">Data Pembanding</option>
|
||||
<option value="penilaian">Penilaian</option>
|
||||
<option value="input_manual">Input Manual</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="jenis_asset" class="block text-sm font-medium text-gray-700">Jenis Asset</label>
|
||||
<select id="jenis_asset" name="jenis_asset" class="select tomselect w-full @error('jenis_asset') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Asset Type</option>
|
||||
@foreach($jenisJaminan as $jenis)
|
||||
<option value="{{ $jenis->name }}">{{ $jenis->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="province_code" class="block text-sm font-medium text-gray-700">Province</label>
|
||||
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Province</option>
|
||||
@foreach($provinces as $province)
|
||||
<option value="{{ $province->code }}">{{ $province->name }}</option>
|
||||
@endforeach
|
||||
<!-- Add province options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="city_code" class="block text-sm font-medium text-gray-700">City</label>
|
||||
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select City</option>
|
||||
<!-- Add city options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="district_code" class="block text-sm font-medium text-gray-700">District</label>
|
||||
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select District</option>
|
||||
<!-- Add district options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="village_code" class="block text-sm font-medium text-gray-700">Village</label>
|
||||
<select id="village_code" name="village_code" class="select w-full @error('village_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Village</option>
|
||||
<!-- Add village options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tahun" class="block text-sm font-medium text-gray-700">Tahun</label>
|
||||
<select id="tahun" name="tahun" class="select tomselect w-full @error('tahun') border-danger bg-danger-light @enderror">
|
||||
<option value="">Semua Tahun</option>
|
||||
@for ($year = date('Y'); $year >= 2000; $year--)
|
||||
<option value="{{ $year }}">{{ $year }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||
<input type="date" id="start_date" name="start_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
||||
<input type="date" id="end_date" name="end_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="w-full inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Apply Filters
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-span-3">
|
||||
<div class="card border border-agi-100 card-grid min-w-full">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Maps
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body px-5">
|
||||
<div id="map" style="height: 700px; width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="bank-data-table" data-api-url="{{ route('bank-data.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Bank Data
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Bank Data" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="sumber">
|
||||
<span class="sort"> <span class="sort-label"> Sumber </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_aset">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Aset </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tahun">
|
||||
<span class="sort"> <span class="sort-label"> Tahun </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Luas Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Luas Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="harga">
|
||||
<span class="sort"> <span class="sort-label"> Harga </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="location">
|
||||
<span class="sort"> <span class="sort-label"> Location </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="imageModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="bg-white p-4 rounded-lg max-w-3xl max-h-[100vh] overflow-auto">
|
||||
<img id="modalImage" src="" alt="Zoomed Image" class="max-w-full h-auto">
|
||||
<button id="closeModal" class="mt-4 px-4 py-2 bg-red-300 text-gray-800 rounded hover:bg-red-400" onclick="closeImageModal()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDQTNRxyr0w7kXHsO2hmarDTa9-1LyLmS8&callback=initMap" async defer></script>
|
||||
<script>
|
||||
let map;
|
||||
let markers = [];
|
||||
let infoWindows = [];
|
||||
let dataTable;
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: {lat: -6.200000, lng: 106.816666}, // Jakarta coordinates
|
||||
zoom: 10
|
||||
});
|
||||
}
|
||||
|
||||
function openImageModal(src) {
|
||||
const modal = document.getElementById('imageModal');
|
||||
const modalImage = document.getElementById('modalImage');
|
||||
modalImage.src = src;
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
}
|
||||
|
||||
function closeImageModal() {
|
||||
const modal = document.getElementById('imageModal');
|
||||
modal.classList.remove('flex');
|
||||
modal.classList.add('hidden');
|
||||
}
|
||||
|
||||
function changeMainPhoto(thumbnail, index) {
|
||||
const mainPhoto = thumbnail.closest('.photo-gallery').querySelector('.main-photo img');
|
||||
mainPhoto.src = thumbnail.src;
|
||||
mainPhoto.alt = thumbnail.alt;
|
||||
}
|
||||
|
||||
function updateMapMarkers(data) {
|
||||
// Clear existing markers
|
||||
markers.forEach(marker => marker.setMap(null));
|
||||
infoWindows.forEach(infoWindow => infoWindow.close());
|
||||
markers = [];
|
||||
infoWindows = [];
|
||||
|
||||
// Add new markers
|
||||
data.forEach(item => {
|
||||
if (item.location) {
|
||||
let lat, lng;
|
||||
|
||||
// Check if item.location is a string containing comma-separated coordinates
|
||||
if (typeof item.location === 'string' && item.location.includes(',')) {
|
||||
[lat, lng] = item.location.split(',').map(coord => parseFloat(coord.trim()));
|
||||
}
|
||||
// Check if item.location is an object with lat and lng properties
|
||||
else if (typeof item.location === 'object' && item.location.lat && item.location.lng) {
|
||||
lat = parseFloat(item.location.lat);
|
||||
lng = parseFloat(item.location.lng);
|
||||
}
|
||||
// Check if item.location is an array with two elements
|
||||
else if (Array.isArray(item.location) && item.location.length === 2) {
|
||||
[lat, lng] = item.location.map(coord => parseFloat(coord));
|
||||
}
|
||||
|
||||
const markerColors = {
|
||||
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
||||
penilaian: 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
|
||||
input: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'
|
||||
};
|
||||
|
||||
if (lat && lng) {
|
||||
const marker = new google.maps.Marker({
|
||||
position: {lat: lat, lng: lng},
|
||||
map: map,
|
||||
title: item.jenis_aset,
|
||||
icon: markerColors[item.kategori] || 'http://maps.google.com/mapfiles/ms/icons/red-dot.png' // Default to red if category is not recognized
|
||||
});
|
||||
|
||||
// Create info window content
|
||||
const contentString = `
|
||||
<div id='content' style='width: 550px; max-width: 100%;'>
|
||||
<div id='siteNotice'></div>
|
||||
<h2 class='card-title mb-5'>
|
||||
${item.jenis_aset}
|
||||
</h2>
|
||||
<div class="grid gap-3">
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Tanggal Penilaian
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatTanggalIndonesia(item.tanggal)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Tahun
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.tahun}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Luas Tanah
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.luas_tanah} m²
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Luas Bangunan
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.luas_bangunan} m²
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Harga
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatRupiah(item.harga)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Nilai Pasar
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatRupiah(item.nilai_pasar)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-start justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-start gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Location
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='text-right whitespace-normal break-words'>
|
||||
${item.address.split(' ').reduce((acc, word, index, array) => {
|
||||
if (index > 0 && index % 7 === 0) {
|
||||
acc += '<br>';
|
||||
}
|
||||
acc += word + (index < array.length - 1 ? ' ' : '');
|
||||
return acc;
|
||||
}, '')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
${item.photos && item.photos.length > 0 ? `
|
||||
<div class="photo-gallery mb-5">
|
||||
<div class="main-photo mb-2">
|
||||
<img src="storage/${item.photos[0]}" alt="${item.jenis_aset}"
|
||||
style="width: 100%; height: auto; object-fit: cover; cursor: pointer;"
|
||||
onclick="openImageModal(this.src)">
|
||||
</div>
|
||||
<div class="thumbnail-container flex gap-2 overflow-x-auto">
|
||||
${item.photos.map((photo, index) => `
|
||||
<img src="storage/${photo}" alt="${item.jenis_aset} ${index + 1}"
|
||||
class="thumbnail cursor-pointer"
|
||||
style="width: 60px; height: 60px; object-fit: cover;"
|
||||
onclick="changeMainPhoto(this, ${index})">
|
||||
`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
` : ''}
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex justify-end mt-3'>
|
||||
<button onclick="getDirections(${lat}, ${lng})" class='btn btn-sm btn-primary'>
|
||||
Get Directions
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Create info window
|
||||
const infoWindow = new google.maps.InfoWindow({
|
||||
content: contentString
|
||||
});
|
||||
|
||||
// Add click event to marker
|
||||
marker.addListener('click', () => {
|
||||
// Close all open info windows
|
||||
infoWindows.forEach(window => window.close());
|
||||
// Open this marker's info window
|
||||
infoWindow.open(map, marker);
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
infoWindows.push(infoWindow);
|
||||
|
||||
} else {
|
||||
console.error('Invalid location format for item:', item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Adjust map bounds to fit all markers
|
||||
if (markers.length > 0) {
|
||||
const bounds = new google.maps.LatLngBounds();
|
||||
markers.forEach(marker => bounds.extend(marker.getPosition()));
|
||||
map.fitBounds(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getDirections(lat, lng) {
|
||||
console.log('Getting directions to:', lat, lng);
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
const origin = position.coords.latitude + ',' + position.coords.longitude;
|
||||
const destination = lat + ',' + lng;
|
||||
const url = `https://www.google.com/maps/dir/?api=1&origin=${origin}&destination=${destination}`;
|
||||
window.open(url, '_blank');
|
||||
},
|
||||
() => {
|
||||
alert('Unable to get your current location. Please enable location services.');
|
||||
}
|
||||
);
|
||||
} else {
|
||||
alert('Geolocation is not supported by your browser.');
|
||||
}
|
||||
}
|
||||
|
||||
function initializeDataTable() {
|
||||
const element = document.querySelector('#bank-data-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
sumber: {
|
||||
title: 'Sumber'
|
||||
},
|
||||
jenis_aset: {
|
||||
title: 'Jenis Aset'
|
||||
},
|
||||
tanggal: {
|
||||
title: 'Tanggal',
|
||||
render: (item, data) => {
|
||||
return data.tanggal;
|
||||
},
|
||||
},
|
||||
tahun: {
|
||||
title: 'Tahun',
|
||||
render: (item, data) => {
|
||||
return data.tahun;
|
||||
},
|
||||
},
|
||||
luas_tanah: {
|
||||
title: 'Luas Tanah',
|
||||
render: (item, data) => {
|
||||
return `${data.luas_tanah} m²`;
|
||||
},
|
||||
},
|
||||
luas_bangunan: {
|
||||
title: 'Luas Bangunan',
|
||||
render: (item, data) => {
|
||||
return `${data.luas_bangunan} m²`;
|
||||
},
|
||||
},
|
||||
harga: {
|
||||
title: 'Harga',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.harga);
|
||||
},
|
||||
},
|
||||
nilai_pasar: {
|
||||
title: 'Nilai Pasar',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_pasar);
|
||||
},
|
||||
},
|
||||
location: {
|
||||
title: 'Location'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
dataTable = new KTDataTable(element, dataTableOptions);
|
||||
dataTable.on('draw', () => {
|
||||
const data = dataTable._data;
|
||||
updateMapMarkers(data);
|
||||
updatePagination(data);
|
||||
})
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
}
|
||||
|
||||
const filterForm = document.getElementById('filter-form');
|
||||
filterForm.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(this);
|
||||
const filters = Object.fromEntries(formData.entries());
|
||||
|
||||
// Apply the new search/filter
|
||||
if (filters) {
|
||||
dataTable.search(filters, true);
|
||||
}
|
||||
|
||||
// Reload the table to apply the new filters
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
function updatePagination(response) {
|
||||
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
||||
|
||||
if (paginationInfo) {
|
||||
if (response.recordsFiltered > 0) {
|
||||
const start = (response.page - 1) * response.pageSize + 1;
|
||||
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
||||
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
||||
} else {
|
||||
paginationInfo.textContent = 'No entries to show';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initializeEverything() {
|
||||
initMap();
|
||||
initializeDataTable();
|
||||
|
||||
dataTable.on('draw', () => {
|
||||
console.log("Table redrawn");
|
||||
});
|
||||
}
|
||||
|
||||
// Check if Google Maps API is loaded
|
||||
function checkGoogleMapsLoaded() {
|
||||
if (window.google && window.google.maps) {
|
||||
initializeEverything();
|
||||
} else {
|
||||
setTimeout(checkGoogleMapsLoaded, 100);
|
||||
}
|
||||
}
|
||||
|
||||
// Start checking if Google Maps is loaded
|
||||
checkGoogleMapsLoaded();
|
||||
</script>
|
||||
@endpush
|
||||
360
resources/views/component/detail-jaminan.blade.php
Normal file
360
resources/views/component/detail-jaminan.blade.php
Normal file
@@ -0,0 +1,360 @@
|
||||
@if (!isset($status))
|
||||
<div class="card border border-agi-100 {{ isset($hidePermohonan) ? 'hidden' : '' }}">
|
||||
<div class="card-header bg-agi-50" id="advanced_settings_appearance">
|
||||
@php
|
||||
$title = $title ?? 'Data Permohonan';
|
||||
@endphp
|
||||
<h3 class="card-title">
|
||||
{{ $title }}
|
||||
</h3>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
{!! $customlink ?? "" !!}
|
||||
@if (isset($id))
|
||||
@php
|
||||
$parameters = isset($id) ? ['id' => $id] : [];
|
||||
if (isset($type)) {
|
||||
$parameters['type'] = $type;
|
||||
}
|
||||
if (isset($additionalParam)) {
|
||||
$parameters['additional'] = $additionalParam;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<a href="{{ route($backLink, $parameters) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route($backLink, $queryParams ?? []) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if(isset($penawaran))
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $penawaran->code }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $penawaran->tujuanPenilaianKjpp->name }}
|
||||
</span>
|
||||
</div>
|
||||
@else
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nilai Plafond:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nilaiPlafond->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Status Bayar:
|
||||
</h3>
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Detail Debitur
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
|
||||
<div class="col-span-1">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal">
|
||||
Nama
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
Email
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->email ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
No Hp
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->phone ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Alamat
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->address ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->village->name ?? '' }},
|
||||
{{ $permohonan->debiture->district->name ?? '' }},
|
||||
{{ $permohonan->debiture->city->name ?? '' }},
|
||||
{{ $permohonan->debiture->province->name ?? '' }} -
|
||||
{{ $permohonan->debiture->village->postal_code ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-span-1">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Cabang
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->branch->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
CIF
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->cif ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Nomor Rekening
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->nomor_rekening ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
NPWP
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->npwp ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Data Jaminan
|
||||
</h3>
|
||||
</div>
|
||||
@endif
|
||||
<div data-accordion="true">
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
<div class="accordion-item {{ count($permohonan->documents) == 1 ? 'active' : '' }} [&:not(:last-child)]:border-b border-b-gray-200"
|
||||
data-accordion-item="true" id="accordion_detail_jaminan">
|
||||
<button @class(['accordion-toggle py-4 group', 'mx-8' => !isset($status)])"
|
||||
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
|
||||
<span class="text-base text-gray-900 font-medium">
|
||||
@if (count($permohonan->documents) > 1)
|
||||
Jaminan {{ $loop->index + 1 }}
|
||||
@else
|
||||
Jaminan
|
||||
@endif
|
||||
</span>
|
||||
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
||||
</i>
|
||||
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
|
||||
</i>
|
||||
</button>
|
||||
<div class="accordion-content {{ count($permohonan->documents) > 1 ? 'hidden' : '' }}"
|
||||
id="accordion_detail_jaminan_{{ $loop->index }}">
|
||||
|
||||
@if (!isset($status))
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-2">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Jenis Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->jenisJaminan->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Hubungan Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Alamat Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ formatAlamat($dokumen) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<a href="{{ route('debitur.jaminan.bulk.download', ['id' => $permohonan->debiture->id, 'jaminan' => $dokumen->id]) }}"
|
||||
class="ml-6 btn btn-dark dark:btn-light">
|
||||
<i class="ki-outline ki-cloud-download"></i> Download Semua Dokumen
|
||||
</a>
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
@php $document = $dokumen; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<strong class="text-2xs text-gray-600 uppercase">
|
||||
{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')">
|
||||
<i class="ki-filled ki-eye mr-2"></i>Preview
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if(isset($detail->details) && isset(json_decode($detail->details)[$index]))
|
||||
@foreach (json_decode($detail->details)[$index] as $key => $value)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
- {{ str_replace("_"," ",$key) ?? "" }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<p class="text-2xs text-gray-600 max-w-[250px]">
|
||||
{{ $value }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
- keterangan
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<p class="text-2xs text-gray-600 max-w-[250px]">
|
||||
{{ $detail->keterangan }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@if (!isset($status))
|
||||
</div>
|
||||
|
||||
@include('lpj::component.lampiran-dokumen')
|
||||
@include('lpj::component.history-permohonan')
|
||||
|
||||
|
||||
@endif
|
||||
@include('lpj::component.pdfviewer')
|
||||
623
resources/views/component/form-penilai.blade.php
Normal file
623
resources/views/component/form-penilai.blade.php
Normal file
@@ -0,0 +1,623 @@
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
<input type="hidden" name="action" value="{{ implode(',', $kategoriUnik) }}">
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
|
||||
|
||||
@if (array_intersect($kategoriUnik, ['tanah', 'bangunan', 'apartemen-kantor']))
|
||||
@include('lpj::surveyor.components.header')
|
||||
@endif
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
{{-- Tampilkan komponen sesuai kategori --}}
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi dan pembanding
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<a href="{{ route('penilai.showDataPembanding', ['id' => $permohonan->id]) }}?dokument={{ request()->documentId }}&jenis_jaminan={{ request()->jaminanId }}"
|
||||
class="btn btn-primary" data-bs-toggle="modal">
|
||||
Edit Data Pembanding
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@include('lpj::penilai.components.informasi-pembanding')
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
total nilai pasar wajar
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body gap-5">
|
||||
<div>
|
||||
<label for="total_nilai_pasar_wajar" class="form-label">Total Nilai Pasar Wajar</label>
|
||||
<div class="card-body grid gap-2.5 ">
|
||||
|
||||
@php
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartemen-kantor' => 'Luas Unit',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
|
||||
if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
$labelNilai['bangunan'] = 'Luas Unit';
|
||||
unset($labelNilai['tanah']);
|
||||
}
|
||||
@endphp
|
||||
|
||||
@foreach ($kategoriUnik as $item)
|
||||
@php
|
||||
|
||||
if ($item === 'bangunan') {
|
||||
$luas =
|
||||
$forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ??
|
||||
($forminspeksi['bangunan']['luas_tanah_bagunan']['sesuai'] ?? null);
|
||||
} elseif ($item === 'tanah') {
|
||||
$luas =
|
||||
$forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ??
|
||||
($forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null);
|
||||
} else if ($item === 'apartemen-kantor') {
|
||||
$luas = $forminspeksi['luas_unit']['sesuai'] ?? ($forminspeksi['luas_unit']['tidak sesuai'] ?? null);
|
||||
} else {
|
||||
$luas = null;
|
||||
}
|
||||
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
||||
|
||||
$luasKey = 'luas_' . $item;
|
||||
$nilaiKey1 = 'nilai_' . $item . '_1';
|
||||
$nilaiKey2 = 'nilai_' . $item . '_2';
|
||||
@endphp
|
||||
@if (isset($labelNilai[$item]))
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">
|
||||
{{ $labelNilai[$item] }}
|
||||
</label>
|
||||
<input type="text" id="{{ $luasKey }}" class="input w-full"
|
||||
name="{{ $luasKey }}"
|
||||
value="{{ old($luasKey, $lpjData[$luasKey] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp</i>
|
||||
<input type="text" id="{{ $nilaiKey1 }}" class="w-full currency"
|
||||
name="{{ $nilaiKey1 }}"
|
||||
value="{{ old($nilaiKey1, $lpjData[$nilaiKey1] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="input">
|
||||
<i class="">Rp</i>
|
||||
<input id="{{ $nilaiKey2 }}" type="text"
|
||||
class="w-full currency-format"
|
||||
name="{{ $nilaiKey2 }}"
|
||||
value="{{ old($nilaiKey2, $lpjData[$nilaiKey2] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div>
|
||||
<div id="add_pasar_wajar" class="flex flex-wrap gap-2.5 w-full">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-2 ">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full grid-col-2">
|
||||
<label class="form-label max-w-56" for="">Total Nilai</label>
|
||||
<label for="province" class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format" id="total_nilai_pasar_wajar"
|
||||
name="total_nilai_pasar_wajar"
|
||||
value="{{ old('total_nilai_pasar_wajar', $lpjData['total_nilai_pasar_wajar'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tambah mb-10" style="margin-bottom: 20px;">
|
||||
<button type="button" id="tambah-npw" class="btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
Tambah NPW </button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="total_nilai_pasar_wajar" class="form-label uppercase">TOTAL NILAI
|
||||
LIKUIDASI</label>
|
||||
<div class="card-body grid gap-2.5 w-full">
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<div class="w-full">
|
||||
<label class="input">
|
||||
|
||||
<input type="text" id="likuidasi" name="likuidasi" class=" w-full currency"
|
||||
value="{{ old('likuidasi', $lpjData['likuidasi'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
<i class="">%
|
||||
</i>
|
||||
</label>
|
||||
<span class="text-xs"> <span class="text-xs text-danger">*</span> Masukkan Angka Saja
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format" id="likuidasi_nilai_1"
|
||||
name="likuidasi_nilai_1"
|
||||
value="{{ old('likuidasi_nilai_1', $lpjData['likuidasi_nilai_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format" name="likuidasi_nilai_2"
|
||||
value="{{ old('likuidasi_nilai_2', $lpjData['likuidasi_nilai_2'] ?? null) }}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="w-full">
|
||||
<div id="keterangan_penilai-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
||||
@if (!empty($lpjData['keterangan_penilai']) && is_array($lpjData['keterangan_penilai']))
|
||||
@foreach ($lpjData['keterangan_penilai'] as $index => $item)
|
||||
<div class="keterangan_penilai flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan_penilai[]" class="textarea mt-2 " placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan_penilai.$index", $item) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="keterangan_penilai flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan_penilai[]" class="textarea mt-2 " placeholder="Masukkan catatan penting" rows="10"></textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-keterangan_penilai" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
onclick="addClonableItem('keterangan_penilai-container', 'keterangan_penilai')"
|
||||
class="btn btn-primary btn-sm mt-5 ">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
const datas = @json($lpjData);
|
||||
console.log(datas);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const tambahNPWButton = document.getElementById('tambah-npw');
|
||||
const addPasarWajarContainer = document.getElementById('add_pasar_wajar');
|
||||
let npwCounter = 0;
|
||||
|
||||
tambahNPWButton.addEventListener('click', function() {
|
||||
npwCounter++;
|
||||
|
||||
const newNPWRow = document.createElement('div');
|
||||
newNPWRow.className = 'flex grid-col-3 gap-2.5 w-full npw-row';
|
||||
newNPWRow.innerHTML = `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<input type="text"
|
||||
id="name_npw_${npwCounter}"
|
||||
class="input w-full"
|
||||
name="name_npw_${npwCounter}"
|
||||
placeholder="Nama NPW">
|
||||
|
||||
<input type="text"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full "
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_1"
|
||||
class=" w-full currency"
|
||||
name="nilai_npw_${npwCounter}_1"
|
||||
placeholder="Harga per meter"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_2"
|
||||
class="input w-full currency-format"
|
||||
name="nilai_npw_${npwCounter}_2"
|
||||
placeholder="Total Nilai"
|
||||
readonly>
|
||||
</label>
|
||||
<button type="button" class="btn btn-danger remove-npw">
|
||||
<i class="ki-filled ki-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Tambahkan event listener untuk remove button
|
||||
newNPWRow.querySelector('.remove-npw').addEventListener('click', function() {
|
||||
newNPWRow.remove();
|
||||
calculateTotal();
|
||||
});
|
||||
|
||||
// Tambahkan event listener untuk currency format
|
||||
newNPWRow.querySelectorAll('.currency-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
});
|
||||
});
|
||||
|
||||
addPasarWajarContainer.appendChild(newNPWRow);
|
||||
});
|
||||
|
||||
function loadSavedNPW() {
|
||||
// Cek apakah ada data LPJ yang sudah tersimpan
|
||||
const lpjDataElement = document.getElementById('lpj-data');
|
||||
if (lpjDataElement) {
|
||||
const lpjData = JSON.parse(lpjDataElement.value);
|
||||
|
||||
// Periksa apakah ada NPW tambahan
|
||||
if (lpjData.npw_tambahan && lpjData.npw_tambahan.length > 0) {
|
||||
lpjData.npw_tambahan.forEach((npw, index) => {
|
||||
// Increment counter
|
||||
npwCounter++;
|
||||
|
||||
// Buat row baru
|
||||
const newNPWRow = document.createElement('div');
|
||||
newNPWRow.className = 'flex grid-col-3 gap-2.5 w-full npw-row mb-3';
|
||||
newNPWRow.innerHTML = `
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<input type="text"
|
||||
id="name_npw_${npwCounter}"
|
||||
class="input w-full"
|
||||
name="name_npw_${npwCounter}"
|
||||
placeholder="Nama NPW"
|
||||
value="${npw.name || ''}">
|
||||
<input type="text"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full currency-format"
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
value="${npw.luas || ''}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_1"
|
||||
class=" w-full currency"
|
||||
name="nilai_npw_${npwCounter}_1"
|
||||
placeholder="Harga per meter"
|
||||
value="${npw.nilai_1 || ''}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_2"
|
||||
class=" w-full currency-format"
|
||||
name="nilai_npw_${npwCounter}_2"
|
||||
placeholder="Total Nilai"
|
||||
value="${npw.nilai_2 || ''}"
|
||||
readonly>
|
||||
</label>
|
||||
<div>
|
||||
<button type="button" class="btn btn-danger remove-npw h-full">
|
||||
<i class="ki-filled ki-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
`;
|
||||
|
||||
// Tambahkan event listener untuk remove button
|
||||
newNPWRow.querySelector('.remove-npw').addEventListener('click', function() {
|
||||
newNPWRow.remove();
|
||||
calculateTotal();
|
||||
});
|
||||
|
||||
// Tambahkan event listener untuk currency format
|
||||
newNPWRow.querySelectorAll('.currency-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
});
|
||||
});
|
||||
|
||||
// Tambahkan row baru di bagian bawah
|
||||
addPasarWajarContainer.appendChild(newNPWRow);
|
||||
});
|
||||
|
||||
// Hitung total setelah memuat data
|
||||
calculateTotal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Panggil fungsi load NPW saat halaman dimuat
|
||||
loadSavedNPW();
|
||||
document.querySelectorAll('.currency-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function formatPercentage(value) {
|
||||
// Hapus semua karakter kecuali angka dan koma
|
||||
let numericValue = value.replace(/[^0-9,]/g, '');
|
||||
|
||||
// Pastikan hanya satu koma yang ada
|
||||
let parts = numericValue.split(',');
|
||||
if (parts.length > 2) {
|
||||
numericValue = parts[0] + ',' + parts[1]; // Pertahankan hanya bagian pertama dan kedua
|
||||
}
|
||||
|
||||
// Jika nilai melebihi 100, batasi menjadi 100
|
||||
let numericFloat = parseFloat(numericValue.replace(',', '.')) || 0;
|
||||
if (numericFloat > 100) {
|
||||
numericFloat = 100;
|
||||
numericValue = '100';
|
||||
}
|
||||
|
||||
// Kembalikan nilai dengan simbol %
|
||||
return numericValue;
|
||||
}
|
||||
|
||||
function calculateTotal() {
|
||||
const parseInput = (value) => {
|
||||
if (!value) return 0;
|
||||
return parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
};
|
||||
|
||||
// Function to format currency
|
||||
function formatCurrency(value) {
|
||||
// Ensure we have a valid number to format
|
||||
const num = parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
return num.toLocaleString('id-ID');
|
||||
}
|
||||
|
||||
// Function to format percentage
|
||||
function formatPercentage(value) {
|
||||
if (!value) return '';
|
||||
const num = parseFloat(value.replace(/[^0-9.]/g, '')) || 0;
|
||||
return num.toString();
|
||||
}
|
||||
|
||||
// Calculate total nilai pasar wajar
|
||||
let totalNilaiPasarWajar = 0;
|
||||
|
||||
// Get all kategori unik elements dynamically
|
||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||
|
||||
|
||||
|
||||
kategoriItems.forEach(item => {
|
||||
console.log(item);
|
||||
|
||||
const kategori = item.id.replace('luas_', '');
|
||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||
const nilaiInput = document.querySelector(`input[name="nilai_${kategori}_1"]`);
|
||||
const outputElement = document.querySelector(`input[name="nilai_${kategori}_2"]`);
|
||||
|
||||
if (luasInput && nilaiInput && outputElement) {
|
||||
const luas = parseInput(luasInput.value);
|
||||
const nilai = parseInput(nilaiInput.value);
|
||||
const hasil = luas * nilai;
|
||||
|
||||
outputElement.value = formatCurrency(hasil.toString());
|
||||
totalNilaiPasarWajar += hasil;
|
||||
}
|
||||
});
|
||||
|
||||
// Tambahkan perhitungan untuk NPW tambahan
|
||||
const npwRows = document.querySelectorAll('.npw-row');
|
||||
npwRows.forEach(row => {
|
||||
const luasInput = row.querySelector('input[id^="ls_npw_"]');
|
||||
const nilaiInput = row.querySelector('input[id^="nilai_npw_"][id$="_1"]');
|
||||
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
||||
|
||||
if (luasInput && nilaiInput && outputElement) {
|
||||
const luas = parseInput(luasInput.value);
|
||||
const nilai = parseInput(nilaiInput.value);
|
||||
const hasil = luas * nilai;
|
||||
|
||||
outputElement.value = formatCurrency(hasil.toString());
|
||||
totalNilaiPasarWajar += hasil;
|
||||
}
|
||||
});
|
||||
|
||||
// Update total nilai pasar wajar
|
||||
const totalElement = document.getElementById('total_nilai_pasar_wajar');
|
||||
if (totalElement) {
|
||||
|
||||
totalElement.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
}
|
||||
|
||||
// Bagian Likuidasi
|
||||
const persentaseLikuidasiInput = document.getElementById('likuidasi');
|
||||
if (persentaseLikuidasiInput) {
|
||||
let persentaseLikuidasi = parseInput(persentaseLikuidasiInput.value);
|
||||
persentaseLikuidasiInput.value = formatPercentage(persentaseLikuidasiInput.value);
|
||||
|
||||
const totalNilaiPasarLikuidasi = document.querySelector('input[name="likuidasi_nilai_1"]');
|
||||
const totalLikuidasi = document.querySelector('input[name="likuidasi_nilai_2"]');
|
||||
|
||||
if (totalNilaiPasarLikuidasi && totalLikuidasi) {
|
||||
totalNilaiPasarLikuidasi.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
|
||||
// Perhitungan Likuidasi
|
||||
const hasilLikuidasi = Math.ceil((persentaseLikuidasi / 100) * totalNilaiPasarWajar / 10) * 10;
|
||||
|
||||
console.log('hasilLikuidasi', hasilLikuidasi);
|
||||
|
||||
totalLikuidasi.value = formatCurrency(hasilLikuidasi.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Bagian Asuransi (jika ada)
|
||||
const luasBangunanAsuransi = document.getElementById('asuransi_luas_bangunan');
|
||||
const hargaPerMeterAsuransi = document.querySelector('input[name="asuransi_nilai_1"]');
|
||||
const totalNilaiAsuransi = document.querySelector('input[name="asuransi_nilai_2"]');
|
||||
|
||||
if (luasBangunanAsuransi && hargaPerMeterAsuransi && totalNilaiAsuransi) {
|
||||
const luas = parseInput(luasBangunanAsuransi.value);
|
||||
const nilai = parseInput(hargaPerMeterAsuransi.value);
|
||||
const hasilAsuransi = luas * nilai;
|
||||
|
||||
totalNilaiAsuransi.value = formatCurrency(hasilAsuransi.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveLpjSederhanadanStandard() {
|
||||
const form = document.getElementById('form-lpj');
|
||||
const formData = new FormData(form);
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeLpjSederhanadanStandard') }}?permohonanId=${permohonanId}&inspeksiId=${inspeksiId}&documentId=${documentId}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.log(errors);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatCurrencyInput(input) {
|
||||
const value = input.value.replace(/[^0-9]/g, ''); // Hapus karakter non-angka
|
||||
if (!value) {
|
||||
input.value = ''; // Kosongkan jika tidak ada angka
|
||||
return;
|
||||
}
|
||||
|
||||
// Format ke mata uang
|
||||
const formattedValue = new Intl.NumberFormat('id-ID', {
|
||||
style: 'currency',
|
||||
currency: 'IDR'
|
||||
}).format(value);
|
||||
|
||||
input.value = formattedValue;
|
||||
}
|
||||
</script>
|
||||
77
resources/views/component/history-permohonan.blade.php
Normal file
77
resources/views/component/history-permohonan.blade.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Activity
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex flex-col">
|
||||
@foreach($permohonan->histories as $activity)
|
||||
<div class="flex items-start relative">
|
||||
@if($loop->first)
|
||||
<div
|
||||
class="w-9 left-0 top-9 absolute bottom-0 translate-x-1/2 border-l border-l-primary">
|
||||
</div>
|
||||
@endif
|
||||
@if(!$loop->last && !$loop->first)
|
||||
<div
|
||||
class="w-9 left-0 top-9 absolute bottom-0 translate-x-1/2 border-l border-l-gray-300">
|
||||
</div>
|
||||
@endif
|
||||
<div
|
||||
class="flex items-center justify-center shrink-0 rounded-full
|
||||
{{ $loop->first ? 'btn-outline btn-primary' : 'bg-gray-100 border-gray-300 text-gray-600' }}
|
||||
size-9">
|
||||
@switch(strtolower($activity->status))
|
||||
@case('preregister')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
@case('order')
|
||||
<i class="ki-filled ki-handcart text-base"></i>
|
||||
@break
|
||||
@case('revisi')
|
||||
<i class="ki-filled ki-notepad-edit text-base"></i>
|
||||
@break
|
||||
|
||||
@case('register')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
|
||||
@case('assign')
|
||||
<i class="ki-filled ki-file-added"></i>
|
||||
@break
|
||||
|
||||
@case('survey')
|
||||
<i class="ki-filled ki-map text-base"></i>
|
||||
@break
|
||||
@case('proses laporan')
|
||||
<i class="ki-filled ki-paper-plane text-base"></i>
|
||||
@break
|
||||
@case('approved')
|
||||
<i class="ki-filled ki-check text-base"></i>
|
||||
@break
|
||||
@case('delivered')
|
||||
<i class="ki-filled ki-delivery-3 text-base"></i>
|
||||
@break
|
||||
@default
|
||||
<i class="ki-filled ki-information text-base"></i>
|
||||
@endswitch
|
||||
</div>
|
||||
<div class="ml-3 mb-5">
|
||||
<span class="text-sm text-gray-700 capitalize font-medium">{{ str_replace('-',' ',$activity->status) }}</span>
|
||||
<p class="text-xs text-gray-500 mt-1">{{ $activity->keterangan ? 'Catatan : '.$activity->keterangan : '' }}</p>
|
||||
<div class="flex items-center mt-2">
|
||||
<span class="text-xs text-gray-400">{{ $activity->created_by ? $activity->creator->name : 'System' }}</span>
|
||||
<span class="text-xs text-gray-400 ml-2">{{ $activity->created_at->format('d M Y H:i') }}</span>
|
||||
</div>
|
||||
@if($activity->file_path)
|
||||
<a href="{{ route('activity.download', $activity->permohonan_id) }}" class="text-xs text-blue-600 hover:underline mt-2 inline-block">
|
||||
<i class="ki-outline ki-attachment"></i> Attachment
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
547
resources/views/component/kertas-kerja.blade.php
Normal file
547
resources/views/component/kertas-kerja.blade.php
Normal file
@@ -0,0 +1,547 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Penilaian Aset</title>
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.header-table,
|
||||
.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.header-table td {
|
||||
padding: 5px 8px;
|
||||
border: 1px solid #ddd;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.header-table .title {
|
||||
font-weight: bold;
|
||||
background-color: #f1f3f5;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.header-table .value {
|
||||
background-color: #f9f9f9;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.data-table th,
|
||||
.data-table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px 8px;
|
||||
text-align: left;
|
||||
word-wrap: break-word;
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.data-table th {
|
||||
background-color: #f1f3f5;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.data-table tr:nth-child(even) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<table class="header-table">
|
||||
<tr>
|
||||
<td class="title">Pendekatan Pasar</td>
|
||||
<td class="value">Metode Perbandingan Data Pasar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Tanggal Penilaian</td>
|
||||
<td class="value">{{ $tanggal_penilaian ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Pemilik Aset</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Pemberi Tugas</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Lokasi</td>
|
||||
<td class="value">{{ $lokasi ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">Nama Debitur</td>
|
||||
<td class="value">-</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>A Informasi Umum
|
||||
</h4>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5">No.</th>
|
||||
<th width="20">Uraian</th>
|
||||
<th width="15">Objek Penilaian</th>
|
||||
<th width="20">Data Pembanding 1</th>
|
||||
<th width="20">Data Pembanding 2</th>
|
||||
<th width="20">Data Pembanding 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$dataform = json_decode(isset($data->data_form) ? $data->data_form : '', true) ?? [];
|
||||
$dataPembanding = json_decode(isset($data->data_pembanding) ? $data->data_pembanding : '', true) ?? [];
|
||||
|
||||
// print_r($dataform);
|
||||
// echo $dataform;
|
||||
|
||||
@endphp
|
||||
|
||||
@php
|
||||
function getNestedValue($data, $keyPath, $default = '-')
|
||||
{
|
||||
// Pecah path kunci menjadi array
|
||||
$keys = explode('.', $keyPath);
|
||||
|
||||
// Mulai dari data awal
|
||||
$value = $data;
|
||||
|
||||
// Telusuri setiap kunci
|
||||
foreach ($keys as $key) {
|
||||
// Cek apakah kunci ada di level saat ini
|
||||
if (is_array($value) && array_key_exists($key, $value)) {
|
||||
$value = $value[$key];
|
||||
} else {
|
||||
// Jika kunci tidak ditemukan, kembalikan default
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
// Kembalikan nilai akhir atau default jika kosong
|
||||
return $value ?? $default;
|
||||
}
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'label' => 'Jenis Aset',
|
||||
'key' => 'asset.jenis_aset',
|
||||
'default' => 'Rumah Tinggal',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Luas Tanah (M²)',
|
||||
'key' => 'tanah.luas_tanah',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Luas Bangunan (M²)',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Penawaran Transaksi',
|
||||
'key' => '-',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Tanggal Penawaran',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Discon',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Harga',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Telepon Contact person',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Nara Sumber',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Status Nara Sumber',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Waktu Penawaran',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Alamat',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Jalan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Desa/Kelurahan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Kecamatan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Kota/Kabupaten',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Provinsi',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
|
||||
[
|
||||
'label' => 'Jarak Pembanding dengan Objek',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Esitmasi Rangking Tanah',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Ranking bangunan',
|
||||
'key' => 'bangunan.luas_tanah_bangunan',
|
||||
'default' => '-',
|
||||
'variants' => [
|
||||
'sesuai' => 'Sesuai',
|
||||
'tidak sesuai' => 'Tidak Sesuai',
|
||||
],
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($rows as $index => $item)
|
||||
<tr>
|
||||
<td class="text-center">{{ $index + 1 }}</td>
|
||||
<td>{{ $item['label'] }}</td>
|
||||
|
||||
|
||||
<td>
|
||||
@php
|
||||
// Coba berbagai varian kunci
|
||||
$objekValue = '-';
|
||||
foreach (['sesuai', 'tidak sesuai'] as $variant) {
|
||||
$fullKey = $item['key'] . '.' . $variant;
|
||||
$objekValue = getNestedValue($dataform, $fullKey, $item['default']);
|
||||
|
||||
// Jika nilai ditemukan, hentikan pencarian
|
||||
if ($objekValue !== $item['default']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $objekValue }}
|
||||
</td>
|
||||
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<td>
|
||||
@php
|
||||
$pembandingValue = '-';
|
||||
|
||||
// Pastikan data pembanding tersedia
|
||||
if (isset($dataPembanding['data_pembanding'][$i])) {
|
||||
$pembandingItem = $dataPembanding['data_pembanding'][$i];
|
||||
|
||||
// Mapping key berdasarkan label
|
||||
switch ($item['label']) {
|
||||
case 'Jenis Aset':
|
||||
$pembandingValue = $pembandingItem['jenis_aset'] ?? '-';
|
||||
break;
|
||||
case 'Luas Tanah (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_tanah'] ?? '-';
|
||||
break;
|
||||
case 'Luas Bangunan (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_bangunan'] ?? '-';
|
||||
break;
|
||||
default:
|
||||
$pembandingValue = '-';
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $pembandingValue }}
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4> B. Estimasi Nilai Tanah Pembanding dengan Teknik Penyisaan Tanah untuk mendapatkan per meter persegi estimasi
|
||||
Nilai Tanah Pembanding</h4>
|
||||
|
||||
<table>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5">No.</th>
|
||||
<th width="20">Uraian</th>
|
||||
<th width="15">Objek Penilaian</th>
|
||||
<th width="20">Data Pembanding 1</th>
|
||||
<th width="20">Data Pembanding 2</th>
|
||||
<th width="20">Data Pembanding 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$estimasi = [
|
||||
[
|
||||
'label' => 'Biaya Teknis Bangunan',
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Biaya Pengganti Baru Bangunan',
|
||||
],
|
||||
[
|
||||
'label' => 'Estimasi Biaya Pengganti SPL (Rp)',
|
||||
],
|
||||
[
|
||||
'label' => 'Penyusutan Fisik Banguan',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($estimasi as $index => $item)
|
||||
<tr>
|
||||
<td class="text-center">{{ $index + 1 }}</td>
|
||||
<td>{{ $item['label'] }}</td>
|
||||
<td>-</td>
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<td>
|
||||
@php
|
||||
$pembandingValue = '-';
|
||||
|
||||
// Pastikan data pembanding tersedia
|
||||
if (isset($dataPembanding['data_pembanding'][$i])) {
|
||||
$pembandingItem = $dataPembanding['data_pembanding'][$i];
|
||||
|
||||
// Mapping key berdasarkan label
|
||||
switch ($item['label']) {
|
||||
case 'Jenis Aset':
|
||||
$pembandingValue = $pembandingItem['jenis_aset'] ?? '-';
|
||||
break;
|
||||
case 'Luas Tanah (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_tanah'] ?? '-';
|
||||
break;
|
||||
case 'Luas Bangunan (M²)':
|
||||
$pembandingValue = $pembandingItem['luas_bangunan'] ?? '-';
|
||||
break;
|
||||
default:
|
||||
$pembandingValue = '-';
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
{{ $pembandingValue }}
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>Peta Objek dan Pembanding</h4>
|
||||
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
@forelse ($fotoTypes as $type)
|
||||
<div class="text-center">
|
||||
@php
|
||||
$imagePath = $dataform[$type];
|
||||
@endphp
|
||||
|
||||
@if ($imagePath && Storage::exists($imagePath))
|
||||
<img
|
||||
src="{{ asset('storage/' . $imagePath) }}"
|
||||
alt="{{ $type }}"
|
||||
class="max-w-full h-auto mx-auto"
|
||||
onerror="this.src='{{ asset('default-image.png') }}'"
|
||||
>
|
||||
<p class="mt-2 text-sm">{{ Str::title(str_replace('_', ' ', $type)) }}</p>
|
||||
@else
|
||||
<div class="bg-gray-200 p-4 text-center">
|
||||
<p>Tidak ada gambar</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@empty
|
||||
<p>Tidak ada tipe foto yang tersedia</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
<h4 class="mt-6">FOTO OBJEK DAN DATA PEMBANDING</h4>
|
||||
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
@forelse ($dataPembanding['data_pembanding'] ?? [] as $index => $item)
|
||||
<div class="text-center">
|
||||
@php
|
||||
$fotoObjek = $item['foto_objek'];
|
||||
@endphp
|
||||
|
||||
@if ($fotoObjek && Storage::exists($fotoObjek))
|
||||
<img
|
||||
src="{{ asset('storage/' . $fotoObjek) }}"
|
||||
alt="Foto Objek Pembanding {{ $loop->iteration }}"
|
||||
class="max-w-full h-auto mx-auto"
|
||||
onerror="this.src='{{ asset('default-image.png') }}'"
|
||||
>
|
||||
<p class="mt-2 text-sm">Data Pembanding {{ $loop->iteration }}</p>
|
||||
@else
|
||||
<div class="bg-gray-200 p-4 text-center">
|
||||
<p>Tidak ada gambar pembanding</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@empty
|
||||
<p class="col-span-4">Tidak ada data pembanding</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
<h4 class="mt-6">FOTO OBJEK</h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
const data = @json($dataform);
|
||||
console.log(data);
|
||||
|
||||
|
||||
</script>
|
||||
75
resources/views/component/lampiran-dokumen.blade.php
Normal file
75
resources/views/component/lampiran-dokumen.blade.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!-- New section for Lampiran Dokumen -->
|
||||
<div class="card border border-agi-100 min-w-full mt-5">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Lampiran Dokumen
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
@forelse($permohonan->lampiranDokumen as $lampiran)
|
||||
<div class="border p-4 rounded-lg">
|
||||
<h4 class="font-semibold mb-2">{{ $lampiran->nama_file }}</h4>
|
||||
<p class="text-sm text-gray-600 mb-2">Keterangan : {{ $lampiran->keterangan }}</p>
|
||||
<p class="text-sm text-gray-600 mb-2 capitalize">Jenis Lampiran : {{ str_replace('-',' ',$lampiran->jenisLampiran->nama) }}</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<a href="{{ Storage::url($lampiran->path_file) }}" target="_blank" class="text-blue-600 hover:underline">
|
||||
<i class="ki-filled ki-eye mr-2"></i>View
|
||||
</a>
|
||||
<a href="{{ Storage::url($lampiran->path_file) }}" download="{{ Storage::url($lampiran->path_file) }}" class="text-green-600 hover:underline ml-4">
|
||||
<i class="ki-filled ki-cloud-download mr-2"></i>Download
|
||||
</a>
|
||||
</div>
|
||||
@if(Auth::user()->hasRole('administrator'))
|
||||
<form action="{{ route('lampiran.delete', $lampiran->id) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this lampiran?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="text-red-600 hover:underline">
|
||||
<i class="ki-filled ki-trash mr-2"></i>Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<p class="col-span-3 text-center text-gray-500">Tidak ada lampiran dokumen.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
@if(Auth::user()->hasRole(['Penilai', 'administrator','penilai','admin','surveyor']))
|
||||
<form action="{{ route('lampiran.upload') }}" method="POST" enctype="multipart/form-data" class="mt-6">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="nama_file" class="block text-sm font-medium text-gray-700">Nama File</label>
|
||||
<input type="text" name="nama_file" id="nama_file" required class="input mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
|
||||
</div>
|
||||
<div>
|
||||
<label for="file" class="block text-sm font-medium text-gray-700">File</label>
|
||||
<input type="file" name="file" id="file" required class="file-input mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
|
||||
</div>
|
||||
<div>
|
||||
<label for="jenis_lampiran_id" class="block text-sm font-medium text-gray-700">Jenis Lampiran</label>
|
||||
<select name="jenis_lampiran_id" id="jenis_lampiran_id" required class="tomselect mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
<option value="">Pilih Jenis Lampiran</option>
|
||||
@foreach(\Modules\Lpj\Models\JenisLampiran::all() as $jenisLampiran)
|
||||
<option value="{{ $jenisLampiran->id }}">{{ $jenisLampiran->nama }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<label for="keterangan" class="block text-sm font-medium text-gray-700">Keterangan</label>
|
||||
<textarea name="keterangan" id="keterangan" rows="3" class="textarea mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Upload Lampiran
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
5
resources/views/component/logo-bag.blade.php
Normal file
5
resources/views/component/logo-bag.blade.php
Normal file
File diff suppressed because one or more lines are too long
66
resources/views/component/pdfviewer.blade.php
Normal file
66
resources/views/component/pdfviewer.blade.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<!-- Modal for PDF and Image viewing -->
|
||||
<div id="previewModal" class="fixed inset-0 bg-gray-800 bg-opacity-75 flex items-center justify-center hidden w-full z-50">
|
||||
<div class="bg-white rounded-lg overflow-hidden shadow-xl transform transition-all min-w-3xl w-[1280px] h-[768px]">
|
||||
<div class="p-4 h-full flex flex-col">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<button type="button" id="downloadBtn" class="btn btn-primary btn-sm">
|
||||
<i class="ki-duotone ki-cloud-download me-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
Download File
|
||||
</button>
|
||||
<button type="button" onclick="closePreviewModal()" class="text-2xl">
|
||||
<i class="ki-filled ki-cross-square text-red-600"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="previewContent" class="flex-grow"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('vendor/pdfobject.min.js') }}"></script>
|
||||
<script>
|
||||
let currentFileUrl = '';
|
||||
|
||||
function viewPDF(url) {
|
||||
currentFileUrl = url;
|
||||
const fileExtension = url.split('.').pop().toLowerCase();
|
||||
const previewContent = document.getElementById('previewContent');
|
||||
|
||||
if (['pdf'].includes(fileExtension)) {
|
||||
PDFObject.embed(url, "#previewContent");
|
||||
} else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {
|
||||
previewContent.innerHTML = `<img src="${url}" alt="Preview" class="max-w-full max-h-full object-contain">`;
|
||||
} else {
|
||||
previewContent.innerHTML = '<p class="text-center">Unsupported file type</p>';
|
||||
}
|
||||
|
||||
document.getElementById('previewModal').classList.remove('hidden');
|
||||
document.addEventListener('keydown', handleEscKey);
|
||||
}
|
||||
|
||||
function closePreviewModal() {
|
||||
document.getElementById('previewModal').classList.add('hidden');
|
||||
document.removeEventListener('keydown', handleEscKey);
|
||||
}
|
||||
|
||||
function handleEscKey(event) {
|
||||
if (event.key === 'Escape') {
|
||||
closePreviewModal();
|
||||
}
|
||||
}
|
||||
|
||||
// Close modal when clicking outside the content
|
||||
document.getElementById('previewModal').addEventListener('click', function(event) {
|
||||
if (event.target === this) {
|
||||
closePreviewModal();
|
||||
}
|
||||
});
|
||||
|
||||
// Download functionality
|
||||
document.getElementById('downloadBtn').addEventListener('click', function() {
|
||||
if (currentFileUrl) {
|
||||
window.open(currentFileUrl, '_blank');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
42
resources/views/component/print-out-dokument.blade.php
Normal file
42
resources/views/component/print-out-dokument.blade.php
Normal file
@@ -0,0 +1,42 @@
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@if (!empty($detail->name) && isset($detail->details) && !empty($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td width="25%"><strong>{{ $detail->name ?? '' }}</strong></td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$details = json_decode($detail->details, true);
|
||||
@endphp
|
||||
|
||||
@if (is_array($details) && count($details) > 0)
|
||||
@foreach ($details as $value)
|
||||
@if (is_array($value))
|
||||
@foreach ($value as $key => $item)
|
||||
@if (!empty($item))
|
||||
<tr>
|
||||
<td style="padding: 2px;">
|
||||
{{ formatLabel($key) }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px;">
|
||||
@if (strpos(strtolower($key), 'tanggal') !== false)
|
||||
{{ formatTanggalIndonesia($item) }}
|
||||
@else
|
||||
{{ $item }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<span>m²</span>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
63
resources/views/component/signature-pad.blade.php
Normal file
63
resources/views/component/signature-pad.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<style>
|
||||
.signature-pad-container canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.signature-pad-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.signature-pad {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
aspect-ratio: 2/1;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="signature-pad-container mx-auto border p-4 max-w-md sm:max-w-lg lg:max-w-xl">
|
||||
<h3 class="signature-title text-md sm:text-lg mb-2 uppercase">{{ ucfirst($type) }}</h3>
|
||||
<div class="w-full aspect-w-2 aspect-h-1">
|
||||
<canvas
|
||||
id="signature-pad-{{ $type }}"
|
||||
class="signature-pad w-full h-full bg-white border rounded"
|
||||
></canvas>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="input w-full border p-2 mt-2 rounded"
|
||||
name="name-{{ $type }}"
|
||||
id="name-{{ $type }}"
|
||||
placeholder="Enter your name"
|
||||
/>
|
||||
<div class="button-container flex justify-between py-4">
|
||||
<button
|
||||
type="button"
|
||||
id="save-{{ $type }}"
|
||||
class="btn btn-primary px-4 py-2 rounded "
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="clear-{{ $type }}"
|
||||
class="btn btn-light px-4 py-2 rounded"
|
||||
>
|
||||
Clear
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="delete-{{ $type }}"
|
||||
class="btn btn-danger text-white px-4 py-2 rounded hover:bg-red-600"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
<div id="status-{{ $type }}" class="status-message text-sm text-gray-600 mt-2"></div>
|
||||
</div>
|
||||
91
resources/views/custom_fields/create.blade.php
Normal file
91
resources/views/custom_fields/create.blade.php
Normal file
@@ -0,0 +1,91 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($customField->id))
|
||||
<form action="{{ route('basicdata.custom-field.update', $customField->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $customField->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.custom-field.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($customField->id) ? 'Edit' : 'Tambah' }} Custom Field
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.custom-field.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $customField->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Label
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('label') border-danger bg-danger-light @enderror" type="text" name="label" value="{{ $customField->label ?? '' }}">
|
||||
@error('label')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Type
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input @error('type') border-danger bg-danger-light @enderror" name="type">
|
||||
<option value="text" {{ (isset($customField->type) && $customField->type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="radio" {{ (isset($customField->type) && $customField->type == 'radio') ? 'selected' : '' }}>Radio</option>
|
||||
<option value="select" {{ (isset($customField->type) && $customField->type == 'select') ? 'selected' : '' }}>Select</option>
|
||||
<option value="checkbox" {{ (isset($customField->type) && $customField->type == 'checkbox') ? 'selected' : '' }}>Checkbox</option>
|
||||
<option value="date" {{ (isset($customField->type) && $customField->type == 'date') ? 'selected' : '' }}>Date</option>
|
||||
<option value="number" {{ (isset($customField->type) && $customField->type == 'number') ? 'selected' : '' }}>Number</option>
|
||||
</select>
|
||||
@error('type')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Urutan Prioritas
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('urutan_prioritas') border-danger bg-danger-light @enderror" type="number" name="urutan_prioritas" value="{{ $customField->urutan_prioritas ?? $urutan_prioritas }}">
|
||||
@error('urutan_prioritas')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
153
resources/views/custom_fields/index.blade.php
Normal file
153
resources/views/custom_fields/index.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.custom-field') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="custom-field-table" data-api-url="{{ route('basicdata.custom-field.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Custom Field
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Custom Field" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.custom-field.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.custom-field.create') }}"> Tambah Custom Field </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Custom Field </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="type">
|
||||
<span class="sort"> <span class="sort-label"> Type </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="urutan_prioritas">
|
||||
<span class="sort"> <span class="sort-label"> Urutan Prioritas </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/custom-field/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#custom-field-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
label: {
|
||||
title: 'Custom Field',
|
||||
},
|
||||
type: {
|
||||
title: 'Type',
|
||||
},
|
||||
urutan_prioritas: {
|
||||
title: 'Urutan Prioritas',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/custom-field/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
346
resources/views/debitur/components/debitur.blade.php
Normal file
346
resources/views/debitur/components/debitur.blade.php
Normal file
@@ -0,0 +1,346 @@
|
||||
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" id="debitur-form" class="grid gap-5">
|
||||
@if(isset($debitur->id))
|
||||
<input type="hidden" name="id" value="{{ $debitur->id }}">
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
Cabang
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(auth()->user()->hasRole('administrator'))
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id">
|
||||
<option value="">Pilih Cabang</option>
|
||||
@foreach($branches as $branch)
|
||||
<option value="{{ $branch->id }}" {{ (isset($debitur) && $branch->id == $debitur->branch_id) || (old('branch_id') == $branch->id) ? 'selected' : '' }}>
|
||||
{{ $branch->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input type="hidden" name="branch_id" value="{{ auth()->user()->branch_id }}">
|
||||
<input type="text" class="input w-full" value="{{ auth()->user()->branch->name }}" readonly>
|
||||
@endif
|
||||
@error('branch_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
CIF
|
||||
<span class="text-danger">
|
||||
*
|
||||
</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" id="cif" name="cif" value="{{ $debitur->cif ?? '0000000000' }}">
|
||||
@error('cif')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Rekening
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_rekening') border-danger bg-danger-light @enderror" type="number" name="nomor_rekening" value="{{ $debitur->nomor_rekening ?? '' }}">
|
||||
@error('nomor_rekening')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
Nama Debitur
|
||||
<span class="text-danger">
|
||||
*
|
||||
</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input required class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $debitur->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
NPWP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number" name="npwp" value="{{ $debitur->npwp ?? '' }}">
|
||||
@error('npwp')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Email
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email" name="email" value="{{ $debitur->email ?? '' }}">
|
||||
@error('email')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
No Handphone
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number" name="phone" value="{{ $debitur->phone ?? '' }}">
|
||||
@error('phone')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
Alamat
|
||||
<span class="text-danger">
|
||||
*
|
||||
</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select required id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Province</option>
|
||||
@foreach($provinces as $province)
|
||||
@if(isset($debitur))
|
||||
<option value="{{ $province->code }}" {{ isset($debitur->province_code) && $debitur->province_code == $province->code?'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $province->code }}">
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('province_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select required id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select City</option>
|
||||
@if(isset($cities))
|
||||
@foreach($cities as $city)
|
||||
@if(isset($debitur))
|
||||
<option value="{{ $city->code }}" {{ isset($debitur->city_code) && $debitur->city_code == $city->code?'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $city->code }}">
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('city_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select required id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select District</option>
|
||||
@if(isset($districts))
|
||||
@foreach($districts as $district)
|
||||
@if(isset($debitur))
|
||||
<option value="{{ $district->code }}" {{ isset($debitur->district_code) && $debitur->district_code == $district->code?'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $district->code }}">
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select required id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Village</option>
|
||||
@if(isset($villages))
|
||||
@foreach($villages as $village)
|
||||
@if(isset($debitur))
|
||||
<option value="{{ $village->code }}" {{ isset($debitur->village_code) && $debitur->village_code == $village->code?'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $village->code }}">
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input required class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code">
|
||||
@error('postal_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row w-full mt-2 lg:mt-5">
|
||||
<textarea required class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" id="address" name="address" placeholder="Alamat Lengkap">{{ $debitur->address ?? '' }}</textarea>
|
||||
@error('address')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary" id="submit">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const form = document.getElementById('debitur-form');
|
||||
const nameInput = form.querySelector('input[name="name"]');
|
||||
const provinceSelect = form.querySelector('#province_code');
|
||||
const citySelect = form.querySelector('#city_code');
|
||||
const districtSelect = form.querySelector('#district_code');
|
||||
const villageSelect = form.querySelector('#village_code');
|
||||
const postalCodeInput = form.querySelector('#postal_code');
|
||||
const addressTextarea = form.querySelector('#address');
|
||||
const branchSelect = document.getElementById('branch_id');
|
||||
const cifInput = document.getElementById('cif');
|
||||
const submitButton = document.getElementById('submit');
|
||||
|
||||
function validateField(field, errorMessage) {
|
||||
const value = field.value.trim();
|
||||
if (value.length === 0) {
|
||||
field.classList.add('border-danger', 'bg-danger-light');
|
||||
const existingError = field.parentElement.querySelector('.alert.text-danger');
|
||||
if (!existingError) {
|
||||
const em = document.createElement('em');
|
||||
em.className = 'alert text-danger text-sm';
|
||||
em.textContent = errorMessage;
|
||||
field.parentElement.appendChild(em);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
field.classList.remove('border-danger', 'bg-danger-light');
|
||||
const existingError = field.parentElement.querySelector('.alert.text-danger');
|
||||
if (existingError) {
|
||||
existingError.remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function validateBranch() {
|
||||
return validateField(branchSelect, 'Cabang is required');
|
||||
}
|
||||
|
||||
function validateCIF() {
|
||||
return validateField(cifInput, 'CIF is required');
|
||||
}
|
||||
|
||||
function validateName() {
|
||||
return validateField(nameInput, 'Nama Debitur is required');
|
||||
}
|
||||
|
||||
function validateProvince() {
|
||||
return validateField(provinceSelect, 'Province is required');
|
||||
}
|
||||
|
||||
function validateCity() {
|
||||
return validateField(citySelect, 'City is required');
|
||||
}
|
||||
|
||||
function validateDistrict() {
|
||||
return validateField(districtSelect, 'District is required');
|
||||
}
|
||||
|
||||
function validateVillage() {
|
||||
return validateField(villageSelect, 'Village is required');
|
||||
}
|
||||
|
||||
function validatePostalCode() {
|
||||
return validateField(postalCodeInput, 'Postal Code is required');
|
||||
}
|
||||
|
||||
function validateAddress() {
|
||||
return validateField(addressTextarea, 'Address is required');
|
||||
}
|
||||
|
||||
nameInput.addEventListener('blur', validateName);
|
||||
nameInput.addEventListener('input', validateName);
|
||||
provinceSelect.addEventListener('change', validateProvince);
|
||||
citySelect.addEventListener('change', validateCity);
|
||||
districtSelect.addEventListener('change', validateDistrict);
|
||||
villageSelect.addEventListener('change', validateVillage);
|
||||
postalCodeInput.addEventListener('blur', validatePostalCode);
|
||||
postalCodeInput.addEventListener('input', validatePostalCode);
|
||||
addressTextarea.addEventListener('blur', validateAddress);
|
||||
addressTextarea.addEventListener('input', validateAddress);
|
||||
branchSelect.addEventListener('change', validateVillage);
|
||||
cifInput.addEventListener('blur', validateCIF);
|
||||
cifInput.addEventListener('input', validateName);
|
||||
|
||||
function validateAllFields() {
|
||||
const isValid =
|
||||
validateBranch() &&
|
||||
validateCIF() &&
|
||||
validateName() &&
|
||||
validateProvince() &&
|
||||
validateCity() &&
|
||||
validateDistrict() &&
|
||||
validateVillage() &&
|
||||
validatePostalCode() &&
|
||||
validateAddress();
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
form.addEventListener('submit', function (event) {
|
||||
const isValid =
|
||||
validateBranch() &&
|
||||
validateCIF() &&
|
||||
validateName() &&
|
||||
validateProvince() &&
|
||||
validateCity() &&
|
||||
validateDistrict() &&
|
||||
validateVillage() &&
|
||||
validatePostalCode() &&
|
||||
validateAddress();
|
||||
|
||||
if (!isValid) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
submitButton.addEventListener('click', function (event) {
|
||||
if (!validateAllFields()) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
915
resources/views/debitur/components/dokumen.blade.php
Normal file
915
resources/views/debitur/components/dokumen.blade.php
Normal file
@@ -0,0 +1,915 @@
|
||||
<form action="{{ isset($document->id) ? route('debitur.jaminan.update', ['id'=>$debitur->id,'jaminan'=>$document->id]) : route('debitur.jaminan.store',$debitur->id) }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($document->id))
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $document->permohonan_id ?? request()->get('permohonan_id') }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="debiture_id" value="{{ $debitur->id ?? '' }}">
|
||||
<p class="text-base text-gray-700">
|
||||
{{ $debitur->name }} |
|
||||
{{ formatAlamat($debitur) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Permohonan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="text-base text-gray-700 font-bold">
|
||||
{{ $permohonan->nomor_registrasi ?? "-" }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pemilik Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select onchange="changePemilikJaminan()" class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="pemilik_jaminan_id" id="pemilik_jaminan_id">
|
||||
<option value="">Pilih Pemilik Jaminan</option>
|
||||
<option value="0">Sama Dengan Debitur</option>
|
||||
<option value="00">Tidak Sama Dengan Debitur</option>
|
||||
@if(isset($pemilikJaminan))
|
||||
@foreach($pemilikJaminan as $pemilik)
|
||||
@if(isset($document))
|
||||
<option value="{{ $pemilik->id }}" {{ isset($document->pemilik_jaminan_id) && $document->pemilik_jaminan_id == $pemilik->id?'selected' : '' }}>
|
||||
{{ $pemilik->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $pemilik->id }}">
|
||||
{{ $pemilik->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('pemilik_jaminan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<fieldset id="pemilik_jaminan" class="hidden border border-solid border-gray-300 p-3 w-full mt-5 grid gap-5">
|
||||
<legend class="text-sm">Pemilik Jaminan</legend>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Hubungan Pemilik Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="hubungan_pemilik_jaminan_id" id="hubungan_pemilik_jaminan_id">
|
||||
<option value="">Pilih Hubungan Pemilik Jaminan</option>
|
||||
@if(isset($hubunganPemilik))
|
||||
@foreach($hubunganPemilik as $hubungan)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $hubungan->id }}" {{ isset($pemilik->hubungan_pemilik_jaminan_id) && $pemilik->hubungan_pemilik_jaminan_id == $hubungan->id?'selected' : '' }}>
|
||||
{{ $hubungan->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $hubungan->id }}">
|
||||
{{ $hubungan->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('hubungan_pemilik_jaminan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('pemilik_name') border-danger bg-danger-light @enderror" type="text " id="pemilik_name" name="pemilik_name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
|
||||
@error('pemilik_name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
|
||||
@error('nomor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nama_sertifikat">
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_sertifikat" class="btn btn-primary btn-xs">Tambah Nama di Sertifikat</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(isset($document->id))
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ $document->jenis_jaminan_id }}">
|
||||
@endif
|
||||
<select onchange="getLegalitasJaminan()" class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
|
||||
<option value="">Pilih Jenis Jaminan</option>
|
||||
@foreach($jenisJaminan as $row)
|
||||
@if(isset($document))
|
||||
<option value="{{ $row->id }}" {{ isset($document->jenis_jaminan_id) && $document->jenis_jaminan_id == $row->id?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">{{ $row->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('jenis_jaminan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Alamat
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Province</option>
|
||||
@foreach($provinces as $province)
|
||||
@if(isset($document))
|
||||
<option value="{{ $province->code }}" {{ isset($document->province_code) && $document->province_code == $province->code?'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $province->code }}">
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endif
|
||||
;
|
||||
@endforeach
|
||||
</select>
|
||||
@error('province_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select City</option>
|
||||
@if(isset($cities))
|
||||
@foreach($cities as $city)
|
||||
@if(isset($document))
|
||||
<option value="{{ $city->code }}" {{ isset($document->city_code) && $document->city_code == $city->code?'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $city->code }}">
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('city_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select District</option>
|
||||
@if(isset($districts))
|
||||
@foreach($districts as $district)
|
||||
@if(isset($document))
|
||||
<option value="{{ $district->code }}" {{ isset($document->district_code) && $document->district_code == $district->code?'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $district->code }}">
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Village</option>
|
||||
@if(isset($villages))
|
||||
@foreach($villages as $village)
|
||||
@if(isset($document))
|
||||
<option value="{{ $village->code }}" {{ isset($document->village_code) && $document->village_code == $village->code?'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $village->code }}">
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $document->postal_code ?? '' }}" placeholder="Postal Code">
|
||||
@error('postal_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row w-full mt-2 lg:mt-5">
|
||||
<textarea class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" type="number" id="address" name="address">{{ $document->address ?? '' }}</textarea>
|
||||
@error('address')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
@if(isset($document->id))
|
||||
@php $n = 0; $p_index = 0; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="{{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="clearDetail({{ $detail->id }})">
|
||||
<i class="ki-duotone ki-trash-square fs-2">
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
<span class="path3"></span>
|
||||
<span class="path4"></span>
|
||||
</i>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
<div id="document-container-{{ $n }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
@endphp
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex flex-col w-full gap-2 custom-field-set" id="document_container_{{ $p_index }}">
|
||||
<div class="flex items-start gap-2 mt-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen" value="{{ $dokumen_nomor[$index] ?? '' }}">
|
||||
<span class="flex-1">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
<input type="hidden" name="dokumen_jaminan[{{ $n }}][]" value="{{ $dokumen }}">
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</span>
|
||||
<button type="button" class="flex-none btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 custom-field">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
$fieldValue = json_decode($detail->details)[$index]->{$customField->name} ?? '';
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label ?? "" }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">{{ $fieldValue }}</textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}" {{ $fieldValue == $option ? 'selected' : '' }}>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@else
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
@php $p_index++; @endphp
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{$n}},{{ $detail->jenisLegalitasJaminan->id }})">Add File</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
<div class="flex items-start gap-2 mt-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumenss">
|
||||
<span class="flex-1">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
</span>
|
||||
</div>
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{ $n }},{{ $detail->jenisLegalitasJaminan->id }})">Add File</button>
|
||||
</div>
|
||||
@php $p_index++; @endphp
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]">{{ $detail->keterangan ?? "" }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
|
||||
@if($legalitas)
|
||||
@foreach($legalitas as $item)
|
||||
<div id="document-container-{{ $n }}">
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $item->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $item->id }}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
</div>
|
||||
|
||||
@if($item->custom_fields)
|
||||
@foreach($item->custom_fields as $field)
|
||||
@php $custom_field = getCustomField($field) @endphp
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $custom_field->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($custom_field->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($custom_field->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{ $n }}, {{ $item->id }})">Add File</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++;$p_index++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@push('scripts')
|
||||
{{--Pemilik Jaminan--}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners() {
|
||||
document.querySelectorAll(".delete-button").forEach(button => {
|
||||
button.addEventListener("click", function () {
|
||||
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners();
|
||||
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function () {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_sertifikat[name][]" value="" placeholder="Nama Pemilik Jaminan">
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="number" name="detail_sertifikat[nomor_id][]" value="" placeholder="Nomor ID/KTP">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
namaSertifikatDiv.appendChild(newDiv);
|
||||
|
||||
// Add delete listener to the new button
|
||||
addDeleteListeners();
|
||||
});
|
||||
});
|
||||
|
||||
function changePemilikJaminan() {
|
||||
var pemilikJaminan = document.getElementById("pemilik_jaminan_id").value;
|
||||
var fieldsetPemilikJaminan = document.getElementById("pemilik_jaminan");
|
||||
if (pemilikJaminan === "00") {
|
||||
fieldsetPemilikJaminan.classList.remove("hidden");
|
||||
} else {
|
||||
fieldsetPemilikJaminan.classList.add("hidden");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{{--Legalitas Jaminan--}}
|
||||
<script>
|
||||
function getCustomFields(jenisLegalitasJaminanId, index, newFieldIndex) {
|
||||
return fetch(`/basic-data/jenis-jaminan/custom-fields/${jenisLegalitasJaminanId}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(customFields => {
|
||||
let customFieldsHtml = '';
|
||||
customFields.forEach(field => {
|
||||
customFieldsHtml += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-2 custom-field">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(index, field.type, field.name, null, jenisLegalitasJaminanId, newFieldIndex)}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
return customFieldsHtml;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error fetching custom fields:", error);
|
||||
return '';
|
||||
});
|
||||
}
|
||||
|
||||
function getLegalitasJaminan() {
|
||||
var legalitasJaminan = document.getElementById("jenis_jaminan_id").value;
|
||||
var documentId = "{{ $document->id ?? "0" }}";
|
||||
var debiturId = "{{ $debitur->id }}";
|
||||
var url = `/basic-data/jenis-jaminan/legalitas/${documentId}/${legalitasJaminan}`;
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
var doctainer = document.getElementById("doctainer");
|
||||
doctainer.innerHTML = "";
|
||||
data.forEach((item, index) => {
|
||||
console.log(item);
|
||||
doctainer.innerHTML += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
${index + 1}. ${item.name}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}">
|
||||
${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ""}
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="name[]" value="${item.name || ""}" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
<div id="document-container-${index}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="document_container">
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
|
||||
|
||||
<div class="flex items-center gap-2 my-2 w-full">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
</div>
|
||||
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-2 custom-field">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(index, field.type, field.name, item.details, item.jenis_legalitas_jaminan_id, 0)}
|
||||
</div>
|
||||
</div>
|
||||
`).join('') : ""}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput(${index},${item.jenis_legalitas_jaminan_id})">Add File</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ""}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
})
|
||||
.catch(error => console.error("Error:", error));
|
||||
}
|
||||
|
||||
function addFileInput(index, jenisLegalitasJaminanId = null) {
|
||||
const documentContainer = document.getElementById(`document-container-${index}`);
|
||||
const container = documentContainer.querySelector('#document_container');
|
||||
|
||||
const customFields = container.querySelectorAll('.custom-field');
|
||||
|
||||
|
||||
// Get the current number of custom field sets
|
||||
const currentFieldSets = container.querySelectorAll('.custom-field-set').length;
|
||||
const newFieldIndex = currentFieldSets + 1;
|
||||
|
||||
const newInput = document.createElement("div");
|
||||
newInput.className = "flex flex-col w-full gap-2 mb-4 custom-field-set";
|
||||
|
||||
getCustomFields(jenisLegalitasJaminanId, index, newFieldIndex).then(customFieldsHtml => {
|
||||
newInput.innerHTML = `
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex items-center gap-2 w-full">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-danger text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
${customFieldsHtml}
|
||||
`;
|
||||
|
||||
container.appendChild(newInput);
|
||||
});
|
||||
}
|
||||
|
||||
function removeFileInput(button) {
|
||||
button.closest(".custom-field-set").remove();
|
||||
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) {
|
||||
if (typeof dokumenJaminan === "string" && typeof dokumenNomor === "string") {
|
||||
return `
|
||||
<div class="flex w-full lg:w-[30%]">
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor}</span>
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
|
||||
${dokumenJaminan.split("/").pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
} else if (typeof dokumenJaminan === "string" && dokumenNomor === null) {
|
||||
return `
|
||||
<div class="flex w-full lg:w-[30%]">
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : --</span>
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
|
||||
${dokumenJaminan.split("/").pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
} else if (Array.isArray(dokumenJaminan) && Array.isArray(dokumenNomor)) {
|
||||
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor[index] || "N/A"}</span>
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split("/").pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a></div>
|
||||
`).join("");
|
||||
} else if (Array.isArray(dokumenJaminan) && typeof dokumenNomor === "string") {
|
||||
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split("/").pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a></div>
|
||||
`).join("");
|
||||
} else if (Array.isArray(dokumenJaminan) && dokumenNomor === "null") {
|
||||
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split("/").pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a></div>
|
||||
`).join("");
|
||||
}
|
||||
return dokumenNomor;
|
||||
}
|
||||
|
||||
function getCustomFieldInput(index, type, fieldName, value, itemId, fieldIndex = 0) {
|
||||
value = value ? JSON.parse(value)[fieldName] || "" : "";
|
||||
switch (type) {
|
||||
case "text":
|
||||
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "number":
|
||||
return `<input class="input" type="number" step="0.01" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "date":
|
||||
return `<input class="input" type="date" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "textarea":
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[${index}][${fieldIndex}][${fieldName}]">${value}</textarea>`;
|
||||
default:
|
||||
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
}
|
||||
}
|
||||
|
||||
function clearDetail(detailId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Anda akan menghapus detail ini!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, yakin!',
|
||||
cancelButtonText: 'Batal'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Data yang telah di hapus tidak dapat di kembalikan",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, hapus!',
|
||||
cancelButtonText: 'Batal'
|
||||
}).then((result2) => {
|
||||
if (result2.isConfirmed) {
|
||||
// Hapus input fields
|
||||
$(`input[name="detail_dokumen_jaminan_id[]"][value="${detailId}"]`).closest('.grid.gap-5').remove();
|
||||
|
||||
// Kirim request AJAX untuk menghapus data dari database
|
||||
$.ajax({
|
||||
url: '{{ route("debitur.jaminan.clearDetail", $debitur->id ) }}',
|
||||
type: 'POST',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}',
|
||||
detail_id: detailId
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: 'Detail berhasil dihapus',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Gagal!',
|
||||
text: 'Detail gagal dihapus',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
Swal.fire({
|
||||
title: 'Gagal!',
|
||||
text: 'Terjadi kesalahan saat menghapus detail',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
227
resources/views/debitur/components/jaminan.blade.php
Normal file
227
resources/views/debitur/components/jaminan.blade.php
Normal file
@@ -0,0 +1,227 @@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 lg:gap-7.5">
|
||||
@foreach($documents as $document)
|
||||
<div class="card border border-agi-100 flex flex-col gap-5 p-5 lg:p-7.5">
|
||||
<div class="flex items-center flex-wrap justify-between gap-1">
|
||||
<div class="flex items-center gap-2.5">
|
||||
<div class="relative size-[44px] shrink-0">
|
||||
<svg class="w-full h-full stroke-primary-clarity fill-primary-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
|
||||
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
|
||||
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill="">
|
||||
</path>
|
||||
<path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
|
||||
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
|
||||
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke="">
|
||||
</path>
|
||||
</svg>
|
||||
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
|
||||
<i class="ki-filled ki-add-files text-1.5xl text-primary">
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="menu inline-flex" data-menu="true">
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.bulk.download',['id' => $debitur->id,'jaminan' => $document->id]) }}" class="btn btn-sm btn-icon btn-dark">
|
||||
<i class="ki-outline ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('debitur.jaminan.edit',array_merge(request()->query(),['id' => $debitur->id,'jaminan' => $document->id])) }}" class="btn btn-sm btn-icon btn-outline btn-info">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData({{ $document->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="flex items-center justify-between flex-wrap mb-3.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
Nomor Permohonan
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px] font-bold">
|
||||
{{ $document->permohonan->nomor_registrasi ?? "-" }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
pemilik jaminan
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $document->pemilik->name }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
alamat
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ formatAlamat($document) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
dokumen jaminan
|
||||
</span>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@foreach($document->detail as $detail)
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
<strong>{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}</strong>
|
||||
</span>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
$count_jaminan = 0;
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
|
||||
</span>
|
||||
<div>
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($detail->details))
|
||||
@if(isset(json_decode($detail->details)[$index]))
|
||||
@foreach (json_decode($detail->details)[$index] as $key => $value)
|
||||
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ str_replace("_"," ",$key) ?? "" }}
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $value }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
keterangan
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $detail->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed mb-3.5">
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<style>
|
||||
.add-new-bg {
|
||||
background-image: url('/assets/media/images/2600x1200/bg-4.png');
|
||||
}
|
||||
|
||||
.dark .add-new-bg {
|
||||
background-image: url('/assets/media/images/2600x1200/bg-4-dark.png');
|
||||
}
|
||||
</style>
|
||||
@if(request()->get('permohonan_id'))
|
||||
<a class="card border border-agi-100 border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.jaminan.create',array_merge(request()->query(),['id'=>$debitur->id])) }}">
|
||||
<div class="card-body grid items-center">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex justify-center pt-5">
|
||||
<div class="relative size-[60px] shrink-0">
|
||||
<svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
|
||||
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
|
||||
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill="">
|
||||
</path>
|
||||
<path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
|
||||
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
|
||||
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke="">
|
||||
</path>
|
||||
</svg>
|
||||
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
|
||||
<i class="ki-filled ki-additem text-2xl text-brand">
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col text-center">
|
||||
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
|
||||
Data Jaminan
|
||||
</span>
|
||||
<span class="text-2sm font-normal text-gray-600">
|
||||
Tambah Pemilik dan Dokumen Jaminan
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You won't be able to revert this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`debitur/{{$debitur->id}}}/jaminan/${data}`, {
|
||||
type: "DELETE"
|
||||
}).then((response) => {
|
||||
swal.fire("Deleted!", "Document Jaminan has been deleted.", "success").then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error("Error:", error);
|
||||
Swal.fire("Error!", "An error occurred while deleting the file.", "error");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
171
resources/views/debitur/components/pemilik.blade.php
Normal file
171
resources/views/debitur/components/pemilik.blade.php
Normal file
@@ -0,0 +1,171 @@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-5 lg:gap-7.5">
|
||||
@foreach($pemilikJaminan as $pemilik)
|
||||
<div class="card border border-agi-100 flex flex-col gap-5 p-5 lg:p-7.5">
|
||||
<div class="flex items-center flex-wrap justify-between gap-1">
|
||||
<div class="flex items-center gap-2.5">
|
||||
<div class="relative size-[44px] shrink-0">
|
||||
<svg class="w-full h-full stroke-primary-clarity fill-primary-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
|
||||
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
|
||||
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill="">
|
||||
</path>
|
||||
<path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
|
||||
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
|
||||
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke="">
|
||||
</path>
|
||||
</svg>
|
||||
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
|
||||
<i class="ki-filled ki-user-tick text-1.5xl text-primary">
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<a class="text-md font-semibold text-gray-900 hover:text-primary-active mb-px" href="/metronic/tailwind/demo1/public-profile/profiles/creator">
|
||||
{{ $pemilik->name }}
|
||||
</a>
|
||||
<span class="text-2sm font-medium text-gray-600">
|
||||
{{ $pemilik->hubungan_pemilik->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu inline-flex" data-menu="true">
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a href="{{ route('debitur.pemilik.edit',['id' => $debitur->id,'pemilik' => $pemilik->id]) }}" class="btn btn-sm btn-icon btn-outline btn-info">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData({{ $pemilik->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="flex items-center justify-between flex-wrap mb-3.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
nomor id/ktp
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $pemilik->nomor_id }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
npwp
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $pemilik->npwp }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
nomor telepon
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $pemilik->phone }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
Email
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $pemilik->email }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed mb-3.5">
|
||||
</div>
|
||||
<div class="flex items-start justify-between flex-wrap gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
alamat
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $pemilik->address ?? '' }}, {{ $pemilik->village->name ?? ''}}, {{ $pemilik->city->name ?? ''}}, {{ $pemilik->province->name ?? '' }}, {{ $pemilik->postal_code ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<style>
|
||||
.add-new-bg {
|
||||
background-image: url('/assets/media/images/2600x1200/bg-4.png');
|
||||
}
|
||||
|
||||
.dark .add-new-bg {
|
||||
background-image: url('/assets/media/images/2600x1200/bg-4-dark.png');
|
||||
}
|
||||
</style>
|
||||
<a class="card border border-agi-100 border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.pemilik.create',$debitur->id) }}">
|
||||
<div class="card-body grid items-center">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex justify-center pt-5">
|
||||
<div class="relative size-[60px] shrink-0">
|
||||
<svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
|
||||
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
|
||||
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z" fill="">
|
||||
</path>
|
||||
<path d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
|
||||
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
|
||||
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z" stroke="">
|
||||
</path>
|
||||
</svg>
|
||||
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
|
||||
<i class="ki-filled ki-user-edit text-2xl text-brand">
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col text-center">
|
||||
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
|
||||
Pemilik Jaminan
|
||||
</span>
|
||||
<span class="text-2sm font-normal text-gray-600">
|
||||
Tambah Pemilik
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`debitur/{{$debitur->id}}}/pemilik/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Pemilik Jaminan has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
28
resources/views/debitur/create.blade.php
Normal file
28
resources/views/debitur/create.blade.php
Normal file
@@ -0,0 +1,28 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($debitur->id) ? 'Edit' : 'Tambah' }} Debitur
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@if(isset($debitur->id))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
|
||||
@endif
|
||||
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('lpj::debitur.components.debitur')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
44
resources/views/debitur/edit.blade.php
Normal file
44
resources/views/debitur/edit.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
@if(request()->get('permohonan_id'))
|
||||
<a href="{{ route('permohonan.edit',['permohonan'=>request()->get('permohonan_id')]) }}" class="btn btn-xs {{ request()->routeIs('permohonan.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Permohonan</a>
|
||||
@endif
|
||||
<a href="{{ route('debitur.edit',array_merge(request()->query(),['debitur'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Debitur</a>
|
||||
<a href="{{ route('debitur.jaminan.index',array_merge(request()->query(),['id'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.jaminan.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Dokumen Jaminan</a>
|
||||
<a href="{{ route('debitur.pemilik.index',array_merge(request()->query(),['id'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.pemilik.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Pemilk Jaminan</a>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
@if(isset($debitur->id) && request()->get('permohonan_id') == null)
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
|
||||
@endif
|
||||
|
||||
@if(request()->get('from') == 'permohonan')
|
||||
<a href="{{ route('permohonan.create') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@elseif(request()->get('permohonan_id'))
|
||||
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@else
|
||||
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(request()->routeIs('debitur.edit', $debitur))
|
||||
@include('lpj::debitur.components.debitur')
|
||||
@elseif(request()->routeIs('debitur.pemilik.index', $debitur))
|
||||
@include('lpj::debitur.components.pemilik')
|
||||
@else
|
||||
@include('lpj::debitur.components.jaminan')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
230
resources/views/debitur/index.blade.php
Normal file
230
resources/views/debitur/index.blade.php
Normal file
@@ -0,0 +1,230 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('debitur') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="debitur-table" data-api-url="{{ route('debitur.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Debitur
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Debitur" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('debitur.export') }}"> Export to Excel </a>
|
||||
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('debitur.create') }}"> Tambah Debitur </a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> Cif </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="nomor_rekening">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Rekening </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="nomor_id">
|
||||
<span class="sort"> <span class="sort-label"> Nomor ID </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="npwp">
|
||||
<span class="sort"> <span class="sort-label"> NPWP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="email">
|
||||
<span class="sort"> <span class="sort-label"> Email </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="phone">
|
||||
<span class="sort"> <span class="sort-label"> Phone </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="address">
|
||||
<span class="sort"> <span class="sort-label"> Alamat </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const userRoles = @json(auth()->user()->roles->pluck('name'));
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
})
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`debitur/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
Swal.fire('Error!', error.responseJSON.message, 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#debitur-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
cif: {
|
||||
title: 'CIF',
|
||||
},
|
||||
nomor_rekening: {
|
||||
title: 'Nomor Rekening',
|
||||
},
|
||||
name: {
|
||||
title: 'Debitur',
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
render: (item, data, context) => {
|
||||
return `${data.branch.name}`;
|
||||
},
|
||||
},
|
||||
nomor_id: {
|
||||
title: 'Nomor ID',
|
||||
},
|
||||
npwp: {
|
||||
title: 'NPWP',
|
||||
},
|
||||
email: {
|
||||
title: 'Email',
|
||||
},
|
||||
phone: {
|
||||
title: 'Phone',
|
||||
},
|
||||
address: {
|
||||
title: 'Alamat',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let actionHtml = `<div class="flex flex-nowrap justify-center">`;
|
||||
|
||||
// Fungsi helper untuk memeriksa peran
|
||||
const hasRole = (roles) => roles.some(role => userRoles.includes(role));
|
||||
|
||||
// Fungsi helper untuk memeriksa status permohonan
|
||||
const hasValidStatus = (permohonan) => ['order', 'revisi'].includes(permohonan.status);
|
||||
|
||||
// Periksa apakah permohonan ada dan merupakan array
|
||||
const permohonanArray = Array.isArray(data.permohonan) ? data.permohonan : [];
|
||||
|
||||
// Periksa apakah ada setidaknya satu permohonan dengan status yang valid
|
||||
const hasAnyValidPermohonan = permohonanArray.some(hasValidStatus);
|
||||
|
||||
if (hasRole(['administrator']) && hasAnyValidPermohonan || data.permohonan.length < 1) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="/debitur/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if (hasRole(['administrator', 'pemohon-ao']) && data.permohonan.length < 1) {
|
||||
actionHtml += `
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
actionHtml += `</div>`;
|
||||
return actionHtml;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
dataTable.showSpinner();
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
30
resources/views/debitur/jaminan.blade.php
Normal file
30
resources/views/debitur/jaminan.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($document->id) ? 'Edit' : 'Tambah' }} Data Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@if (Auth::user()->roles[0]->name === 'admin')
|
||||
<a href="{{ url()->previous() }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('debitur.jaminan.index',$debitur->id) }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('lpj::debitur.components.dokumen')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
118
resources/views/emails/jadwal-kunjungan.blade.php
Normal file
118
resources/views/emails/jadwal-kunjungan.blade.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Jadwal Kunjungan</title>
|
||||
<style>
|
||||
body {
|
||||
background-color: #f3f4f6;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.email-container {
|
||||
max-width: 42rem;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.header {
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
padding-bottom: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #4b5563;
|
||||
margin: 0.25rem 0 0 0;
|
||||
}
|
||||
|
||||
.content-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.content-row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 8rem;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #111827;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 2rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid #e5e7eb;
|
||||
font-size: 0.875rem;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.content-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.label {
|
||||
margin-bottom: 0.5rem;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<!-- Header -->
|
||||
<div class="header">
|
||||
<h1 class="title">Jadwal Kunjungan Penilaian</h1>
|
||||
<p class="subtitle">Dikirim melalui Sistem Penilaian</p>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="content">
|
||||
<div class="content-row">
|
||||
<span class="label">ID Penilaian:</span>
|
||||
<span class="value">{{ $id }}</span>
|
||||
</div>
|
||||
|
||||
<div class="content-row">
|
||||
<span class="label">Waktu Penilaian:</span>
|
||||
<span class="value">{{ \Carbon\Carbon::parse($waktu_penilaian)->format('d F Y H:i') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="content-row">
|
||||
<span class="label">Deskripsi:</span>
|
||||
<p class="value">{{ $deskripsi_penilaian }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="footer">
|
||||
<p>Email ini dikirim secara otomatis, mohon tidak membalas email ini.</p>
|
||||
<p style="margin-top: 0.5rem;">© {{ date('Y') }} Sistem Penilaian. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
47
resources/views/hubungan_pemilik_jaminan/create.blade.php
Normal file
47
resources/views/hubungan_pemilik_jaminan/create.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($hubunganPemilikJaminan->id))
|
||||
<form action="{{ route('basicdata.hubungan-pemilik-jaminan.update', $hubunganPemilikJaminan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $hubunganPemilikJaminan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.hubungan-pemilik-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($hubunganPemilikJaminan->id) ? 'Edit' : 'Tambah' }} Hubungan Pemilik Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.hubungan-pemilik-jaminan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $hubunganPemilikJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
139
resources/views/hubungan_pemilik_jaminan/index.blade.php
Normal file
139
resources/views/hubungan_pemilik_jaminan/index.blade.php
Normal file
@@ -0,0 +1,139 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.hubungan-pemilik-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="hubungan-pemilik-jaminan-table" data-api-url="{{ route('basicdata.hubungan-pemilik-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Hubungan Pemilik Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Hubungan Pemilik Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.hubungan-pemilik-jaminan.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.hubungan-pemilik-jaminan.create') }}"> Tambah Hubungan Pemilik Jaminan </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Hubungan Pemilik Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/hubungan-pemilik-jaminan/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#hubungan-pemilik-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: 'Hubungan Pemilik Jaminan',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/hubungan-pemilik-jaminan/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
47
resources/views/hubungan_penghuni_jaminan/create.blade.php
Normal file
47
resources/views/hubungan_penghuni_jaminan/create.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($hubunganPenghuniJaminan->id))
|
||||
<form action="{{ route('basicdata.hubungan-penghuni-jaminan.update', $hubunganPenghuniJaminan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $hubunganPenghuniJaminan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.hubungan-penghuni-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($hubunganPenghuniJaminan->id) ? 'Edit' : 'Tambah' }} Hubungan Penghuni Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.hubungan-penghuni-jaminan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $hubunganPenghuniJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
139
resources/views/hubungan_penghuni_jaminan/index.blade.php
Normal file
139
resources/views/hubungan_penghuni_jaminan/index.blade.php
Normal file
@@ -0,0 +1,139 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.hubungan-penghuni-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="hubungan-penghuni-jaminan-table" data-api-url="{{ route('basicdata.hubungan-penghuni-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Hubungan Penghuni Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Hubungan Penghuni Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.hubungan-penghuni-jaminan.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.hubungan-penghuni-jaminan.create') }}"> Tambah Hubungan Penghuni Jaminan </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Hubungan Penghuni Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/hubungan-penghuni-jaminan/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#hubungan-penghuni-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: 'Hubungan Penghuni Jaminan',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/hubungan-penghuni-jaminan/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
58
resources/views/jenis_aset/create.blade.php
Normal file
58
resources/views/jenis_aset/create.blade.php
Normal file
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisAset->id))
|
||||
<form action="{{ route('basicdata.jenis-aset.update', $jenisAset->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisAset->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-aset.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} Jenis Aset
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-aset.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $jenisAset->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisAset->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
147
resources/views/jenis_aset/index.blade.php
Normal file
147
resources/views/jenis_aset/index.blade.php
Normal file
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-aset') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-aset-table" data-api-url="{{ route('basicdata.jenis-aset.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Aset
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Aset" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-aset.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-aset.create') }}"> Tambah Jenis Aset </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Aset </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-aset/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-aset-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Aset',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-aset/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
69
resources/views/jenis_dokumen/create.blade.php
Normal file
69
resources/views/jenis_dokumen/create.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisDokumen->id))
|
||||
<form action="{{ route('basicdata.jenis-dokumen.update', $jenisDokumen->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisDokumen->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-dokumen.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisDokumen->id) ? 'Edit' : 'Tambah' }} Jenis Dokumen
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-dokumen.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisDokumen->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Max Size
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input placeholder="Ukuran dalam MB" class="input @error('max_size') border-danger bg-danger-light @enderror" type="number" name="max_size" value="{{ $jenisDokumen->max_size ?? '' }}">
|
||||
@error('max_size')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Description
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('description') border-danger bg-danger-light @enderror" rows="2" type="number" id="description" name="description">{{ $jenisDokumen->description ?? '' }}</textarea>
|
||||
@error('description')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
157
resources/views/jenis_dokumen/index.blade.php
Normal file
157
resources/views/jenis_dokumen/index.blade.php
Normal file
@@ -0,0 +1,157 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-dokumen') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-dokumen-table" data-api-url="{{ route('basicdata.jenis-dokumen.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Dokumen
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Dokumen" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-dokumen.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-dokumen.create') }}"> Tambah Jenis Dokumen </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Dokumen </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="max_size">
|
||||
<span class="sort"> <span class="sort-label"> Max Size </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="description">
|
||||
<span class="sort"> <span class="sort-label"> Description </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-dokumen/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-dokumen-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Dokumen',
|
||||
},
|
||||
max_size: {
|
||||
title: 'Size',
|
||||
render: (item, data) => {
|
||||
return `${data.max_size} MB`;
|
||||
},
|
||||
},
|
||||
description: {
|
||||
title: 'Description',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-dokumen/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
62
resources/views/jenis_fasilitas_kredit/create.blade.php
Normal file
62
resources/views/jenis_fasilitas_kredit/create.blade.php
Normal file
@@ -0,0 +1,62 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisFasilitasKredit->id))
|
||||
<form action="{{ route('basicdata.jenis-fasilitas-kredit.update', $jenisFasilitasKredit->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisFasilitasKredit->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-fasilitas-kredit.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisFasilitasKredit->id) ? 'Edit' : 'Tambah' }} Jenis Fasilitas Kredit
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-fasilitas-kredit.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $jenisFasilitasKredit->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisFasilitasKredit->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
146
resources/views/jenis_fasilitas_kredit/index.blade.php
Normal file
146
resources/views/jenis_fasilitas_kredit/index.blade.php
Normal file
@@ -0,0 +1,146 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-fasilitas-kredit') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-fasilitas-kredit-table" data-api-url="{{ route('basicdata.jenis-fasilitas-kredit.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Fasilitas Kredit
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Fasilitas Kredit" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-fasilitas-kredit.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-fasilitas-kredit.create') }}"> Tambah Jenis Fasilitas Kredit </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-fasilitas-kredit/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-fasilitas-kredit-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-fasilitas-kredit/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
126
resources/views/jenis_jaminan/create.blade.php
Normal file
126
resources/views/jenis_jaminan/create.blade.php
Normal file
@@ -0,0 +1,126 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (isset($jenisJaminan->id))
|
||||
<form action="{{ route('basicdata.jenis-jaminan.update', $jenisJaminan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisJaminan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-jaminan.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
@if (isset($jenisJaminan->id))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly
|
||||
class="input border-warning bg-warning-light @error('code') border-danger bg-danger-light @enderror"
|
||||
type="text" name="code" value="{{ $jenisJaminan->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $ijin_usaha->code ?? old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
||||
name="name" value="{{ $jenisJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Form Kategori</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('form_kategori') border-danger bg-danger-light @enderror select2"
|
||||
name="form_kategori[]" multiple="multiple">
|
||||
|
||||
<option value="">Pilih Form</option>
|
||||
@php
|
||||
$formKategoriOptions = ['tanah', 'bangunan', 'kapal', 'kendaraan', 'mesin', 'pesawat', 'alat-berat', 'apartemen-kantor', 'lingkungan', 'fakta', 'informasi'];
|
||||
$selectedOptions = isset($jenisJaminan->form_kategori) ? json_decode($jenisJaminan->form_kategori, true) : [];
|
||||
$selectedOptions = is_array($selectedOptions) ? $selectedOptions : [];
|
||||
@endphp
|
||||
|
||||
@foreach ($formKategoriOptions as $item)
|
||||
<option value="{{ $item }}" {{ in_array($item, $selectedOptions) ? 'selected' : '' }}>
|
||||
{{ $item }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('form_kategori')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Legalitas Jaminan
|
||||
</label>
|
||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||
@foreach ($jenisLegalitasJaminan as $row)
|
||||
<label class="switch">
|
||||
@if ( isset($jenisJaminan) && !empty(json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true)))
|
||||
<input type="checkbox" @if (in_array($row->code, json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true))) {{ 'checked' }} @endif
|
||||
value="{{ $row->code }}" name="jenis_legalitas_jaminan_id[]" />
|
||||
@else
|
||||
<input type="checkbox" value="{{ $row->code }}"
|
||||
name="jenis_legalitas_jaminan_id[]" />
|
||||
@endif
|
||||
<span class="switch-label">
|
||||
{{ $row->name }}
|
||||
</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
147
resources/views/jenis_jaminan/index.blade.php
Normal file
147
resources/views/jenis_jaminan/index.blade.php
Normal file
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-jaminan-table" data-api-url="{{ route('basicdata.jenis-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-jaminan.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-jaminan.create') }}"> Tambah Jenis Jaminan </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-jaminan/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Jaminan',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-jaminan/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
62
resources/views/jenis_lampiran/create.blade.php
Normal file
62
resources/views/jenis_lampiran/create.blade.php
Normal file
@@ -0,0 +1,62 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
@if(isset($jenisLampiran->id))
|
||||
{{ Breadcrumbs::render(request()->route()->getName(),$jenisLampiran->id) }}
|
||||
@else
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisLampiran->id))
|
||||
<form action="{{ route('basicdata.jenis-lampiran.update', $jenisLampiran->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisLampiran->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-lampiran.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLampiran->id) ? 'Edit' : 'Tambah' }} Jenis Lampiran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-lampiran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama') border-danger bg-danger-light @enderror" type="text" name="nama" value="{{ $jenisLampiran->nama ?? old('nama') }}">
|
||||
@error('nama')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Deskripsi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('deskripsi') border-danger bg-danger-light @enderror" name="deskripsi" rows="3">{{ $jenisLampiran->deskripsi ?? old('deskripsi') }}</textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
145
resources/views/jenis_lampiran/index.blade.php
Normal file
145
resources/views/jenis_lampiran/index.blade.php
Normal file
@@ -0,0 +1,145 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-lampiran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-lampiran-table" data-api-url="{{ route('basicdata.jenis-lampiran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Lampiran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Lampiran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-lampiran.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-lampiran.create') }}"> Tambah Jenis Lampiran </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="nama">
|
||||
<span class="sort"> <span class="sort-label"> Nama </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="deskripsi">
|
||||
<span class="sort"> <span class="sort-label"> Deskripsi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-lampiran/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Jenis Lampiran has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the jenis lampiran.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-lampiran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nama: {
|
||||
title: 'Nama',
|
||||
},
|
||||
deskripsi: {
|
||||
title: 'Deskripsi',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-lampiran/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
77
resources/views/jenis_laporan/create.blade.php
Normal file
77
resources/views/jenis_laporan/create.blade.php
Normal file
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (isset($jenisLaporan->id))
|
||||
<form action="{{ route('basicdata.jenis_laporan.update', $jenisLaporan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisLaporan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis_laporan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLaporan->id) ? 'Edit' : 'Tambah' }} Jenis Laporan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis_laporan.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
@if (isset($jenisLaporan->id))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly
|
||||
class="input border-warning bg-warning-light @error('code') border-danger @enderror"
|
||||
type="text" name="code" value="{{ $jenisLaporan->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kode Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger @enderror" type="text" name="code"
|
||||
value="{{ $ijin_usaha->code ?? old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger @enderror" type="text" name="name"
|
||||
value="{{ $jenisLaporan->name ?? old('name') }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
152
resources/views/jenis_laporan/index.blade.php
Normal file
152
resources/views/jenis_laporan/index.blade.php
Normal file
@@ -0,0 +1,152 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis_laporan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="jenis-laporan-table"
|
||||
data-api-url="{{ route('basicdata.jenis_laporan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Laporan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Laporan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis_laporan.export') }}"> Export to
|
||||
Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis_laporan.create') }}"> Tambah Jenis
|
||||
Laporan </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis_laporan/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-laporan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Laporan',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis_laporan/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
116
resources/views/jenis_legalitas_jaminan/create.blade.php
Normal file
116
resources/views/jenis_legalitas_jaminan/create.blade.php
Normal file
@@ -0,0 +1,116 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisLegalitasJaminan->id))
|
||||
<form action="{{ route('basicdata.jenis-legalitas-jaminan.update', $jenisLegalitasJaminan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisLegalitasJaminan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-legalitas-jaminan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
@if(isset($jenisLegalitasJaminan->id))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly class="input border-warning bg-warning-light @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisLegalitasJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tambahkan inputan custom_field -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('custom_field') border-danger bg-danger-light @enderror" type="text" name="custom_field" value="{{ $jenisLegalitasJaminan->custom_field ?? '' }}">
|
||||
@error('custom_field')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tambahkan inputan custom_field_type -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field Type
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect @error('custom_field_type') border-danger bg-danger-light @enderror" name="custom_field_type">
|
||||
<option value="">Pilih Tipe</option>
|
||||
<option value="text" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="number" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'number') ? 'selected' : '' }}>Number</option>
|
||||
<option value="date" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'date') ? 'selected' : '' }}>Date</option>
|
||||
</select>
|
||||
@error('custom_field_type')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Fields
|
||||
</label>
|
||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||
@foreach($customFields as $customField)
|
||||
<label class="switch">
|
||||
@if ( isset($jenisLegalitasJaminan) && !empty($jenisLegalitasJaminan->custom_fields))
|
||||
<input type="checkbox" @if (in_array($customField->id, $jenisLegalitasJaminan->custom_fields))
|
||||
{{ 'checked' }}
|
||||
@endif
|
||||
value="{{ $customField->id }}" name="custom_fields[]"/>
|
||||
@else
|
||||
<input type="checkbox" value="{{ $customField->id }}"
|
||||
name="custom_fields[]"/>
|
||||
@endif
|
||||
<span class="switch-label">
|
||||
{{ $customField->urutan_prioritas.'. '.$customField->label }}
|
||||
</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
146
resources/views/jenis_legalitas_jaminan/index.blade.php
Normal file
146
resources/views/jenis_legalitas_jaminan/index.blade.php
Normal file
@@ -0,0 +1,146 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-legalitas-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-legalitas-jaminan-table" data-api-url="{{ route('basicdata.jenis-legalitas-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Legalitas Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Legalitas Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-legalitas-jaminan.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-legalitas-jaminan.create') }}"> Tambah Jenis Legalitas Jaminan </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Legalitas Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-legalitas-jaminan/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-legalitas-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Legalitas Jaminan',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-legalitas-jaminan/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
64
resources/views/jenis_penilaian/form.blade.php
Normal file
64
resources/views/jenis_penilaian/form.blade.php
Normal file
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<form
|
||||
action="{{ isset($jenisPenilaian->id) ? route('basicdata.jenis-penilaian.update', $jenisPenilaian->id) : route('basicdata.jenis-penilaian.store') }}"
|
||||
method="POST">
|
||||
|
||||
@if (isset($jenisPenilaian->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $jenisPenilaian->id }}">
|
||||
@endif
|
||||
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisPenilaian->id) ? 'Edit' : 'Tambah' }} jenis penilaian
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-penilaian.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $jenisPenilaian->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
||||
name="name" value="{{ $jenisPenilaian->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
159
resources/views/jenis_penilaian/index.blade.php
Normal file
159
resources/views/jenis_penilaian/index.blade.php
Normal file
@@ -0,0 +1,159 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-penilaian') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="jenis-penilaian-table"
|
||||
data-api-url="{{ route('basicdata.jenis-penilaian.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis penilaian
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search jenis penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-penilaian.export') }}"> Export to
|
||||
Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-penilaian.create') }}"> Tambah
|
||||
Jenis penilaian </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto max-h-[500px] overflow-y-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-penilaian/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-penilaian-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'jenis-penilaian',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-penilaian/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
674
resources/views/kjpp/create.blade.php
Normal file
674
resources/views/kjpp/create.blade.php
Normal file
@@ -0,0 +1,674 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form action="{{ isset($kjpp->id) ? route('basicdata.kjpp.update', $kjpp->id) : route('basicdata.kjpp.store') }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@if (isset($kjpp->id))
|
||||
<input type="hidden" name="id" value="{{ $kjpp->id }}">
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($kjpp->id) ? 'Edit' : 'Tambah' }} KJPP
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.kjpp.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger @enderror" type="text" name="code"
|
||||
value="{{ isset($kjpp->id) ? $kjpp->code : (empty($kjpp->id) ? $fullKjppNumber : old('code')) }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger @enderror" type="text" name="name"
|
||||
value="{{ $kjpp->name ?? old('name') }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Kantor</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="jenis_kantor" class="select w-full @error('jenis_kantor') border-danger @enderror"
|
||||
name="jenis_kantor">
|
||||
@if (isset($kjpp->id))
|
||||
<option value="">Pilih Jenis Kantor</option>
|
||||
<option value="Kantor Pusat"
|
||||
{{ old('jenis_kantor', $kjpp->jenis_kantor) == 'Kantor Pusat' ? 'selected' : '' }}>
|
||||
Kantor Pusat
|
||||
</option>
|
||||
<option value="Kantor Cabang"
|
||||
{{ old('jenis_kantor', $kjpp->jenis_kantor) == 'Kantor Cabang' ? 'selected' : '' }}>
|
||||
Kantor Cabang
|
||||
</option>
|
||||
@else
|
||||
<option value="">Pilih Jenis Kantor</option>
|
||||
<option value="Kantor Pusat"
|
||||
{{ old('jenis_kantor') == 'Kantor Pusat' ? 'selected' : '' }}>Kantor Pusat
|
||||
</option>
|
||||
<option value="Kantor Cabang"
|
||||
{{ old('jenis_kantor') == 'Kantor Cabang' ? 'selected' : '' }}>Kantor
|
||||
Cabang
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
@error('jenis_kantor')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">Nomor Ijin Usaha</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_ijin_usaha') border-danger @enderror" type="text"
|
||||
name="nomor_ijin_usaha" value="{{ $kjpp->nomor_ijin_usaha ?? old('nomor_ijin_usaha') }}">
|
||||
@error('nomor_ijin_usaha')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Alamat Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code"
|
||||
class="select w-full @error('province_code') border-danger @enderror">
|
||||
<option value="">Pilih Provinsi</option>
|
||||
@foreach ($provinces as $province)
|
||||
@if (isset($kjpp))
|
||||
<option value="{{ $province->code }}"
|
||||
{{ old('province_code', $kjpp->province_code) == $province->code ? 'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $province->code }}"
|
||||
{{ old('province_code') == $province->code ? 'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('province_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code"
|
||||
class="select w-full @error('city_code') border-danger @enderror">
|
||||
<option value="">Pilih Kota / Kabupaten</option>
|
||||
@if (isset($cities))
|
||||
@foreach ($cities as $city)
|
||||
@if (isset($kjpp))
|
||||
<option value="{{ $city->code }}"
|
||||
{{ old('city_code', $kjpp->city_code) == $city->code ? 'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $city->code }}"
|
||||
{{ old('city_code') == $city->code ? 'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('city_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code"
|
||||
class="select w-full @error('district_code') border-danger @enderror">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if (isset($districts))
|
||||
@foreach ($districts as $district)
|
||||
@if (isset($kjpp))
|
||||
<option value="{{ $district->code }}"
|
||||
{{ old('district_code', $kjpp->district_code) == $district->code ? 'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $district->code }}"
|
||||
{{ old('district_code') == $district->code ? 'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code"
|
||||
class="select w-full @error('village_code') border-danger @enderror">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if (isset($villages))
|
||||
@foreach ($villages as $village)
|
||||
@if (isset($kjpp))
|
||||
<option value="{{ $village->code }}"
|
||||
{{ old('village_code', $kjpp->village_code) == $village->code ? 'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $village->code }}"
|
||||
{{ old('village_code') == $village->code ? 'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('village_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('postal_code') border-danger @enderror" type="number"
|
||||
id="postal_code" name="postal_code"
|
||||
value="{{ $kjpp->postal_code ?? old('postal_code') }}" placeholder="Kode Pos">
|
||||
@error('postal_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col w-full mt-2 lg:mt-5">
|
||||
<textarea class="textarea @error('address') border-danger @enderror" rows="3" type="number" id="address"
|
||||
name="address">{{ $kjpp->address ?? old('address') }}</textarea>
|
||||
@error('address')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Telepon Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_telepon_kantor') border-danger @enderror" type="text"
|
||||
name="nomor_telepon_kantor"
|
||||
value="{{ $kjpp->nomor_telepon_kantor ?? old('nomor_telepon_kantor') }}">
|
||||
@error('nomor_telepon_kantor')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Email Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full gap-1.5">
|
||||
<input class="input @error('email_kantor') border-danger @enderror" type="text"
|
||||
name="email_kantor" value="{{ $kjpp->email_kantor ?? old('email_kantor') }}">
|
||||
@error('email_kantor')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<div id="detail_email_kantor" class="flex flex-wrap items-center w-full gap-2">
|
||||
@php
|
||||
$emails = old(
|
||||
'detail_email_kantor.email_kantor',
|
||||
json_decode($detailJoinEmailKantor, true),
|
||||
); // Decode as associative array
|
||||
@endphp
|
||||
|
||||
@if (is_array($emails) && count($emails) > 0)
|
||||
@foreach ($emails as $index => $email)
|
||||
@if (!empty($email))
|
||||
<div
|
||||
class="flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_email_kantor.email_kantor.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_email_kantor[email_kantor][]"
|
||||
value="{{ old('detail_email_kantor.email_kantor.' . $index, is_array($email) ? $email['email_kantor'] : $email->email_kantor ?? '') }}">
|
||||
@error('detail_email_kantor.email_kantor.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button-edit">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" id="tambah_email_kantor" class="btn btn-primary btn-xs">Tambah
|
||||
Email Kantor</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama_pimpinan') border-danger @enderror" type="text"
|
||||
name="nama_pimpinan" value="{{ $kjpp->nama_pimpinan ?? old('nama_pimpinan') }}">
|
||||
@error('nama_pimpinan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_hp_pimpinan') border-danger @enderror" type="text"
|
||||
name="nomor_hp_pimpinan"
|
||||
value="{{ $kjpp->nomor_hp_pimpinan ?? old('nomor_hp_pimpinan') }}">
|
||||
@error('nomor_hp_pimpinan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap">
|
||||
<div id="detail_nama_pimpinan" class="flex flex-wrap items-baseline w-full gap-2.5">
|
||||
@php
|
||||
$detailNamaPimpinan = old(
|
||||
'detail_nama_pimpinan.nama_pimpinan',
|
||||
json_decode($detailJoinPimpinan, true),
|
||||
);
|
||||
$detailNomorHpPimpinan = old(
|
||||
'detail_nomor_hp_pimpinan.nomor_hp_pimpinan',
|
||||
json_decode($detailJoinPimpinan, true),
|
||||
);
|
||||
@endphp
|
||||
|
||||
@if (is_array($detailNamaPimpinan) &&
|
||||
count($detailNamaPimpinan) > 0 &&
|
||||
(is_array($detailNomorHpPimpinan) && count($detailNomorHpPimpinan) > 0))
|
||||
@foreach ($detailNamaPimpinan as $index => $detail_nama)
|
||||
@if (!empty($detail_nama))
|
||||
<div class="flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full">
|
||||
<label class="form-label max-w-56">Nama Pimpinan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nama_pimpinan.nama_pimpinan.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nama_pimpinan[nama_pimpinan][]"
|
||||
value="{{ old('detail_nama_pimpinan.nama_pimpinan.' . $index, $detail_nama['nama_pimpinan'] ?? '') }}">
|
||||
@error('detail_nama_pimpinan.nama_pimpinan.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<label class="form-label max-w-56">Nomor HP Pimpinan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nomor_hp_pimpinan.nomor_hp_pimpinan.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nomor_hp_pimpinan[nomor_hp_pimpinan][]"
|
||||
value="{{ old('detail_nomor_hp_pimpinan.nomor_hp_pimpinan.' . $index, $detailNomorHpPimpinan[$index]['nomor_hp_pimpinan'] ?? '') }}">
|
||||
@error('detail_nomor_hp_pimpinan.nomor_hp_pimpinan.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button-edit">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_nama_pimpinan" class="btn btn-primary btn-xs">Tambah
|
||||
Pimpinan</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama_pic_reviewer') border-danger @enderror" type="text"
|
||||
name="nama_pic_reviewer"
|
||||
value="{{ $kjpp->nama_pic_reviewer ?? old('nama_pic_reviewer') }}">
|
||||
@error('nama_pic_reviewer')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_hp_pic_reviewer') border-danger @enderror" type="text"
|
||||
name="nomor_hp_pic_reviewer"
|
||||
value="{{ $kjpp->nomor_hp_pic_reviewer ?? old('nomor_hp_pic_reviewer') }}">
|
||||
@error('nomor_hp_pic_reviewer')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap">
|
||||
<div id="detail_nama_pic_reviewer" class="flex flex-wrap items-baseline w-full gap-2.5">
|
||||
@php
|
||||
$detailNamaPicReviewer = old(
|
||||
'detail_nama_pic_reviewer.nama_pic_reviewer',
|
||||
json_decode($detailJoinPicReviewer, true),
|
||||
);
|
||||
$detailNomorHpPicReviewer = old(
|
||||
'detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer',
|
||||
json_decode($detailJoinPicReviewer, true),
|
||||
);
|
||||
@endphp
|
||||
|
||||
@if (is_array($detailNamaPicReviewer) &&
|
||||
count($detailNamaPicReviewer) > 0 &&
|
||||
is_array($detailNomorHpPicReviewer) &&
|
||||
count($detailNomorHpPicReviewer) > 0)
|
||||
@foreach ($detailNamaPicReviewer as $index => $detail_pic_reviewer)
|
||||
@if (!empty($detail_pic_reviewer))
|
||||
<div class="flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full">
|
||||
<label class="form-label max-w-56">Nama PIC Reviewer</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nama_pic_reviewer.nama_pic_reviewer.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nama_pic_reviewer[nama_pic_reviewer][]"
|
||||
value="{{ old('detail_nama_pic_reviewer.nama_pic_reviewer.' . $index, $detail_pic_reviewer['nama_pic_reviewer'] ?? '') }}">
|
||||
@error('detail_nama_pic_reviewer.nama_pic_reviewer.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<label class="form-label max-w-56">Nomor HP PIC Reviewer</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer.' . $index) border-danger @enderror"
|
||||
type="text"
|
||||
name="detail_nomor_hp_pic_reviewer[nomor_hp_pic_reviewer][]"
|
||||
value="{{ old('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer.' . $index, $detailNomorHpPicReviewer[$index]['nomor_hp_pic_reviewer'] ?? '') }}">
|
||||
@error('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button-edit">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_nama_pic_reviewer" class="btn btn-primary btn-xs">Tambah
|
||||
PIC Reviewer</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama_pic_admin') border-danger @enderror" type="text"
|
||||
name="nama_pic_admin" value="{{ $kjpp->nama_pic_admin ?? old('nama_pic_admin') }}">
|
||||
@error('nama_pic_admin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_hp_pic_admin') border-danger @enderror" type="text"
|
||||
name="nomor_hp_pic_admin"
|
||||
value="{{ $kjpp->nomor_hp_pic_admin ?? old('nomor_hp_pic_admin') }}">
|
||||
@error('nomor_hp_pic_admin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap">
|
||||
<div id="detail_nama_pic_admin" class="flex flex-wrap items-baseline w-full gap-2.5">
|
||||
@php
|
||||
$detailNamaPicAdmin = old(
|
||||
'detail_nama_pic_admin.nama_pic_admin',
|
||||
json_decode($detailJoinPicAdmin, true),
|
||||
);
|
||||
$detailNomorHpPicAdmin = old(
|
||||
'detail_nomor_hp_pic_admin.nomor_hp_pic_admin',
|
||||
json_decode($detailJoinPicAdmin, true),
|
||||
);
|
||||
@endphp
|
||||
|
||||
@if (is_array($detailNamaPicAdmin) &&
|
||||
count($detailNamaPicAdmin) > 0 &&
|
||||
is_array($detailNomorHpPicAdmin) &&
|
||||
count($detailNomorHpPicAdmin) > 0)
|
||||
@foreach ($detailNamaPicAdmin as $index => $detail_pic_admin)
|
||||
@if (!empty($detail_pic_admin))
|
||||
<div class="flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full">
|
||||
<label class="form-label max-w-56">Nama PIC Admin</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nama_pic_admin.nama_pic_admin.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nama_pic_admin[nama_pic_admin][]"
|
||||
value="{{ old('detail_nama_pic_admin.nama_pic_admin.' . $index, $detail_pic_admin['nama_pic_admin'] ?? '') }}">
|
||||
@error('detail_nama_pic_admin.nama_pic_admin.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<label class="form-label max-w-56">Nomor HP PIC Admin</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nomor_hp_pic_admin.nomor_hp_pic_admin.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nomor_hp_pic_admin[nomor_hp_pic_admin][]"
|
||||
value="{{ old('detail_nomor_hp_pic_admin.nomor_hp_pic_admin.' . $index, $detailNomorHpPicAdmin[$index]['nomor_hp_pic_admin'] ?? '') }}">
|
||||
@error('detail_nomor_hp_pic_admin.nomor_hp_pic_admin.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button-edit">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_nama_pic_admin" class="btn btn-primary btn-xs">Tambah
|
||||
PIC Admin</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama_pic_marketing') border-danger @enderror" type="text"
|
||||
name="nama_pic_marketing"
|
||||
value="{{ $kjpp->nama_pic_marketing ?? old('nama_pic_marketing') }}">
|
||||
@error('nama_pic_marketing')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_hp_pic_marketing') border-danger @enderror"
|
||||
type="text" name="nomor_hp_pic_marketing"
|
||||
value="{{ $kjpp->nomor_hp_pic_marketing ?? old('nomor_hp_pic_marketing') }}">
|
||||
@error('nomor_hp_pic_marketing')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap">
|
||||
<div id="detail_nama_pic_marketing" class="flex flex-wrap items-baseline w-full gap-2.5">
|
||||
@php
|
||||
$detailNamaPicMarketing = old(
|
||||
'detail_nama_pic_marketing.nama_pic_marketing',
|
||||
json_decode($detailJoinPicMarketing, true),
|
||||
);
|
||||
$detailNomorHpPicMarketing = old(
|
||||
'detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing',
|
||||
json_decode($detailJoinPicMarketing, true),
|
||||
);
|
||||
@endphp
|
||||
|
||||
@if (is_array($detailNamaPicMarketing) &&
|
||||
count($detailNamaPicMarketing) > 0 &&
|
||||
is_array($detailNomorHpPicMarketing) &&
|
||||
count($detailNomorHpPicMarketing) > 0)
|
||||
@foreach ($detailNamaPicMarketing as $index => $detail_pic_marketing)
|
||||
@if (!empty($detail_pic_marketing))
|
||||
<div class="flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full">
|
||||
<label class="form-label max-w-56">Nama PIC Marketing</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nama_pic_marketing.nama_pic_marketing.' . $index) border-danger @enderror"
|
||||
type="text" name="detail_nama_pic_marketing[nama_pic_marketing][]"
|
||||
value="{{ old('detail_nama_pic_marketing.nama_pic_marketing.' . $index, $detail_pic_marketing['nama_pic_marketing'] ?? '') }}">
|
||||
@error('detail_nama_pic_marketing.nama_pic_marketing.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<label class="form-label max-w-56">Nomor HP PIC Marketing</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input
|
||||
class="input @error('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing.' . $index) border-danger @enderror"
|
||||
type="text"
|
||||
name="detail_nomor_hp_pic_marketing[nomor_hp_pic_marketing][]"
|
||||
value="{{ old('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing.' . $index, $detailNomorHpPicMarketing[$index]['nomor_hp_pic_marketing'] ?? '') }}">
|
||||
@error('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing.' . $index)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button-edit">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_nama_pic_marketing" class="btn btn-primary btn-xs">Tambah
|
||||
PIC Marketing</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Ijin Usaha
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select name="ijin_usaha_id[]" multiple="multiple"
|
||||
class="input tomselect w-full @error('ijin_usaha_id') border-danger @enderror"
|
||||
id="ijin_usaha_select">
|
||||
<option value="">Pilih Ijin Usaha</option>
|
||||
@foreach ($ijin_usaha as $row)
|
||||
<option value="{{ $row->code }}"
|
||||
{{ isset($kjpp->ijin_usaha_id) ? (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '') : (in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '') }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('ijin_usaha_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pengalaman (Jenis Aset)
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select name="jenis_aset_id[]" multiple="multiple"
|
||||
class="input tomselect w-full @error('jenis_aset_id') border-danger @enderror"
|
||||
id="jenis_aset_select">
|
||||
<option value="">Pilih Jenis Aset</option>
|
||||
@foreach ($jenis_aset as $row)
|
||||
<option value="{{ $row->code }}"
|
||||
{{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id ?? '[]', true))) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('jenis_aset_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Attachment
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($kjpp) && $kjpp->attachment)
|
||||
<div class="mb-2">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">Lihat File:</p>
|
||||
<a href="{{ asset('storage/uploads_pdf/' . $kjpp->attachment) }}"
|
||||
class="btn btn-link" target="_blank">
|
||||
{{ $kjpp->attachment }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
<input class="file-input @error('attachment') border-danger @enderror" name="attachment"
|
||||
type="file" />
|
||||
@error('attachment')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('lpj::kjpp.scripts.index')
|
||||
178
resources/views/kjpp/index.blade.php
Normal file
178
resources/views/kjpp/index.blade.php
Normal file
@@ -0,0 +1,178 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.kjpp') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="kjpp-table" data-api-url="{{ route('basicdata.kjpp.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
KJPP
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search KJPP" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.kjpp.export') }}"> Export to Excel
|
||||
</a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.kjpp.create') }}"> Tambah KJPP
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Nomor KJPP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama KJPP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Kantor </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
|
||||
<span class="sort"> <span class="sort-label"> Kota/Kabupaten </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
|
||||
<span class="sort"> <span class="sort-label"> Alamat </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/kjpp/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#kjpp-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Nomor KJPP',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama KJPP',
|
||||
},
|
||||
jenis_kantor: {
|
||||
title: 'Jenis Kantor',
|
||||
},
|
||||
city: {
|
||||
title: 'Kota/Kabupaten',
|
||||
render: (item, data) => {
|
||||
return data.city.name;
|
||||
}
|
||||
},
|
||||
address: {
|
||||
title: 'Alamat KJPP',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" href="basic-data/kjpp/${data.id}">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/kjpp/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
145
resources/views/kjpp/scripts/index.blade.php
Normal file
145
resources/views/kjpp/scripts/index.blade.php
Normal file
@@ -0,0 +1,145 @@
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const emailKantorDiv = document.getElementById('detail_email_kantor');
|
||||
|
||||
function addDeleteListeners() {
|
||||
document.querySelectorAll(".delete-button").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
this.closest(
|
||||
".flex.flex-col.lg\\:flex-row.gap-2.items-baseline.lg\\:items-center.w-full"
|
||||
)
|
||||
.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function DeleteEditListeners() {
|
||||
document.querySelectorAll(".delete-button-edit").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
this.closest(
|
||||
".flex.flex-col.lg\\:flex-row.gap-2.items-baseline.lg\\:items-center.w-full"
|
||||
)
|
||||
.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
DeleteEditListeners();
|
||||
|
||||
document.getElementById("tambah_email_kantor").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
|
||||
newDiv.innerHTML = `
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_email_kantor[email_kantor][]" value="">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
`;
|
||||
emailKantorDiv.appendChild(newDiv);
|
||||
|
||||
addDeleteListeners();
|
||||
});
|
||||
|
||||
const namaPimpinanDiv = document.getElementById('detail_nama_pimpinan');
|
||||
|
||||
document.getElementById("tambah_nama_pimpinan").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nama_pimpinan[nama_pimpinan][]" value="">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nomor_hp_pimpinan[nomor_hp_pimpinan][]" value="">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
`;
|
||||
namaPimpinanDiv.appendChild(newDiv);
|
||||
|
||||
addDeleteListeners();
|
||||
});
|
||||
|
||||
const namaPicReviewerDiv = document.getElementById('detail_nama_pic_reviewer');
|
||||
|
||||
document.getElementById("tambah_nama_pic_reviewer").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nama_pic_reviewer[nama_pic_reviewer][]" value="">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nomor_hp_pic_reviewer[nomor_hp_pic_reviewer][]" value="">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
`;
|
||||
namaPicReviewerDiv.appendChild(newDiv);
|
||||
|
||||
addDeleteListeners();
|
||||
})
|
||||
|
||||
const namaPicAdminDiv = document.getElementById('detail_nama_pic_admin');
|
||||
|
||||
document.getElementById("tambah_nama_pic_admin").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nama_pic_admin[nama_pic_admin][]" value="">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nomor_hp_pic_admin[nomor_hp_pic_admin][]" value="">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
`;
|
||||
namaPicAdminDiv.appendChild(newDiv);
|
||||
|
||||
addDeleteListeners();
|
||||
})
|
||||
|
||||
const namaPicMarketingDiv = document.getElementById('detail_nama_pic_marketing');
|
||||
|
||||
document.getElementById("tambah_nama_pic_marketing").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nama_pic_marketing[nama_pic_marketing][]" value="">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_nomor_hp_pic_marketing[nomor_hp_pic_marketing][]" value="">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
`;
|
||||
namaPicMarketingDiv.appendChild(newDiv);
|
||||
|
||||
addDeleteListeners();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
304
resources/views/kjpp/show.blade.php
Normal file
304
resources/views/kjpp/show.blade.php
Normal file
@@ -0,0 +1,304 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Show KJPP
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.kjpp.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->code }}</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Kantor</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $kjpp->jenis_kantor }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">Nomor Ijin Usaha</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $kjpp->nomor_ijin_usaha }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Alamat Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex style-w-full text-gray-600 font-medium text-sm">{{ $kjpp->address }}
|
||||
@if (isset($kjpp->village_code))
|
||||
, Kel.
|
||||
@foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($kjpp->district_code))
|
||||
, Kec.
|
||||
@foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($kjpp->city_code))
|
||||
,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($kjpp->province_code))
|
||||
,
|
||||
@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($kjpp->postal_code))
|
||||
, Kode Pos.
|
||||
@foreach ($villages as $village)
|
||||
{{ $village->postal_code }}
|
||||
@endforeach
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Telepon Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_telepon_kantor }}</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Email Kantor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->email_kantor }}</p>
|
||||
@if (!empty($detailJoinEmailKantor))
|
||||
@foreach (json_decode($detailJoinEmailKantor) as $detail_email_kantor)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_email_kantor->email_kantor }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pimpinan }}</p>
|
||||
@if (isset($kjpp->detail_nama_pimpinan))
|
||||
@foreach (json_decode($detailJoinPimpinan) as $detail_nama_pimpinan)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nama_pimpinan->nama_pimpinan }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP Pimpinan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pimpinan }}</p>
|
||||
@if (isset($kjpp->detail_nomor_hp_pimpinan))
|
||||
@foreach (json_decode($detailJoinPimpinan) as $detail_nomor_hp_pimpinan)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nomor_hp_pimpinan->nomor_hp_pimpinan }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_reviewer ?? '-' }}</p>
|
||||
@if (isset($kjpp->detail_nama_pic_reviewer))
|
||||
@foreach (json_decode($detailJoinPicReviewer) as $detail_nama_pic_reviewer)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nama_pic_reviewer->nama_pic_reviewer }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Reviewer
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_reviewer ?? '-' }}
|
||||
</p>
|
||||
@if (isset($kjpp->detail_nomor_hp_pic_reviewer))
|
||||
@foreach (json_decode($detailJoinPicReviewer) as $detail_nomor_hp_pic_reviewer)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nomor_hp_pic_reviewer->nomor_hp_pic_reviewer }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_admin ?? '-' }}</p>
|
||||
@if (isset($kjpp->detail_nama_pic_admin))
|
||||
@foreach (json_decode($detailJoinPicAdmin) as $detail_nama_pic_admin)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nama_pic_admin->nama_pic_admin }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Admin
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_admin ?? '-' }}</p>
|
||||
@if (isset($kjpp->detail_nomor_hp_pic_admin))
|
||||
@foreach (json_decode($detailJoinPicAdmin) as $detail_nomor_hp_pic_admin)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nomor_hp_pic_admin->nomor_hp_pic_admin }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_marketing ?? '-' }}</p>
|
||||
@if (isset($kjpp->detail_nama_pic_marketing))
|
||||
@foreach (json_decode($detailJoinPicMarketing) as $detail_nama_pic_marketing)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nama_pic_marketing->nama_pic_marketing }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Nomor HP PIC Marketing
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_marketing ?? '-' }}
|
||||
</p>
|
||||
@if (isset($kjpp->detail_nomor_hp_pic_marketing))
|
||||
@foreach (json_decode($detailJoinPicMarketing) as $detail_nomor_hp_pic_marketing)
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $detail_nomor_hp_pic_marketing->nomor_hp_pic_marketing }}
|
||||
</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Ijin Usaha
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($kjpp->ijin_usaha_id))
|
||||
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm gap-1">
|
||||
@foreach (json_decode($kjpp->ijin_usaha_id, true) as $ijin_code)
|
||||
@php
|
||||
$ijin_usaha = $ijin_usahas->firstWhere('code', $ijin_code);
|
||||
@endphp
|
||||
@if ($ijin_usaha)
|
||||
<div
|
||||
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
|
||||
{{ $ijin_usaha->name }}
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<div class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">
|
||||
-
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pengalaman (Jenis Aset)
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full gap-1">
|
||||
@if (isset($kjpp->jenis_aset_id) && !empty(json_decode($kjpp->jenis_aset_id, true)))
|
||||
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
|
||||
@php
|
||||
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
|
||||
@endphp
|
||||
@if ($jenis_aset)
|
||||
<span
|
||||
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
|
||||
{{ $jenis_aset->name }}
|
||||
</span>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<span class="flex flex-row space-x-4 text-gray-600 font-medium text-sm dark-mode:text-gray-600">
|
||||
-
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Attachment
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="mb-2">
|
||||
<a href="{{ asset('storage/uploads_pdf/' . $kjpp->attachment) }}" class="btn btn-link"
|
||||
target="_blank">
|
||||
{{ $kjpp->attachment }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
@media (min-width: 1024px) {
|
||||
.style-w-full {
|
||||
max-width: 25rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.style-w-full {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
430
resources/views/laporan-penilai-jaminan/index.blade.php
Normal file
430
resources/views/laporan-penilai-jaminan/index.blade.php
Normal file
@@ -0,0 +1,430 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-penilai-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
margin-top: 0;
|
||||
/* Hilangkan jarak antara tombol dan dropdown */
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
||||
.dropdowns-content:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-penilai-jaminan-table"
|
||||
data-api-url="{{ route('laporan-penilai-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan Penilai Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input">
|
||||
Start Date
|
||||
<input placeholder="Tanggal Awal" id="tanggal_awal" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input">
|
||||
End Date
|
||||
<input placeholder="Tanggal Akhir" id="tanggal_akhir" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<button class="btn btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input "> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<!-- Custom dropdown for status filter -->
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button class="dropdowns-toggle btn btn-light inline-flex justify-between w-full items-center">
|
||||
Pilih Type Laporan
|
||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||
</i>
|
||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||
</i>
|
||||
</button>
|
||||
<div
|
||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<!-- Checkbox untuk All Status -->
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input id="select-all" type="checkbox"
|
||||
class="form-checkbox h-4 w-4 text-blue-600">
|
||||
<span class="ml-2">All Status</span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Dinamis Status dari Backend -->
|
||||
@php
|
||||
$status_laporan = [
|
||||
'Standar',
|
||||
'Sederhana',
|
||||
'Memo',
|
||||
'Resume',
|
||||
'Call Report',
|
||||
'RAP',
|
||||
];
|
||||
@endphp
|
||||
@foreach ($status_laporan as $item)
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
||||
value="{{ strtolower($item) }}">
|
||||
<span class="ml-2">{{ $item }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<button class="btn btn-light" id="export-button">
|
||||
Export Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"><span class="sort-label">Debitur</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Tujuan Penilaian</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Jenis Jaminan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="laporan">
|
||||
<span class="sort"><span class="sort-label">Laporan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form tersembunyi untuk export -->
|
||||
<form id="export-form" action="{{ route('laporan-penilai-jaminan.export') }}" method="GET" class="hidden">
|
||||
<input type="hidden" name="tanggal_awal" id="export_tanggal_awal">
|
||||
<input type="hidden" name="tanggal_akhir" id="export_tanggal_akhir">
|
||||
<input type="hidden" name="status" id="export_status">
|
||||
<input type="hidden" name="selected_ids" id="export_selected_ids">
|
||||
<input type="hidden" name="export_type" id="export_type" value="all">
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-penilai-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const tanggalAwalInput = document.getElementById('tanggal_awal');
|
||||
const tanggalAkhirInput = document.getElementById('tanggal_akhir');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||
|
||||
// Export elements
|
||||
const exportForm = document.getElementById('export-form');
|
||||
const exportButton = document.getElementById('export-button');
|
||||
const exportTanggalAwal = document.getElementById('export_tanggal_awal');
|
||||
const exportTanggalAkhir = document.getElementById('export_tanggal_akhir');
|
||||
const exportStatus = document.getElementById('export_status');
|
||||
const exportSelectedIds = document.getElementById('export_selected_ids');
|
||||
const exportType = document.getElementById('export_type');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
params: {
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
},
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user && data.user.name ? `${data.user.name}` : '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ?
|
||||
`${data.tujuan_penilaian.name}` : '-';
|
||||
},
|
||||
},
|
||||
jenis_jaminan_id: {
|
||||
title: 'Jenis Jaminan',
|
||||
render: (item, data) => {
|
||||
const jenisJaminan = data.dokumenjaminan.map(d => d.jenis_jaminan.name).join(', ');
|
||||
return jenisJaminan || '-';
|
||||
}
|
||||
},
|
||||
laporan: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = '';
|
||||
|
||||
const statusLaporan = data.penilai?.type_penilai || '-';
|
||||
|
||||
switch (statusLaporan.toLowerCase()) {
|
||||
case 'standar':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-warning';
|
||||
break;
|
||||
case 'sederhana':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-info';
|
||||
break;
|
||||
case 'memo':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-success';
|
||||
break;
|
||||
case 'resume':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-primary';
|
||||
break;
|
||||
case 'call-report':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-dark';
|
||||
break;
|
||||
default:
|
||||
badgeClass = 'badge badge-pill badge-outline';
|
||||
}
|
||||
|
||||
return `<span class="badge ${badgeClass}">${statusLaporan}</span>`;
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
// Filter by date range
|
||||
filterTanggalButton.addEventListener('click', function() {
|
||||
applyDateFilter();
|
||||
});
|
||||
|
||||
function applyDateFilter() {
|
||||
const tanggalAwal = tanggalAwalInput.value;
|
||||
const tanggalAkhir = tanggalAkhirInput.value;
|
||||
|
||||
let filters = {};
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (tanggalAwal) {
|
||||
filters.tanggal_awal = tanggalAwal
|
||||
}
|
||||
|
||||
if (tanggalAkhir) {
|
||||
filters.tanggal_akhir = tanggalAkhir
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Status filter functionality
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', applyStatusFilter);
|
||||
});
|
||||
|
||||
// Select All functionality
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
applyStatusFilter();
|
||||
});
|
||||
|
||||
function applyStatusFilter() {
|
||||
const selectedStatuses = Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
|
||||
if (selectedStatuses.length === 0) {
|
||||
dataTable.search('');
|
||||
console.log(selectedStatuses);
|
||||
} else {
|
||||
dataTable.search(selectedStatuses.join(','), true);
|
||||
console.log(selectedStatuses);
|
||||
}
|
||||
|
||||
dataTable.reload();
|
||||
|
||||
// Update "Select All" checkbox state
|
||||
const allChecked = Array.from(statusCheckboxes).every(cb => cb.checked);
|
||||
selectAllCheckbox.checked = allChecked;
|
||||
}
|
||||
|
||||
// Single export button functionality
|
||||
exportButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Check if any rows are selected
|
||||
const selectedIds = getSelectedRowIds();
|
||||
|
||||
// Determine export type based on context
|
||||
if (selectedIds.length > 0) {
|
||||
// If rows are selected, export those
|
||||
exportData({
|
||||
selected_ids: selectedIds,
|
||||
export_type: 'selected'
|
||||
});
|
||||
} else if (tanggalAwalInput.value && tanggalAkhirInput.value || getSelectedStatuses().length > 0) {
|
||||
// If filters are applied but no rows selected, export filtered data
|
||||
exportData({
|
||||
tanggal_awal: tanggalAwalInput.value,
|
||||
tanggal_akhir: tanggalAkhirInput.value,
|
||||
status: getSelectedStatuses(),
|
||||
export_type: 'filtered'
|
||||
});
|
||||
} else {
|
||||
// If no selection and no filters, export all
|
||||
exportData({
|
||||
export_type: 'all'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function exportData(filters = {}) {
|
||||
// Set filter values in the hidden form
|
||||
exportTanggalAwal.value = filters.tanggal_awal || '';
|
||||
exportTanggalAkhir.value = filters.tanggal_akhir || '';
|
||||
exportStatus.value = filters.status ? filters.status.join(',') : '';
|
||||
exportSelectedIds.value = filters.selected_ids ? filters.selected_ids.join(',') : '';
|
||||
exportType.value = filters.export_type || 'all';
|
||||
|
||||
// Submit the form
|
||||
exportForm.submit();
|
||||
}
|
||||
|
||||
function getSelectedStatuses() {
|
||||
return Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
}
|
||||
|
||||
function getSelectedRowIds() {
|
||||
const checkboxes = document.querySelectorAll('[data-datatable-row-check="true"]:checked');
|
||||
return Array.from(checkboxes).map(checkbox => checkbox.value);
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
287
resources/views/laporan/index.blade.php
Normal file
287
resources/views/laporan/index.blade.php
Normal file
@@ -0,0 +1,287 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs') --}}
|
||||
{{-- {{ Breadcrumbs::render('laporan.index') }} --}}
|
||||
{{-- @endsection --}}
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-table" data-api-url="{{ route('laporan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Penilai" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon(Cabang/Direktorat) </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> AO </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit_id">
|
||||
<span class="sort"> <span class="sort-label"> Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_survei">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Survei </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="due_date_sla">
|
||||
<span class="sort"> <span class="sort-label"> Due Date SLA </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="status">Status</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function formatDate(date) {
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
// Months are 0-indexed
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day} ${getIndonesianMonth(month)} ${year}`;
|
||||
}
|
||||
|
||||
function getIndonesianMonth(month) {
|
||||
const months = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni',
|
||||
'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'
|
||||
];
|
||||
return months[month -
|
||||
1];
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
if (data.debiture) {
|
||||
return `${data.debiture.name.toUpperCase()}`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.branch.name}`;
|
||||
},
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.user.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
switch (data.tujuan_penilaian.code) {
|
||||
case "TP0001":
|
||||
return `<span class="badge badge-sm badge-primary">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0002":
|
||||
return `<span class="badge badge-sm badge-info">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0003":
|
||||
return `<span class="badge badge-sm badge-success">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0004":
|
||||
return `<span class="badge badge-sm badge-danger">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0005":
|
||||
return `<span class="badge badge-sm badge-warning">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0006":
|
||||
return `<span class="badge badge-sm badge-dark">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0007":
|
||||
return `<span class="badge badge-sm badge-outline badge-info">${data.tujuan_penilaian.name}</span>`;
|
||||
default:
|
||||
return `<span class="badge badge-sm badge-outline badge-default">${data.tujuan_penilaian.name}</span>`;
|
||||
}
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return `${data.jenis_fasilitas_kredit.name}`;
|
||||
}
|
||||
},
|
||||
tanggal_survei: {
|
||||
title: 'Tanggal Survei',
|
||||
render: (item, data) => {
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
||||
}
|
||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
||||
},
|
||||
},
|
||||
due_date_sla: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
const tujuan_penilaian = data.tujuan_penilaian.name;
|
||||
const tipe_laporan = data.penilai?.type;
|
||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
||||
}
|
||||
|
||||
if(tujuan_penilaian.name==="RAP"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
if(tipe_laporan==="sederhana"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 2);
|
||||
} else if(tipe_laporan==="standar"){
|
||||
if(nilai_plafond==="2 M - 5 M"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else if(nilai_plafond==="< 2M"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
return formatDate(waktu_penilaian);
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center">${data.status}</span>`;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Actions',
|
||||
render: (item, data) => {
|
||||
const inspeksiId = data.documents[0]?.inspeksi[0]?.id || '-';
|
||||
const dokumenID = data.documents[0]?.id || '-';
|
||||
const jenisJaminanID = data.documents[0]?.jenis_jaminan_id || '-';
|
||||
const typePenilaian = data.penilai?.type_penilai || '';
|
||||
const type = data.penilai?.type || '';
|
||||
let laporanButton = '';
|
||||
let resumeButton = '';
|
||||
|
||||
|
||||
|
||||
if(data.penilai.resume) {
|
||||
resumeButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0" class="btn btn-sm btn-success">
|
||||
Resume
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if(data.nilai_liquidasi==null) {
|
||||
laporanButton = `
|
||||
<a href="laporan/${data.id}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if((data.status_bayar=="sudah_bayar" || data.status_bayar=="tidak_bayar") && data.nilai_liquidasi >0) {
|
||||
if(data.penilai.type_penilai=='resume' && !data.penilai.resume){
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${type}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
} else {
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${typePenilaian}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return `<div class="flex flex-wrap justify-end gap-1.5"> ${resumeButton} ${laporanButton} </div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
114
resources/views/laporan/show.blade.php
Normal file
114
resources/views/laporan/show.blade.php
Normal file
@@ -0,0 +1,114 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Input Nilai Liquidasi (LPJ)
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('laporan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@php
|
||||
$lpj = json_decode($permohonan->penilai->lpj);
|
||||
@endphp
|
||||
<form action="{{ route('laporan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="nomor_registrasi" id="nomor_registrasi" class="input w-full @error('nomor_registrasi') border-danger bg-danger-light @enderror" value="{{ old('nomor_registrasi', $permohonan->nomor_registrasi ?? '') }}" placeholder="Nomor Registrasi">
|
||||
@error('nomor_registrasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="debitur" id="debitur" class="input w-full @error('debitur') border-danger bg-danger-light @enderror" value="{{ old('debitur', $permohonan->debiture->name ?? '') }}" placeholder="Debitur">
|
||||
@error('debitur')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Total Nilai Pasar Wajar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="total_niilai_pasar_wajar" id="total_niilai_pasar_wajar" class="currency input w-full @error('total_niilai_pasar_wajar') border-danger bg-danger-light @enderror" value="{{ old('total_niilai_pasar_wajar', $lpj->total_nilai_pasar_wajar ?? '') }}" placeholder="Masukkan Nilai Pasar Wajar">
|
||||
@error('total_niilai_pasar_wajar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Liquidasi (%)
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="liquidasi" max="100" min="0" id="liquidasi" class="persen input w-full @error('liquidasi') border-danger bg-danger-light @enderror" value="{{ old('liquidasi', $lpj->likuidasi ?? '') }}" placeholder="Masukkan Persentase Liquidasi">
|
||||
@error('liquidasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nilai Liquidasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="nilai_liquidasi" id="nilai_liquidasi" class="currency input w-full @error('nilai_liquidasi') border-danger bg-danger-light @enderror" placeholder="Nilai Liquidasi" value="{{ old('nilai_liquidasi', $lpj->likuidasi_nilai_2 ?? '') }}">
|
||||
@error('nilai_liquidasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Proses
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
function calculateNilaiLiquidasi() {
|
||||
const totalNilaiPasarWajar = parseFloat(document.getElementById('total_niilai_pasar_wajar').value.replace(/\./g, '').replace(',', '.'));
|
||||
const liquidasiPercentage = parseFloat(document.getElementById('liquidasi').value);
|
||||
const nilaiLiquidasiInput = document.getElementById('nilai_liquidasi');
|
||||
|
||||
if (!isNaN(totalNilaiPasarWajar) && !isNaN(liquidasiPercentage)) {
|
||||
const nilaiLiquidasi = totalNilaiPasarWajar * (liquidasiPercentage / 100);
|
||||
nilaiLiquidasiInput.value = nilaiLiquidasi.toLocaleString('id-ID', {maximumFractionDigits: 0});
|
||||
} else {
|
||||
nilaiLiquidasiInput.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate initially in case values are pre-filled
|
||||
document.addEventListener('DOMContentLoaded', calculateNilaiLiquidasi);
|
||||
|
||||
// Ensure the calculation happens when Total Nilai Pasar Wajar changes as well
|
||||
document.getElementById('liquidasi').addEventListener('change', calculateNilaiLiquidasi);
|
||||
</script>
|
||||
@endpush
|
||||
486
resources/views/laporan/standard_index.blade.php
Normal file
486
resources/views/laporan/standard_index.blade.php
Normal file
@@ -0,0 +1,486 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan.standard.index') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
.input-group {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.left-group {
|
||||
padding-right: 2.5rem;
|
||||
}
|
||||
|
||||
.right-group {
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
|
||||
.input-group .input-unit {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.input-group .input-unit.left {
|
||||
left: 0.75rem;
|
||||
}
|
||||
|
||||
.input-group .input-unit.right {
|
||||
right: 0.75rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" id="debitur-table">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form action="" method="POST" class="grid gap-5">
|
||||
<input type="hidden" name="id" value="">
|
||||
@csrf
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
CADEB AN
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('cadeb') border-danger bg-danger-light @enderror"
|
||||
type="text" name="cadeb" value="">
|
||||
@error('cadeb')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Jenis Aset
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('aset') border-danger bg-danger-light @enderror"
|
||||
type="text" name="aset" value="">
|
||||
@error('aset')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Fasilitas Kredit
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('kredit') border-danger bg-danger-light @enderror"
|
||||
type="text" name="kredit" value="">
|
||||
@error('kredit')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Alamat Objek
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('alamat') border-danger bg-danger-light @enderror"
|
||||
type="text" name="alamat" value="">
|
||||
@error('alamat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Cabang Pemohon
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('cabang') border-danger bg-danger-light @enderror"
|
||||
type="text" name="cabang" value="">
|
||||
@error('cabang')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
AO
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('ao') border-danger bg-danger-light @enderror" type="text"
|
||||
name="ao" value="">
|
||||
@error('ao')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('surveyor') border-danger bg-danger-light @enderror"
|
||||
type="text" name="surveyor" value="">
|
||||
@error('surveyor')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('penilai') border-danger bg-danger-light @enderror"
|
||||
type="text" name="penilai" value="">
|
||||
@error('penilai')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Survey
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tanggal_survey') border-danger bg-danger-light @enderror"
|
||||
type="date" name="tanggal_survey" value="">
|
||||
@error('tanggal_survey')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Nomor Resume
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_resume') border-danger bg-danger-light @enderror"
|
||||
type="number" name="nomor_resume" value="">
|
||||
@error('nomor_resume')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
Tanggal Resume
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tanggal_resume') border-danger bg-danger-light @enderror"
|
||||
type="date" name="tanggal_resume" value="">
|
||||
@error('tanggal_resume')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Faktor Positif
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('faktor_positif') border-danger bg-danger-light @enderror" rows="3"
|
||||
type="number" id="faktor_positif" name="faktor_positif"></textarea>
|
||||
@error('faktor_positif')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Faktor Negatif
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('faktor_negatif') border-danger bg-danger-light @enderror" rows="3"
|
||||
type="number" id="faktor_negatif" name="faktor_negatif"></textarea>
|
||||
@error('faktor_negatif')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<label class="form-label">Kesimpulan Nilai Pasar</label>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Sesuai Fisik
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="input w-full @error('sertifikat') border-danger bg-danger-light @enderror"
|
||||
type="text" name="sertifikat" placeholder="Sertifikat" value="">
|
||||
@error('sertifikat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_tanah') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_tanah" placeholder="Luas tanah" value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_bangunan') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_bangunan" placeholder="Luas bangunan"
|
||||
value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<span class="input-unit left">Rp</span>
|
||||
<input
|
||||
class="right-group input w-full pl-8 @error('pasar_wajar') border-danger bg-danger-light @enderror"
|
||||
type="number" name="pasar_wajar" placeholder="Nilai pasar wajar"
|
||||
value="">
|
||||
@error('pasar_wajar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Sesuai IMB
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="input w-full @error('sertifikat') border-danger bg-danger-light @enderror"
|
||||
type="text" name="sertifikat" placeholder="Sertifikat" value="">
|
||||
@error('sertifikat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_tanah') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_tanah" placeholder="Luas tanah" value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_bangunan') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_bangunan" placeholder="Luas bangunan"
|
||||
value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<span class="input-unit left">Rp</span>
|
||||
<input
|
||||
class="right-group input w-full pl-8 @error('pasar_wajar') border-danger bg-danger-light @enderror"
|
||||
type="number" name="pasar_wajar" placeholder="Nilai pasar wajar"
|
||||
value="">
|
||||
@error('pasar_wajar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Asumsi nilai terpotong jalan/GSB
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="input w-full @error('sertifikat') border-danger bg-danger-light @enderror"
|
||||
type="text" name="sertifikat" placeholder="Sertifikat" value="">
|
||||
@error('sertifikat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_tanah') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_tanah" placeholder="Luas tanah" value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<input
|
||||
class="left-group input w-full @error('luas_bangunan') border-danger bg-danger-light @enderror"
|
||||
type="number" name="luas_bangunan" placeholder="Luas bangunan"
|
||||
value="">
|
||||
<span class="input-unit right">m²</span>
|
||||
@error('luas_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full">
|
||||
<span class="input-unit left">Rp</span>
|
||||
<input
|
||||
class="right-group input w-full pl-8 @error('pasar_wajar') border-danger bg-danger-light @enderror"
|
||||
type="number" name="pasar_wajar" placeholder="Nilai pasar wajar"
|
||||
value="">
|
||||
@error('pasar_wajar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan perlu diperhatikan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('catatan') border-danger bg-danger-light @enderror" rows="3" type="number"
|
||||
id="catatan" name="catatan"></textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
DISCLAIMER
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<ol>
|
||||
<li>Laporan Resume ini dikeluarkan dikarenakan belum dilakukannya pembayaran biaya
|
||||
penilaian jaminan</li>
|
||||
<li>Laporan Resume ini tidak bisa dijadikan sebagai dasar pengajuan dan atau pencairan
|
||||
kredit, laporan yang digunakan tetap wajib berupa Laporan Penilaian Jaminan (LPJ)
|
||||
</li>
|
||||
<li>Detail per meter tanah dan bangunan, sarana pelengkap dll akan tercatat di Laporan
|
||||
Penilaian Jaminan (LPJ) nanti</li>
|
||||
<li>Laporan Resume ini hanya digunakan untuk kepentingan internal bagi</li>
|
||||
<li>Laporan resume ini hanya berlaku <span class="text-red-500">14 hari</span> kerja
|
||||
terhitung dari tanggal resume ini dibuat sesuai aturan yang berlaku, apabila lewat
|
||||
maka harus dilakukan order ulang sesuai prosedur yang berlaku</li>
|
||||
<li>Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<label class="form-label">Salam,</label>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex items-center w-full lg:w-1/2 gap-2.5">
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
PENILAI
|
||||
</label>
|
||||
<label class="form-label max-w-56 lg:w-32">
|
||||
SENIOR OFICER
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <form method="POST" action="">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<input type="hidden" name="action" value="">
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
||||
name="name" value="">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form> --}}
|
||||
</div>
|
||||
@endsection
|
||||
92
resources/views/laporan_admin_kredit/form.blade.php
Normal file
92
resources/views/laporan_admin_kredit/form.blade.php
Normal file
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-admin-kredit-edit', $laporanAdminKredit) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">
|
||||
Edit Laporan Admin Kredit
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('laporan-admin-kredit.update', $laporanAdminKredit->id) }}" method="POST" class="grid gap-5">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
||||
<!-- Editable Fields -->
|
||||
<div class="form-group">
|
||||
<label for="kode_register_t24" class="form-label">Kode Register T24</label>
|
||||
<input type="text" name="kode_register_t24" id="kode_register_t24" class="input" value="{{ $laporanAdminKredit->kode_register_t24 }}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cif" class="form-label">CIF</label>
|
||||
<input type="text" name="cif" id="cif" class="input" value="{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->cif : '' }}" required>
|
||||
</div>
|
||||
|
||||
<!-- Read-only Information Fields -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Debitur</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->name : '' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Cabang</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->branch->name : '' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Jenis Agunan</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->jenis_agunan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Bukti Kepemilikan</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->bukti_kepemilikan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Alamat Agunan</label>
|
||||
<div class="textarea bg-gray-100 h-auto min-h-[70px] p-3">{{ $laporanAdminKredit->alamat_agunan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Pemilik</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->nama_pemilik }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Tanggal Kunjungan</label>
|
||||
<div class="input bg-gray-100">{{ \Carbon\Carbon::parse($laporanAdminKredit->tanggal_kunjungan)->format('d-m-Y') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nilai Pasar Wajar</label>
|
||||
<div class="input bg-gray-100">{{ number_format($laporanAdminKredit->nilai_pasar_wajar, 0, ',', '.') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nilai Likuidasi</label>
|
||||
<div class="input bg-gray-100">{{ number_format($laporanAdminKredit->nilai_likuidasi, 0, ',', '.') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Penilai</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->nama_penilai }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('laporan-admin-kredit.index') }}" class="btn btn-light">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
241
resources/views/laporan_admin_kredit/index.blade.php
Normal file
241
resources/views/laporan_admin_kredit/index.blade.php
Normal file
@@ -0,0 +1,241 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-admin-kredit') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-admin-kredit-table" data-api-url="{{ route('laporan-admin-kredit.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan Admin Kredit
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="tanggal_awal" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="tanggal_akhir" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-admin-kredit.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> CIF </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="kode_register_t24">
|
||||
<span class="sort"> <span class="sort-label"> Kode Register T24 </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_kepemilikan">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Kepemilikan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Alamat Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_pemilik">
|
||||
<span class="sort"> <span class="sort-label"> Nama Pemilik </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_kunjungan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar_wajar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="actions">
|
||||
<span class="sort"> <span class="sort-label"> Actions </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-admin-kredit-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const tanggalAwalInput = document.getElementById('tanggal_awal');
|
||||
const tanggalAkhirInput = document.getElementById('tanggal_akhir');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
cif: {
|
||||
title: 'CIF',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.cif : '';
|
||||
},
|
||||
},
|
||||
kode_register_t24: {
|
||||
title: 'Kode Register T24',
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.name : '';
|
||||
},
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.branch.name : '';
|
||||
},
|
||||
},
|
||||
jenis_agunan: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
bukti_kepemilikan: {
|
||||
title: 'Bukti Kepemilikan',
|
||||
},
|
||||
alamat_agunan: {
|
||||
title: 'Alamat Agunan',
|
||||
},
|
||||
nama_pemilik: {
|
||||
title: 'Nama Pemilik',
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tanggal Kunjungan',
|
||||
render: (item, data) => {
|
||||
return window.formatTanggalIndonesia(data.tanggal_kunjungan);
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_pasar_wajar);
|
||||
},
|
||||
},
|
||||
nilai_likuidasi: {
|
||||
title: 'Nilai Likuidasi',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_likuidasi);
|
||||
},
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a href="laporan-admin-kredit/${data.id}/edit" class="btn btn-sm btn-outline btn-info">
|
||||
<i class="ki-filled ki-pencil"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const tanggalAwal = tanggalAwalInput.value;
|
||||
const tanggalAkhir = tanggalAkhirInput.value;
|
||||
|
||||
console.table(tanggalAwal, tanggalAkhir);
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (tanggalAwal) {
|
||||
filters.tanggal_awal = tanggalAwal
|
||||
}
|
||||
|
||||
if (tanggalAkhir) {
|
||||
filters.tanggal_akhir = tanggalAkhir
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', applyFilters);
|
||||
filterTanggalButton.addEventListener('click', applyFilters);
|
||||
</script>
|
||||
@endpush
|
||||
167
resources/views/laporan_external/create.blade.php
Normal file
167
resources/views/laporan_external/create.blade.php
Normal file
@@ -0,0 +1,167 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form method="POST" action="{{ isset($laporanExternal) ? route('laporan-external.update', $laporanExternal->id) : route('laporan-external.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if(isset($laporanExternal))
|
||||
@method('PUT')
|
||||
@endif
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($laporanExternal) ? 'Edit' : 'Tambah' }} Laporan External
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('laporan-external.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Permohonan ID</label>
|
||||
<input type="hidden" name="permohonan_id" value="{{ $laporanExternal->permohonan_id ?? "" }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<strong>{{ $permohonan->nomor_registrasi }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_laporan') border-danger bg-danger-light @enderror" type="text" name="nomor_laporan" value="{{ old('nomor_laporan', $laporanExternal->nomor_laporan ?? '') }}">
|
||||
@error('nomor_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Final Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tgl_final_laporan') border-danger bg-danger-light @enderror" type="date" name="tgl_final_laporan" value="{{ old('tgl_final_laporan', $laporanExternal->tgl_final_laporan ?? '') }}">
|
||||
@error('tgl_final_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nilai Pasar</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_pasar') border-danger bg-danger-light @enderror" type="number" name="nilai_pasar" value="{{ old('nilai_pasar', $laporanExternal->nilai_pasar ?? '') }}">
|
||||
@error('nilai_pasar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Likuidasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_likuidasi') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_likuidasi" value="{{ old('indikasi_nilai_likuidasi', $laporanExternal->indikasi_nilai_likuidasi ?? '') }}">
|
||||
@error('indikasi_nilai_likuidasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_tanah') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_tanah" value="{{ old('indikasi_nilai_pasar_tanah', $laporanExternal->indikasi_nilai_pasar_tanah ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Estimasi Harga Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('estimasi_harga_tanah') border-danger bg-danger-light @enderror" type="number" name="estimasi_harga_tanah" value="{{ old('estimasi_harga_tanah', $laporanExternal->estimasi_harga_tanah ?? '') }}">
|
||||
@error('estimasi_harga_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Estimasi Harga Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('estimasi_harga_bangunan') border-danger bg-danger-light @enderror" type="number" name="estimasi_harga_bangunan" value="{{ old('estimasi_harga_bangunan', $laporanExternal->estimasi_harga_bangunan ?? '') }}">
|
||||
@error('estimasi_harga_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_bangunan') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_bangunan" value="{{ old('indikasi_nilai_pasar_bangunan', $laporanExternal->indikasi_nilai_pasar_bangunan ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Sarana Pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_sarana_pelengkap') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_sarana_pelengkap" value="{{ old('indikasi_nilai_pasar_sarana_pelengkap', $laporanExternal->indikasi_nilai_pasar_sarana_pelengkap ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Mesin</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_mesin') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_mesin" value="{{ old('indikasi_nilai_pasar_mesin', $laporanExternal->indikasi_nilai_pasar_mesin ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_mesin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Kendaraan/Alat Berat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_kendaraan_alat_berat') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_kendaraan_alat_berat" value="{{ old('indikasi_nilai_pasar_kendaraan_alat_berat', $laporanExternal->indikasi_nilai_pasar_kendaraan_alat_berat ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_kendaraan_alat_berat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">File Resume</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('file_resume') border-danger bg-danger-light @enderror" type="file" name="file_resume">
|
||||
@if(isset($laporanExternal) && $laporanExternal->file_resume)
|
||||
<p class="mt-2">File saat ini: <p class="mt-2">File saat ini: <a href="storage/{{ $laporanExternal->file_resume }}" download="{{ $laporanExternal->file_resume }}" target="_blank" class="badge badge-sm badge-outline">
|
||||
{{ basename($laporanExternal->file_resume) }} <i class="ki-filled ki-cloud-download"></i>
|
||||
</a></p></p>
|
||||
@endif
|
||||
@error('file_resume')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">File Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('file_laporan') border-danger bg-danger-light @enderror" type="file" name="file_laporan">
|
||||
@if(isset($laporanExternal) && $laporanExternal->file_laporan)
|
||||
<p class="mt-2">File saat ini: <a href="storage/{{ $laporanExternal->file_laporan }}" download="{{ $laporanExternal->file_laporan }}" target="_blank" class="badge badge-sm badge-outline">
|
||||
{{ basename($laporanExternal->file_laporan) }} <i class="ki-filled ki-cloud-download"></i>
|
||||
</a></p>
|
||||
@endif
|
||||
@error('file_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-footer flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">{{ isset($laporanExternal) ? 'Update' : 'Simpan' }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
205
resources/views/laporan_external/index.blade.php
Normal file
205
resources/views/laporan_external/index.blade.php
Normal file
@@ -0,0 +1,205 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-external') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-external-table" data-api-url="{{ route('laporan-external.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan External
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan External" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5 hidden">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-external.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('laporan-external.create') }}"> Tambah Laporan External </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_jaminan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="indikasi_nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Indikasi Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="file_resume">
|
||||
<span class="sort"> <span class="sort-label"> File Resume </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="file_laporan">
|
||||
<span class="sort"> <span class="sort-label"> File Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`laporan-external/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Laporan External has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the laporan.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-external-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_laporan: {
|
||||
title: 'Nomor Laporan',
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.penawaran?.tujuan_penilaian_kjpp?.name}` ?? '';
|
||||
}
|
||||
},
|
||||
jenis_jaminan: {
|
||||
title: 'Jenis Jaminan',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.dokumenjaminan[0]?.jenisjaminan?.name}` ?? '';
|
||||
}
|
||||
},
|
||||
nilai_pasar: {
|
||||
title: 'Nilai Pasar',
|
||||
},
|
||||
indikasi_nilai_likuidasi: {
|
||||
title: 'Indikasi Nilai Likuidasi',
|
||||
},
|
||||
file_resume: {
|
||||
title: 'File Resume',
|
||||
render: (item, data) => {
|
||||
return data.file_resume ? `<a href="storage/${data.file_resume}" download="${data.file_resume}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>` : 'N/A';
|
||||
},
|
||||
},
|
||||
file_laporan: {
|
||||
title: 'File Laporan',
|
||||
render: (item, data) => {
|
||||
return data.file_laporan ? `<a href="storage/${data.file_laporan}" download="${data.file_laporan}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>` : 'N/A';
|
||||
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="laporan-external/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,489 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Hasil Penilaian Jaminan Internal & External" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Cabang</label>
|
||||
<select class="select tomselect" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Penilai</label>
|
||||
<select class="select tomselect" id="penilai_filter">
|
||||
<option value="">Semua Penilai</option>
|
||||
@foreach(\MOdules\Usermanagement\Models\User::role(['penilai','surveyor'])->get() as $penilai)
|
||||
<option value="{{ $penilai->id }}">{{ $penilai->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-hasil-penilaian-jaminan-internal-external-table" data-api-url="{{ route('laporan-hasil-penilaian-jaminan-internal-external.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Hasil Penilaian Jaminan Internal & External
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> CIF </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Alamat Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_kepemilikan">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Kepemilikan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_pemilik">
|
||||
<span class="sort"> <span class="sort-label"> Nama Pemilik </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Luas Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Luas Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_njop">
|
||||
<span class="sort"> <span class="sort-label"> Nilai NJOP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar_wajar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_documen_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Dokumen Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_spk">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal SPK </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_spk">
|
||||
<span class="sort"> <span class="sort-label"> Nomor SPK </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_rencana_kunjunagn">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Rencana Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_kunjungan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="taggal_delivered">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Delivered </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jangka_waktu_sla">
|
||||
<span class="sort"> <span class="sort-label"> Jangka Waktu SLA </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Review </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_team_leader">
|
||||
<span class="sort"> <span class="sort-label"> Nama Team Leader </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="saran">
|
||||
<span class="sort"> <span class="sort-label"> Saran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="catatan">
|
||||
<span class="sort"> <span class="sort-label"> Catatan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-datatable-body="true">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-hasil-penilaian-jaminan-internal-external-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const penilaiFilter = document.getElementById('penilai_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
cif: {
|
||||
title: 'CIF',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
jenis_penilaian: {
|
||||
title: 'Jenis Penilaian',
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
jenis_fasilitas_kredit: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
},
|
||||
jenis_agunan: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
alamat_agunan: {
|
||||
title: 'Alamat Agunan',
|
||||
},
|
||||
bukti_kepemilikan: {
|
||||
title: 'Bukti Kepemilikan',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_kepemilikan) {
|
||||
// Ganti karakter baris baru dengan tag <br> untuk HTML
|
||||
return data.bukti_kepemilikan.split('\n').join('<br>');
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
nama_pemilik: {
|
||||
title: 'Nama Pemilik',
|
||||
},
|
||||
luas_tanah: {
|
||||
title: 'Luas Tanah',
|
||||
},
|
||||
nilai_tanah: {
|
||||
title: 'Nilai Tanah',
|
||||
render: (item, data) => {
|
||||
return data.nilai_tanah ?? '-';
|
||||
},
|
||||
},
|
||||
luas_bangunan: {
|
||||
title: 'Luas Bangunan',
|
||||
},
|
||||
nilai_bangunan: {
|
||||
title: 'Nilai Bangunan',
|
||||
render: (item, data) => {
|
||||
return data.nilai_bangunan ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_njop: {
|
||||
title: 'Nilai NJOP',
|
||||
render: (item, data) => {
|
||||
return data.nilai_njop ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return data.nilai_pasar_wajar ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_likuidasi: {
|
||||
title: 'Nilai Likuidasi',
|
||||
render: (item, data) => {
|
||||
return data.nilai_likuidasi ?? '-';
|
||||
},
|
||||
},
|
||||
tanggal_documen_diterima: {
|
||||
title: 'Tanggal Dokumen Diterima',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_documen_diterima ? window.formatTanggalIndonesia(data.tanggal_documen_diterima) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_spk: {
|
||||
title: 'Tanggal SPK',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_spk ? window.formatTanggalIndonesia(data.tanggal_spk) : '-';
|
||||
},
|
||||
},
|
||||
nomor_spk: {
|
||||
title: 'Nomor SPK',
|
||||
},
|
||||
tanggal_rencana_kunjunagn: {
|
||||
title: 'Tanggal Rencana Kunjungan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_rencana_kunjunagn ? window.formatTanggalIndonesia(data.tanggal_rencana_kunjunagn) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tanggal Kunjungan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_kunjungan ? window.formatTanggalIndonesia(data.tanggal_kunjungan) : '-';
|
||||
},
|
||||
},
|
||||
taggal_delivered: {
|
||||
title: 'Tanggal Delivered',
|
||||
render: (item, data) => {
|
||||
return data.taggal_delivered ? window.formatTanggalIndonesia(data.taggal_delivered) : '-';
|
||||
},
|
||||
},
|
||||
jangka_waktu_sla: {
|
||||
title: 'Jangka Waktu SLA',
|
||||
},
|
||||
tanggal_laporan: {
|
||||
title: 'Tanggal Laporan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_review: {
|
||||
title: 'Tanggal Review',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_review ? window.formatTanggalIndonesia(data.tanggal_review) : '-';
|
||||
},
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
nama_team_leader: {
|
||||
title: 'Nama Team Leader',
|
||||
},
|
||||
saran: {
|
||||
title: 'Saran',
|
||||
},
|
||||
catatan: {
|
||||
title: 'Catatan',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
const penilai = penilaiFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
if (penilai) {
|
||||
filters.penilai_id = penilai;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (penilaiFilter.value) {
|
||||
url.searchParams.set('penilai_id', penilaiFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('penilai_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
283
resources/views/laporan_pembatalan/index.blade.php
Normal file
283
resources/views/laporan_pembatalan/index.blade.php
Normal file
@@ -0,0 +1,283 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-pembatalan') }}--}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-pembatalan-table" data-api-url="{{ route('laporan-pembatalan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Pembatalan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Pembatalan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-pembatalan.export') }}" id="export-btn"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembatalan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alasan_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Alasan Pembatalan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="diajukan_oleh">
|
||||
<span class="sort"> <span class="sort-label"> Diajukan Oleh </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="disetujui_oleh">
|
||||
<span class="sort"> <span class="sort-label"> Disetujui Oleh </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_disetujui">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Disetujui </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-pembatalan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const statusFilter = document.getElementById('status_filter');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
},
|
||||
tanggal_pembatalan: {
|
||||
title: 'Tanggal Pembatalan',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
debitur: {
|
||||
title: 'Debitur',
|
||||
},
|
||||
alasan_pembatalan: {
|
||||
title: 'Alasan Pembatalan',
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let statusClass = '';
|
||||
let statusText = '';
|
||||
|
||||
switch (data.status) {
|
||||
case 'batal':
|
||||
statusClass = 'badge-danger';
|
||||
statusText = 'Batal';
|
||||
break;
|
||||
default:
|
||||
statusClass = 'badge-secondary';
|
||||
statusText = data.status;
|
||||
}
|
||||
|
||||
return `<span class="badge ${statusClass}">${statusText}</span>`;
|
||||
},
|
||||
},
|
||||
diajukan_oleh: {
|
||||
title: 'Diajukan Oleh',
|
||||
},
|
||||
disetujui_oleh: {
|
||||
title: 'Disetujui Oleh',
|
||||
},
|
||||
tanggal_disetujui: {
|
||||
title: 'Tanggal Disetujui',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (status) {
|
||||
filters.status = status;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
|
||||
branchFilter.addEventListener('change', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
354
resources/views/laporan_penilaian_jaminan/index.blade.php
Normal file
354
resources/views/laporan_penilaian_jaminan/index.blade.php
Normal file
@@ -0,0 +1,354 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-penilaian-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Penilaian Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Cabang</label>
|
||||
<select class="select tomselect" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Penilai</label>
|
||||
<select class="select tomselect" id="penilai_filter">
|
||||
<option value="">Semua Penilai</option>
|
||||
@foreach(\MOdules\Usermanagement\Models\User::role(['penilai','surveyor'])->get() as $penilai)
|
||||
<option value="{{ $penilai->id }}">{{ $penilai->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-penilaian-jaminan-table" data-api-url="{{ route('laporan-penilaian-jaminan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Penilaian Jaminan
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Alamat Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Luas Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Luas Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Review </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar_wajar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-penilaian-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const penilaiFilter = document.getElementById('penilai_filter');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
jenis_agunan: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
alamat_agunan: {
|
||||
title: 'Alamat Agunan',
|
||||
},
|
||||
luas_tanah: {
|
||||
title: 'Luas Tanah',
|
||||
},
|
||||
nilai_tanah: {
|
||||
title: 'Nilai Tanah',
|
||||
},
|
||||
luas_bangunan: {
|
||||
title: 'Luas Bangunan',
|
||||
},
|
||||
nilai_bangunan: {
|
||||
title: 'Nilai Bangunan',
|
||||
},
|
||||
tanggal_laporan: {
|
||||
title: 'Tanggal Laporan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_review: {
|
||||
title: 'Tanggal Review',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_review ? window.formatTanggalIndonesia(data.tanggal_review) : '-';
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return data.nilai_pasar_wajar;
|
||||
},
|
||||
},
|
||||
nilai_likuidasi: {
|
||||
title: 'Nilai Likuidasi',
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
const penilai = penilaiFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
if (penilai) {
|
||||
filters.penilai_id = penilai;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
if (penilaiFilter.value) {
|
||||
url.searchParams.set('penilai_id', penilaiFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('penilai_id');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
298
resources/views/laporan_permohonan/index.blade.php
Normal file
298
resources/views/laporan_permohonan/index.blade.php
Normal file
@@ -0,0 +1,298 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-permohonan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-permohonan-table" data-api-url="{{ route('laporan-permohonan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Permohonan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="status_filter">
|
||||
<option value="">Semua Status</option>
|
||||
@foreach(\Modules\Lpj\Models\StatusPermohonan::where('status', 1)->get() as $status)
|
||||
<option value="{{ $status->slug }}">{{ $status->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Permohonan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-permohonan.export') }}" id="export-btn"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const statusFilter = document.getElementById('status_filter');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return window.formatTanggalIndonesia(data.tanggal_permohonan);
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.branch ? data.branch.name : '';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
console.log(data);
|
||||
return data.tujuan_penilaian ? data.tujuan_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return data.jenis_fasilitas_kredit ? data.jenis_fasilitas_kredit.name : '';
|
||||
},
|
||||
},
|
||||
jenis_penilaian: {
|
||||
title: 'Jenis Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.jenis_penilaian ? data.jenis_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
user: {
|
||||
title: 'Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user ? data.user.name : '';
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let statusClass = '';
|
||||
let statusText = '';
|
||||
|
||||
switch (data.status) {
|
||||
case 'pending':
|
||||
statusClass = 'badge-warning';
|
||||
statusText = 'Pending';
|
||||
break;
|
||||
case 'approved':
|
||||
statusClass = 'badge-success';
|
||||
statusText = 'Approved';
|
||||
break;
|
||||
case 'rejected':
|
||||
statusClass = 'badge-danger';
|
||||
statusText = 'Rejected';
|
||||
break;
|
||||
default:
|
||||
statusClass = 'badge-secondary';
|
||||
statusText = data.status;
|
||||
}
|
||||
|
||||
return `<span class="badge ${statusClass}">${statusText}</span>`;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const status = statusFilter.value;
|
||||
const branch = branchFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (status) {
|
||||
filters.status = status;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (statusFilter.value) {
|
||||
url.searchParams.set('status', statusFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('status');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
58
resources/views/nilai_plafond/create.blade.php
Normal file
58
resources/views/nilai_plafond/create.blade.php
Normal file
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($nilaiPlafond->id))
|
||||
<form action="{{ route('basicdata.nilai-plafond.update', $nilaiPlafond->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $nilaiPlafond->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.nilai-plafond.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($nilaiPlafond->id) ? 'Edit' : 'Tambah' }} Nilai Plafond
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.nilai-plafond.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $nilaiPlafond->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $nilaiPlafond->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
147
resources/views/nilai_plafond/index.blade.php
Normal file
147
resources/views/nilai_plafond/index.blade.php
Normal file
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.nilai-plafond') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="nilai-plafond-table" data-api-url="{{ route('basicdata.nilai-plafond.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Nilai Plafond
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Nilai Plafond" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.nilai-plafond.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.nilai-plafond.create') }}"> Tambah Nilai Plafond </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Plafond </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/nilai-plafond/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#nilai-plafond-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Nilai Plafond',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/nilai-plafond/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
126
resources/views/noc/form.blade.php
Normal file
126
resources/views/noc/form.blade.php
Normal file
@@ -0,0 +1,126 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
NOC
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('noc.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('noc.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="penawaran_id" value="{{ $persetujuanPenawaran->penawaran_id ?? old('penawaran_id') }}">
|
||||
<input type="hidden" name="persetujuan_penawaran_id" value="{{ $persetujuanPenawaran->id ?? old('persetujuan_penawaran_id') }}">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $persetujuanPenawaran->penawaran->permohonan->id ?? $persetujuanPenawaran->permohonan->id }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_pembayar') border-danger bg-danger-light @enderror" name="status_pembayar" id="status_pembayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_pembayar') == 'sudah_bayar') || ($persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_pembayar') == 'belum_bayar') || ($persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Total Harus Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="total_harus_bayar" id="total_harus_bayar" class="input w-full @error('total_harus_bayar') border-danger bg-danger-light @enderror" value="{{ old('total_harus_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}" readonly>
|
||||
@error('total_harus_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar" class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror" value="{{ old('nominal_bayar', $persetujuanPenawaran->noc->nominal_bayar ?? '') }}" placeholder="Masukkan nominal bayar">
|
||||
@error('nominal_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti KSL
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_ksl" id="bukti_ksl" class="file-input w-full @error('bukti_ksl') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_ksl')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
@if(isset($persetujuanPenawaran->noc->bukti_ksl) && !empty($persetujuanPenawaran->noc->bukti_ksl))
|
||||
<div class="mt-2 flex items-center">
|
||||
<span class="text-sm text-gray-600 mr-2">File yang sudah diupload:</span>
|
||||
<a href="{{ asset('storage/' . $persetujuanPenawaran->noc->bukti_ksl) }}"
|
||||
|
||||
|
||||
target="_blank" class="text-blue-600 hover:text-blue-800 underline flex items-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
Lihat File
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4" class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" readonly placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan NOC
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan_noc" id="catatan_noc" rows="4" class="textarea w-full @error('catatan_noc') border-danger bg-danger-light @enderror" placeholder="Masukkan catatan noc">{{ old('catatan_noc', $persetujuanPenawaran->noc->catatan_noc ?? '') }}</textarea>
|
||||
@error('catatan_noc')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Proses
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
175
resources/views/noc/index.blade.php
Normal file
175
resources/views/noc/index.blade.php
Normal file
@@ -0,0 +1,175 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('noc') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar NOC
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search NOC" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
||||
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function prosesData(data) {
|
||||
Swal.fire({
|
||||
title: 'NOC',
|
||||
text: "Apakah Anda yakin ingin menyetujui pembayaran ini?",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Tidak'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `noc/${data}/edit`;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#noc-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi'
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal Setor',
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
},
|
||||
bukti_ksl: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_ksl) {
|
||||
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tanggal Penyelesaian',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-outline btn-info" onclick="prosesData(${data.id})">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
129
resources/views/otorisasipenawaran/edit.blade.php
Normal file
129
resources/views/otorisasipenawaran/edit.blade.php
Normal file
@@ -0,0 +1,129 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
@php
|
||||
// $route = Route::currentRouteName();
|
||||
// dd($route);
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- $id ==> penawaran.id -->
|
||||
<input type="hidden" id="id" name="id" value="{{ $id }}">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Tambah Data Otorisasi Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('otorisasitender.penawaran.show', $id) }}" class="btn btn-xs btn-primary" title="Detail"><i class="ki-filled ki-abstract-26"></i> Detail</a>
|
||||
<a href="{{ route('otorisasitender.penawaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
<label class="card-title" id="textReg">
|
||||
No. registrasi
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
<label class="card-title" id="textCodePenawaran">
|
||||
Nomor Penawaran
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Status Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
<label class="card-title" id="textStatusPenawaran">
|
||||
Status
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<!-- datatables -->
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Data KJPP</h3>
|
||||
<button type="button" class="btn btn-sm btn-danger" id="{{$route[1]}}_toPenawaranUlang">
|
||||
<i class="ki-filled ki-wrench"></i>Penawaran Ulang
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto">
|
||||
<table class="table table-border align-middle text-gray-700 font-medium text-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14 text-center">No</th>
|
||||
<th class="min-w-[80px]">KJPP</th>
|
||||
<th>No Proposal</th>
|
||||
<th>Tanggal Proposal</th>
|
||||
<th>Biaya Penawaran</th>
|
||||
<th>Dokumen Penawaran</th>
|
||||
<th class="min-w-[50px] text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbodyKJPP1">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- datatables -->
|
||||
<div class="flex justify-end">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<!-- datatables -->
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Data KJPP Sebelumnya</h3>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto">
|
||||
<table class="table table-border align-middle text-gray-700 font-medium text-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14 text-center">No</th>
|
||||
<th class="min-w-[80px]">KJPP</th>
|
||||
<th>No Proposal</th>
|
||||
<th>Tanggal Proposal</th>
|
||||
<th>Biaya Penawaran</th>
|
||||
<th>Dokumen Penawaran</th>
|
||||
<th>created_at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbodyKJPPLog">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- datatables -->
|
||||
<div class="flex justify-end">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::otorisasipenawaran.js.editjs')
|
||||
202
resources/views/otorisasipenawaran/index.blade.php
Normal file
202
resources/views/otorisasipenawaran/index.blade.php
Normal file
@@ -0,0 +1,202 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('otorisasitender.penawaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="otorisasipenawaran-table" data-api-url="{{ route('otorisasitender.penawaran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Otorisasi Penawaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Otorisasi penawaran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Penawaran</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_pemohon">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branches_name">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debiture">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="date_range">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_name">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_kjpp_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian KJPP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="penawarandetails_count">
|
||||
<span class="sort"> <span class="sort-label"> Total KJPP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function showOtorisasiPenawaranData(regId)
|
||||
{
|
||||
var url = "{{ url('otorisasitender/penawaran') }}/"+regId;
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#otorisasipenawaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
'nomor_registrasi': {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
code: {
|
||||
title: 'Nomor Penawaran',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
},
|
||||
user_pemohon: {
|
||||
title: 'User Pemohon',
|
||||
},
|
||||
branches_name: {
|
||||
title: 'Cabang Pemohon',
|
||||
},
|
||||
debiture: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
if(data.debitures_name) {
|
||||
return `${data.debitures_name}`;
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
},
|
||||
date_range: {
|
||||
title: 'Tanggal Penawaran',
|
||||
},
|
||||
tujuan_penilaian_name: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian_name
|
||||
}
|
||||
},
|
||||
tujuan_penilaian_kjpp: {
|
||||
title: 'Tujuan Penilaian KJPP',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian_kjpp_name
|
||||
}
|
||||
},
|
||||
penawarandetails_count: {
|
||||
title: 'Total KJPP',
|
||||
createdCell(cell) {
|
||||
cell.classList.add('text-center');
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return data.status.toUpperCase()
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
// data.id ==> penawaran.id
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a onclick="showOtorisasiPenawaranData(${data.id})" class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Otorisasi Penawaran" href="otorisasitender/penawaran/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
89
resources/views/otorisasipenawaran/js/editextjs.blade.php
Normal file
89
resources/views/otorisasipenawaran/js/editextjs.blade.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<script tipe="module">
|
||||
function switchProses(id) {
|
||||
removeErrorCssMsg();
|
||||
let c = $('#{{ $route[1] }}_check_' + id).val();
|
||||
|
||||
if ($('input[name="{{ $route[1] }}_check_' + id + '"]').is(':checked')) {
|
||||
// checked
|
||||
// alert('aktif nih');
|
||||
setActiveElement(id);
|
||||
} else {
|
||||
// unchecked
|
||||
//alert('tdk aktif nih');
|
||||
setNonActiveElement(id);
|
||||
}
|
||||
}
|
||||
|
||||
function setActiveElement(id) {
|
||||
$('#{{ $route[1] }}_biayaPenawaran_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_icon_update_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_icon_delete_' + id).removeAttr('disabled');
|
||||
}
|
||||
|
||||
function setNonActiveElement(id) {
|
||||
$('#{{ $route[1] }}_biayaPenawaran_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_icon_update_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_icon_delete_' + id).attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||
Swal.fire({
|
||||
title: ' ',
|
||||
text: "Yakin akan Otorisasi " + kjppName + "?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL =
|
||||
"{{ route($route[0] . '.' . $route[1] . '.otorisasiPenawaranKJPP', ['id' => 'PLACEHOLDER']) }}"
|
||||
.replace('PLACEHOLDER', id);
|
||||
let noReg = $("#textReg").text();
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = id;
|
||||
input_data.penawaran_id = penawaran_id;
|
||||
input_data.kjpp_id = kjpp_id;
|
||||
input_data.kjppName = kjppName;
|
||||
input_data.biaya_penawaran = biaya_penawaran;
|
||||
input_data.noReg = noReg;
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if ('success' == response.status) {
|
||||
swal.fire('Sukses Otorisasi!', response.message.message_success[0],
|
||||
'success').then(() => {
|
||||
var url = "{{ route('otorisasitender.penawaran.index') }}";
|
||||
$(location).attr('href', url);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message.message_error[0], 'error');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
210
resources/views/otorisasipenawaran/js/editjs.blade.php
Normal file
210
resources/views/otorisasipenawaran/js/editjs.blade.php
Normal file
@@ -0,0 +1,210 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::otorisasipenawaran.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
$(document).ready(function() {
|
||||
prepareForm();
|
||||
});
|
||||
|
||||
function prepareForm()
|
||||
{
|
||||
setData();
|
||||
}
|
||||
|
||||
function setData()
|
||||
{
|
||||
let id = $("#id").val();
|
||||
let token = "{{ csrf_token() }}";
|
||||
// alert('token = ' + token);
|
||||
var useURL = "{{ route('otorisasitender.penawaran.setData') }}";
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = id;
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "POST",
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
beforeSend: function() {
|
||||
// if ($("#myLoader").hasClass("pre-loader hidden")) {
|
||||
// pleaseStartLoader();
|
||||
// }
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
|
||||
if("success"==response.status)
|
||||
{
|
||||
var statusText = response.penawaran.status;
|
||||
$("#textReg").text(response.penawaran.nomor_registrasi);
|
||||
$("#textCodePenawaran").text(response.penawaran.code);
|
||||
$("#textStatusPenawaran").text(statusText);
|
||||
setTablesKJPP1(response.penawrandetails);
|
||||
setTablesKJPPLog(response.penawarandetailLogs);
|
||||
}
|
||||
else
|
||||
{
|
||||
toastrError(response.message);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr) {
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setTablesKJPP1(datas)
|
||||
{
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var no_proposal = (value.no_proposal)??'';// alert(no_proposal);
|
||||
var tgl_proposal = (value.tgl_proposal)??'';// alert(tgl_proposal);
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
var htmlDokumenPersetujuanDownload='';
|
||||
var dokumenPersetujuanDownload = value.dokumen_persetujuan;
|
||||
if(dokumenPersetujuanDownload)
|
||||
{
|
||||
htmlDokumenPersetujuanDownload='<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a href="'+value.dokumen_persetujuan+'" class="badge badge-sm badge-outline" download="'+value.attachment+'">'+value.attachment+' <i class="ki-filled ki-cloud-download"></i></a></div>';
|
||||
}
|
||||
|
||||
// pengecekan kondisi format number
|
||||
var biaya_penawaran_format = "";
|
||||
if(biaya_penawaran)
|
||||
biaya_penawaran_format=tandaPemisahTitik(biaya_penawaran);
|
||||
|
||||
var markup = '<tr>';
|
||||
markup +='<td valign="top">'+i+'</td>';
|
||||
markup +='<td valign="top"><label id="{{$route[1]}}_kjppName_'+value.id+'">'+kjppName+'</label></td>';
|
||||
markup +='<td valign="top">'+no_proposal+'</td>';
|
||||
markup +='<td valign="top">'+tgl_proposal+'</td>';
|
||||
markup +='<td valign="top" align="right">Rp.'+biaya_penawaran_format+'</td>';
|
||||
markup +='<td><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td><div class="flex flex-nowrap justify-center">';
|
||||
markup +='<a class="btn btn-sm btn-icon btn-clear btn-success" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Otorisasi Penawaran '+kjppName+'" onclick="otorisasiKJPP('+value.penawaran_id+','+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\',\''+biaya_penawaran+'\')"><i class="ki-outline ki-notepad-edit"></i></a>';
|
||||
markup += '</tr>';
|
||||
|
||||
$('#tbodyKJPP1').append(markup);
|
||||
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on("input", "input:file", function(e) {
|
||||
let fileName = e.target.files[0].name;
|
||||
let inputFile = e.target.id;
|
||||
const myArray = inputFile.split("_");
|
||||
let penawaranID = myArray[myArray.length-1];
|
||||
let kjppName = $("#{{$route[1]}}_kjppName_"+penawaranID).text();
|
||||
let upld = fileName.split(".").pop();
|
||||
if(upld == "pdf" || upld =="PDF"){}
|
||||
else{
|
||||
removeErrorCssMsg();
|
||||
$("#{{$route[1]}}_dokumenPersetujuan_"+penawaranID).addClass(" border-danger");
|
||||
$("#{{$route[1]}}_dokumenPersetujuan_msg_"+penawaranID).text("Silahkan Masukan tipe file PDF Mas");
|
||||
$("#"+inputFile).val("");
|
||||
}
|
||||
});
|
||||
|
||||
function setTablesKJPPLog(datas)
|
||||
{
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var no_proposal = (value.no_proposal)??'';// alert(no_proposal);
|
||||
var tgl_proposal = (value.tgl_proposal)??'';// alert(tgl_proposal);
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
var htmlDokumenPersetujuanDownload='';
|
||||
var dokumenPersetujuanDownload = value.dokumen_persetujuan;
|
||||
if(dokumenPersetujuanDownload)
|
||||
{
|
||||
htmlDokumenPersetujuanDownload='<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a href="'+value.dokumen_persetujuan+'" class="badge badge-sm badge-outline" download="'+value.attachment+'">'+value.attachment+' <i class="ki-filled ki-cloud-download"></i></a></div>';
|
||||
}
|
||||
|
||||
// pengecekan kondisi format number
|
||||
var biaya_penawaran_format = "";
|
||||
if(biaya_penawaran)
|
||||
biaya_penawaran_format=tandaPemisahTitik(biaya_penawaran);
|
||||
|
||||
var markup = '<tr>';
|
||||
markup +='<td valign="top">'+i+'</td>';
|
||||
markup +='<td valign="top"><label id="{{$route[1]}}_kjppName_'+value.id+'">'+kjppName+'</label></td>';
|
||||
markup +='<td valign="top">'+no_proposal+'</td>';
|
||||
markup +='<td valign="top">'+tgl_proposal+'</td>';
|
||||
markup +='<td valign="top" align="right">Rp.'+biaya_penawaran_format+'</td>';
|
||||
markup +='<td><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td valign="top"><label id="{{$route[1]}}_kjppName_'+value.id+'">'+value.created_at2+'</label></td>';
|
||||
|
||||
$('#tbodyKJPPLog').append(markup);
|
||||
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
// update status
|
||||
$("#{{$route[1]}}_toPenawaranUlang").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Swal.fire({
|
||||
title: ' ',
|
||||
text: "Yakin akan Penawaran ulang?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed)
|
||||
{
|
||||
//define variable
|
||||
// $id ==> penawaran.id
|
||||
let token = "{{ csrf_token() }}";
|
||||
let noReg = $("#textReg").text();
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.penawaranulang',$id) }}";
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = "{{ $id }}";
|
||||
input_data.noReg =noReg;
|
||||
// alert('url = ' + useURL);
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if('success' == response.status)
|
||||
{
|
||||
swal.fire('Sukses Penawaran ulang!', response.message.message_success[0], 'success').then(() => {
|
||||
var url = "{{ route('otorisasitender.penawaran.index') }}";
|
||||
$(location).attr('href',url);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Swal.fire('Error!', response.message.message_error[0], 'error');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
27
resources/views/otorisasipenawaran/show.blade.php
Normal file
27
resources/views/otorisasipenawaran/show.blade.php
Normal file
@@ -0,0 +1,27 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@php
|
||||
$buttonProses='';
|
||||
$buttonProses='<a href="'. route('otorisasitender.penawaran.edit', $id) .'" class="btn btn-xs btn-primary" title="Otorisasi Penawaran"><i class="ki-outline ki-arrow-circle-right"></i> Otorisasi Penawaran</a>';
|
||||
@endphp
|
||||
|
||||
@include('lpj::component.detail-jaminan', [
|
||||
'customlink' => $buttonProses,
|
||||
'backLink' => 'otorisasitender.penawaran.index',
|
||||
'title' => 'Detail Data Otorisasi Penawaran',
|
||||
'penawaran' => $prosespenawaran,
|
||||
])
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
80
resources/views/pembatalan/form.blade.php
Normal file
80
resources/views/pembatalan/form.blade.php
Normal file
@@ -0,0 +1,80 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Form Pembatalan Permohonan</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembatalan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('pembatalan.update', $pembatalan) }}" method="POST" class="grid gap-5">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $pembatalan->permohonan->id }}">
|
||||
<input type="text" class="input" value="{{ $pembatalan->permohonan->nomor_registrasi ?? '' }}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" class="input" value="{{ $pembatalan->permohonan->debiture->name ?? '' }}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Alasan Pembatalan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea readonly class="textarea @error('alasan_pembatalan') border-danger bg-danger-light @enderror"
|
||||
name="alasan_pembatalan"
|
||||
rows="4">{{ old('alasan_pembatalan', $pembatalan->alasan_pembatalan ) }}</textarea>
|
||||
@error('alasan_pembatalan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Pendukung
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if($pembatalan->file_pembatalan)
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ Storage::url($pembatalan->file_pembatalan) }}" target="_blank" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-eye"></i> Lihat Dokumen Pendukung
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@error('file_pembatalan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary mr-3" name="status" value="approved">Approve</button>
|
||||
<button type="submit" class="btn btn-danger" name="status" value="rejected">Reject</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
185
resources/views/pembatalan/index.blade.php
Normal file
185
resources/views/pembatalan/index.blade.php
Normal file
@@ -0,0 +1,185 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembatalan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="pembatalan-table" data-api-url="{{ route('pembatalan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembatalan Permohonan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Pembatalan Peprmohonan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_pemohon">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alasan_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Alasan Pembatalan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="file_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Dokumen Pendukung </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#pembatalan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.nomor_registrasi}`;
|
||||
},
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.debiture.name}`;
|
||||
},
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.branch.name}`;
|
||||
},
|
||||
},
|
||||
user_pemohon: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.creator.name}`;
|
||||
},
|
||||
},
|
||||
alasan_pembatalan: {
|
||||
title: 'Alasan Pembatalan'
|
||||
},
|
||||
file_pembatalan: {
|
||||
title: 'Dokumen Pendukung',
|
||||
render: (item, data) => {
|
||||
if (data.file_pembatalan) {
|
||||
return `<a href="storage/${data.file_pembatalan}" download="${data.file_pembatalan}" target="_blank" class="badge badge-sm badge-outline"> Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return 'Tidak ada dokumen';
|
||||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
if (data.status === 'pending') {
|
||||
return `<span class="badge badge-sm badge-warning flex justify-center">Pending</span>`;
|
||||
} else if (data.status === 'approved') {
|
||||
return `<span class="badge badge-sm badge-success flex justify-center">Diterima</span>`;
|
||||
} else if (data.status === 'rejected') {
|
||||
return `<span class="badge badge-sm badge-danger flex justify-center">Ditolak</span>`;
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
@if(auth()->user()->roles()->first()->name === "administrator" || auth()->user()->roles()->first()->name === "pemohon-eo")
|
||||
if (data.status === 'pending') {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-outline btn-warning" href="pembatalan/${data.id}/edit" title="Detail Pembatalan">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@else
|
||||
return '';
|
||||
@endif
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
378
resources/views/pembayaran/approval.blade.php
Normal file
378
resources/views/pembayaran/approval.blade.php
Normal file
@@ -0,0 +1,378 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran.approval') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false"
|
||||
id="pembayaran-table" data-api-url="{{ route('pembayaran.approval.datatables') }}">
|
||||
<div class="card-header light:bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Pembayaran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="approval_by">
|
||||
<span class="sort"> <span class="sort-label"> Approval By </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="approve_keterangan_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Keterangan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function handlePembayaran(id, type) {
|
||||
let rv = type
|
||||
let title = type === 'revisi' ? 'Apakah Anda yakin ingin merevisi pembayaran ini?' : 'Apakah Anda yakin?';
|
||||
let text = type === 'revisi' ? 'Untuk melakukan revisi pembayaran!' : 'Untuk melakukan approve pembayaran!';
|
||||
|
||||
Swal.fire({
|
||||
title: title,
|
||||
text: text,
|
||||
icon: 'warning',
|
||||
input: 'textarea', // Menambahkan input textarea
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Lain kali',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let useURL = "{{ URL::to('pembayaran') }}" + "/" + id;
|
||||
const keterangan = result.value || ''; // Ambil pesan dari textarea
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
input_data.type = rv;
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: 'PUT',
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: (response) => {
|
||||
if ('success' == response.status) {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else if ('error' == response.status) {
|
||||
Swal.fire('Error!', response.message, 'error').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#pembayaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
render: (item, data) => {
|
||||
if (data.permohonan) {
|
||||
return `${data.permohonan.nomor_registrasi}`;
|
||||
} else if(data.penawaran) {
|
||||
return `${data.penawaran.permohonan.nomor_registrasi}`;
|
||||
}
|
||||
return "";
|
||||
|
||||
},
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
if (data.permohonan) {
|
||||
return `${data.permohonan.tanggal_permohonan}`;
|
||||
} else if(data.penawaran) {
|
||||
return `${data.penawaran.permohonan.tanggal_permohonan}`;
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.permohonan) {
|
||||
return `${data.permohonan.user.name}`;
|
||||
}
|
||||
else if(data.penawaran) {
|
||||
return `${data.penawaran.permohonan.user.name}`;
|
||||
}
|
||||
return "";
|
||||
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.permohonan) {
|
||||
return `${data.permohonan.branch.name}`;
|
||||
}
|
||||
else if(data.penawaran) {
|
||||
return `${data.penawaran.permohonan.branch.name}`;
|
||||
}
|
||||
return "";
|
||||
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
if (data.permohonan) {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
}
|
||||
else if(data.penawaran) {
|
||||
return `${data.penawaran.permohonan.debiture.name}`;
|
||||
}
|
||||
return "";
|
||||
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan){
|
||||
var permohonan = data.permohonan;
|
||||
} else if(data.penawaran){
|
||||
var permohonan = data.penawaran.permohonan;
|
||||
}
|
||||
|
||||
if(permohonan) {
|
||||
|
||||
const status = permohonan.status_bayar.replace(/_/g,
|
||||
' ');
|
||||
const statusClass = permohonan.status_bayar === 'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="text-md font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
}
|
||||
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal Setor',
|
||||
render: (item, data) => {
|
||||
return `${window.formatTanggalIndonesia(data.created_at)}`;
|
||||
},
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
render: (item, data) => {
|
||||
return `${window.formatRupiah(data.nominal_bayar)}`;
|
||||
},
|
||||
},
|
||||
bukti_bayar:{
|
||||
title: 'Bukti Bayar',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_bayar) {
|
||||
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
approve_bayar_by: {
|
||||
title: 'Status Approve',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan){
|
||||
var permohonan = data.permohonan;
|
||||
} else if(data.penawaran){
|
||||
var permohonan = data.penawaran.permohonan;
|
||||
}
|
||||
|
||||
if(permohonan) {
|
||||
if(permohonan.approve_bayar) {
|
||||
return `${permohonan.approve_bayar.name}`;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
return "Menunggu Approval";
|
||||
},
|
||||
},
|
||||
approve_keterangan_bayar: {
|
||||
title: 'Status Approve',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan){
|
||||
var permohonan = data.permohonan;
|
||||
} else if(data.penawaran){
|
||||
var permohonan = data.penawaran.permohonan;
|
||||
}
|
||||
|
||||
if(permohonan) {
|
||||
return `${permohonan.approve_keterangan_bayar}` || '-';
|
||||
}
|
||||
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan){
|
||||
var permohonan = data.permohonan;
|
||||
} else if(data.penawaran){
|
||||
var permohonan = data.penawaran.permohonan;
|
||||
}
|
||||
|
||||
var iconPembayaranOtorisator = '';
|
||||
if(permohonan) {
|
||||
if (!permohonan.approve_bayar_by) {
|
||||
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id},'otorisator')">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id}, 'revisi')">
|
||||
<i class="ki-filled ki-arrow-circle-left"></i>
|
||||
</a>
|
||||
|
||||
`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`;
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
108
resources/views/pembayaran/form.blade.php
Normal file
108
resources/views/pembayaran/form.blade.php
Normal file
@@ -0,0 +1,108 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Pembayaran
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('pembayaran.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<input type="hidden" name="penawaran_id" value="{{ $permohonan->penawaran->id ?? "" }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="nomor_registrasi" id="nomor_registrasi" class="input w-full @error('nomor_registrasi') border-danger bg-danger-light @enderror" value="{{ old('nomor_registrasi', $permohonan->nomor_registrasi ?? '') }}" placeholder="Nomor Registrasi">
|
||||
@error('nomor_registrasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="debitur" id="debitur" class="input w-full @error('debitur') border-danger bg-danger-light @enderror" value="{{ old('debitur', $permohonan->debiture->name ?? '') }}" placeholder="Debitur">
|
||||
@error('debitur')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 hidden">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar" class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror" value="{{ old('nominal_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}" placeholder="Masukkan nominal bayar">
|
||||
@error('nominal_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_bayar" id="bukti_bayar" class="file-input w-full @error('bukti_bayar') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4" class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Proses
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
227
resources/views/pembayaran/index.blade.php
Normal file
227
resources/views/pembayaran/index.blade.php
Normal file
@@ -0,0 +1,227 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false"
|
||||
id="pembayaran-table" data-api-url="{{ route('pembayaran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Pembayaran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function pembayaranOtorisator(id) {
|
||||
// alert('hai id = ' + id);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan approve Pembayaran!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea', // Menambahkan input textarea
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Lain kali',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let useURL = "{{ URL::to('pembayaran') }}" + "/" + id;
|
||||
const keterangan = result.value || ''; // Ambil pesan dari textarea
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: 'PUT',
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: (response) => {
|
||||
if ('success' == response.status) {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else if ('error' == response.status) {
|
||||
Swal.fire('Error!', response.message, 'error').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#pembayaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan'
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.user.name}`;
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.branch) {
|
||||
return `${data.branch.name}`;
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.debiture.name}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
const status = data.status_bayar.replace(/_/g,
|
||||
' ');
|
||||
const statusClass = data.status_bayar === 'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="text-md font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex justify-center gap-2">
|
||||
<a class="btn btn-icon btn-clear btn-warning " href="pembayaran/${data.id}/edit" title="Lakukan Pembayaran">
|
||||
<i class="ki-outline ki-credit-cart"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
320
resources/views/pemilik_jaminan/form.blade.php
Normal file
320
resources/views/pemilik_jaminan/form.blade.php
Normal file
@@ -0,0 +1,320 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($pemilik->id) ? 'Edit' : 'Tambah' }} Pemilik Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@if(request()->get('document'))
|
||||
<a href="{{ request()->get('from') == 'update-document' ? route('debitur.jaminan.edit',['id'=>$debitur->id,'jaminan'=>request()->get('document')]) : route('debitur.pemilik.index',$debitur->id) }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@else
|
||||
<a href="{{ request()->get('from') == 'create-document' ? route('debitur.jaminan.create',$debitur->id) : route('debitur.pemilik.index',$debitur->id) }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ isset($pemilik->id) ? route('debitur.pemilik.update', ['id'=>$debitur->id,'pemilik'=>$pemilik->id]) : route('debitur.pemilik.store',$debitur->id) }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($pemilik->id))
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
|
||||
@if(request()->get('from'))
|
||||
<input type="hidden" name="from" value="{{ request()->get('from') }}">
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="debiture_id" value="{{ $debitur->id ?? '' }}">
|
||||
<p class="text-base text-gray-700">{{ $debitur->name }} | {{ $debitur->address.', '.$debitur->village->name.', '.$debitur->city->name.', '.$debitur->province->name.', '.$debitur->postal_code }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Hubungan Pemilik Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="hubungan_pemilik_jaminan_id" id="hubungan_pemilik_jaminan_id">
|
||||
<option value="">Pilih Hubungan Pemilik Jaminan</option>
|
||||
@if(isset($hubunganPemilik))
|
||||
@foreach($hubunganPemilik as $hubungan)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $hubungan->id }}" {{ isset($pemilik->hubungan_pemilik_jaminan_id) && $pemilik->hubungan_pemilik_jaminan_id == $hubungan->id?'selected' : '' }}>
|
||||
{{ $hubungan->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $hubungan->id }}">
|
||||
{{ $hubungan->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('hubungan_pemilik_jaminan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text " id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $pemilik->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
|
||||
@error('nomor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nama_sertifikat">
|
||||
@if(isset($detailSertifikat))
|
||||
@foreach(json_decode($detailSertifikat) as $sertifikat)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" id="name" name="detail_sertifikat[name][]" value="{{ $sertifikat->name }}" placeholder="Nama Pemilik Jaminan">
|
||||
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="number" name="detail_sertifikat[nomor_id][]" value="{{ $sertifikat->nomor_id }}" placeholder="Nomor ID/KTP">
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_sertifikat" class="btn btn-primary btn-xs">Tambah Nama di Sertifikat</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
NPWP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number" name="npwp" value="{{ $debitur->npwp ?? '' }}">
|
||||
@error('npwp')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Email
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email" name="email" value="{{ $debitur->email ?? '' }}">
|
||||
@error('email')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
No Handphone
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number" name="phone" value="{{ $debitur->phone ?? '' }}">
|
||||
@error('phone')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Alamat
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Province</option>
|
||||
@foreach($provinces as $province)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $province->code }}" {{ isset($pemilik->province_code) && $pemilik->province_code == $province->code?'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $province->code }}">
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('province_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select City</option>
|
||||
@if(isset($cities))
|
||||
@foreach($cities as $city)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $city->code }}" {{ isset($pemilik->city_code) && $pemilik->city_code == $city->code?'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $city->code }}">
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('city_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select District</option>
|
||||
@if(isset($districts))
|
||||
@foreach($districts as $district)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $district->code }}" {{ isset($pemilik->district_code) && $pemilik->district_code == $district->code?'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $district->code }}">
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Village</option>
|
||||
@if(isset($villages))
|
||||
@foreach($villages as $village)
|
||||
@if(isset($pemilik))
|
||||
<option value="{{ $village->code }}" {{ isset($pemilik->village_code) && $pemilik->village_code == $village->code?'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $village->code }}">
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</select>
|
||||
@error('district_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $pemilik->postal_code ?? '' }}" placeholder="Postal Code">
|
||||
@error('postal_code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row w-full mt-2 lg:mt-5">
|
||||
<textarea class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" type="number" id="address" name="address">{{ $pemilik->address ?? '' }}</textarea>
|
||||
@error('address')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners() {
|
||||
document.querySelectorAll(".delete-button").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners();
|
||||
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function() {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
||||
newDiv.innerHTML = `
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="detail_sertifikat[name][]" value="" placeholder="Nama Pemilik Jaminan">
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="number" name="detail_sertifikat[nomor_id][]" value="" placeholder="Nomor ID/KTP">
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
namaSertifikatDiv.appendChild(newDiv);
|
||||
|
||||
// Add delete listener to the new button
|
||||
addDeleteListeners();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
24
resources/views/pemilik_jaminan/index.blade.php
Normal file
24
resources/views/pemilik_jaminan/index.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($document->id) ? 'Edit' : 'Tambah' }} Pemilik Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('debitur.jaminan.index',$debitur->id) }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('lpj::debitur.form')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
224
resources/views/penawaran/create.blade.php
Normal file
224
resources/views/penawaran/create.blade.php
Normal file
@@ -0,0 +1,224 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form action="{{ route('tender.penawaran.storePenawaran', $noreg) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Tambah Data Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nomor_registrasi" readonly value="{{ $permohonan->nomor_registrasi ?? '-' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nama_kjpp_sebelumnya" readonly value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Biaya KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="biaya_kjpp_sebelumnya" readonly value="">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Penilaian Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="tanggal_penilaian_sebelumnya" readonly value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Penawaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger @enderror" type="text" name="code"
|
||||
value="{{ old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Data KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select name="kjpp[]" multiple="multiple"
|
||||
class="input tomselect w-full @error('kjpp') border-danger @enderror" id="kjpp_select">
|
||||
<option value="">Pilih Nama KJPP</option>
|
||||
@foreach ($kjpp as $row)
|
||||
@if (isset($kjpp))
|
||||
<option value="{{ $row->id }}"
|
||||
{{ in_array($row->id, old('kjpp', [])) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('kjpp')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="tujuan_penilaian_kjpp_id"
|
||||
class="select w-full @error('tujuan_penilaian_kjpp_id') border-danger @enderror"
|
||||
name="tujuan_penilaian_kjpp_id">
|
||||
<option value="">Pilih Tujuan Penilaian KJPP</option>
|
||||
@if (isset($tujuan_penilaian_kjpp))
|
||||
@foreach ($tujuan_penilaian_kjpp as $tp)
|
||||
<option value="{{ $tp->id }}"
|
||||
{{ old('tujuan_penilaian_kjpp_id') == $tp->id ? 'selected' : '' }}>
|
||||
{{ $tp->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('tujuan_penilaian_kjpp_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Batas Waktu
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('start_date') border-danger @enderror" type="date"
|
||||
name="start_date" value="{{ old('start_date') }}">
|
||||
@error('start_date')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
-
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('end_date') border-danger @enderror" type="date" name="end_date"
|
||||
value="{{ old('end_date') }}">
|
||||
@error('end_date')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('catatan') border-danger @enderror" name="catatan" rows="3" id="address">{{ old('catatan') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="jenis_laporan_id"
|
||||
class="select w-full @error('jenis_laporan_id') border-danger @enderror"
|
||||
name="jenis_laporan_id">
|
||||
<option value="">Pilih Jenis Laporan</option>
|
||||
@if (isset($jenis_laporan))
|
||||
@foreach ($jenis_laporan as $jl)
|
||||
<option value="{{ $jl->id }}"
|
||||
{{ old('jenis_laporan_id') == $jl->id ? 'selected' : '' }}>
|
||||
{{ $jl->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('jenis_laporan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 status-custom">
|
||||
<label class="form-label max-w-56">
|
||||
Status
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="select w-full @error('status') border-danger @enderror" name="status">
|
||||
<option value="">Pilih Status</option>
|
||||
@if (isset($status))
|
||||
@foreach ($status as $s)
|
||||
<option value="{{ $s->name }}"
|
||||
{{ old('status') == $s->name ? 'selected' : '' }}>
|
||||
{{ $s->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-1.5">
|
||||
@if (isset($penawaran->nomor_registrasi))
|
||||
<a href="{{ route('tender.penawaran.showSuratTender', $noreg) }}" class="btn btn-primary">
|
||||
Surat Tender
|
||||
</a>
|
||||
@endif
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
input.input-custom:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
input.input-custom {
|
||||
background: none;
|
||||
color: var(--tw-gray-600);
|
||||
}
|
||||
}
|
||||
|
||||
.status-custom {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
242
resources/views/penawaran/edit.blade.php
Normal file
242
resources/views/penawaran/edit.blade.php
Normal file
@@ -0,0 +1,242 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form action="{{ route('tender.penawaran.updatePenawaran', $noreg) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Penawaran Ulang
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.show', $noreg) }}" class="btn btn-xs btn-primary" title="Detail">
|
||||
<i class="ki-outline ki-abstract-26"></i> Detail
|
||||
</a>
|
||||
<a href="{{ route('tender.penawaran.ulang.index') }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nomor_registrasi" readonly value="{{ $permohonan->nomor_registrasi ?? '-' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@php
|
||||
$nama_kjpp = $penawaran->nama_kjpp_sebelumnya;
|
||||
$nama = explode(' - ', $nama_kjpp)[1] ?? '';
|
||||
@endphp
|
||||
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nama_kjpp_sebelumnya" readonly value="{{ $nama !== null ? $nama : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Biaya KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="biaya_kjpp_sebelumnya"
|
||||
value="{{ $penawaran->biaya_kjpp_sebelumnya !== null ? $penawaran->biaya_kjpp_sebelumnya : '' }}">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text" readonly
|
||||
value="{{ $penawaran->biaya_kjpp_sebelumnya !== null ? formatRupiah($penawaran->biaya_kjpp_sebelumnya) : '' }}">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Penilaian Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="tanggal_penilaian_sebelumnya" readonly
|
||||
value="{{ $penawaran->tanggal_penilaian_sebelumnya !== null ? formatTanggalIndonesia($penawaran->tanggal_penilaian_sebelumnya) : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Penawaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input border-warning bg-warning-light @error('code') border-danger @enderror"
|
||||
type="text" name="code" value="{{ old('code', $penawaran->code) }}" readonly>
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Data KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<!-- Multi-select for KJPP -->
|
||||
<select name="kjpp[]" multiple="multiple"
|
||||
class="input tomselect w-full @error('kjpp') border-danger @enderror" id="kjpp_select">
|
||||
<option value="">Pilih Nama KJPP</option>
|
||||
@foreach ($kjpp as $row)
|
||||
@if ($row->status == 1)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ in_array($row->id, old('kjpp', $kjpps ?? [])) ? 'selected' : '' }}>
|
||||
{{ $row->name }} | {{ $row->jenis_kantor }}
|
||||
@if($row->jenis_kantor == 'Kantor Cabang')
|
||||
{{ str_replace(['KOTA','KAB.','KAB'],'',$row->city->name) }}
|
||||
@endif
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('kjpp')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="tujuan_penilaian_kjpp_id"
|
||||
class="select w-full @error('tujuan_penilaian_kjpp_id') border-danger @enderror"
|
||||
name="tujuan_penilaian_kjpp_id">
|
||||
<option value="">Pilih Tujuan Penilaian KJPP</option>
|
||||
@if (isset($tujuan_penilaian_kjpp))
|
||||
@foreach ($tujuan_penilaian_kjpp as $tp)
|
||||
<option value="{{ $tp->id }}"
|
||||
{{ old('tujuan_penilaian_kjpp_id', $penawaran->tujuan_penilaian_kjpp_id) == $tp->id ? 'selected' : '' }}>
|
||||
{{ $tp->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('tujuan_penilaian_kjpp_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Batas Waktu
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('start_date') border-danger @enderror" type="date"
|
||||
name="start_date" value="{{ old('start_date', $penawaran->start_date) }}">
|
||||
@error('start_date')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
-
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('end_date') border-danger @enderror" type="date" name="end_date"
|
||||
value="{{ old('end_date', $penawaran->end_date ? date('Y-m-d', strtotime($penawaran->end_date)) : '') }}">
|
||||
@error('end_date')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('catatan') border-danger @enderror" name="catatan" rows="3" id="address">{{ old('catatan', $penawaran->catatan) }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="jenis_laporan_id"
|
||||
class="select w-full @error('jenis_laporan_id') border-danger @enderror"
|
||||
name="jenis_laporan_id">
|
||||
<option value="">Pilih Jenis Laporan</option>
|
||||
@if (isset($jenis_laporan))
|
||||
@foreach ($jenis_laporan as $jl)
|
||||
<option value="{{ $jl->id }}"
|
||||
{{ old('jenis_laporan_id', $penawaran->jenis_laporan_id) == $jl->id ? 'selected' : '' }}>
|
||||
{{ $jl->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('jenis_laporan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 status-custom">
|
||||
<label class="form-label max-w-56">
|
||||
Status
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="select w-full @error('status') border-danger @enderror" name="status">
|
||||
<option value="">Pilih Status</option>
|
||||
@if (isset($status))
|
||||
@foreach ($status as $s)
|
||||
<option value="{{ strtolower($s->name) }}"
|
||||
{{ $penawaran->status == strtolower($s->name) ? 'selected' : '' }}>
|
||||
{{ $s->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-1.5">
|
||||
@if (isset($penawaran->nomor_registrasi))
|
||||
<a href="{{ route('tender.penawaran.showSuratTender', $noreg) }}" class="btn btn-primary">
|
||||
Surat Tender
|
||||
</a>
|
||||
@endif
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Penawaran Ulang
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
input.input-custom:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
input.input-custom {
|
||||
background: none;
|
||||
color: var(--tw-gray-600);
|
||||
}
|
||||
}
|
||||
|
||||
.status-custom {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
239
resources/views/penawaran/index.blade.php
Normal file
239
resources/views/penawaran/index.blade.php
Normal file
@@ -0,0 +1,239 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('tender.penawaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="penawaran-table" data-api-url="{{ route('tender.penawaran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Data Penawaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Penawaran Tender" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('tender.penawaran.exportPenawaran') }}"> Export to
|
||||
Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function formatDate(date) {
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
// Months are 0-indexed
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day} ${getIndonesianMonth(month)} ${year}`;
|
||||
}
|
||||
|
||||
function getIndonesianMonth(month) {
|
||||
const months = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni',
|
||||
'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'
|
||||
];
|
||||
return months[month -
|
||||
1];
|
||||
}
|
||||
|
||||
function capitalizeWords(str) {
|
||||
return str.replace(/\b\w/g, function(char) {
|
||||
return char.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
// Function to check the existence of penawaran and update button
|
||||
function checkPenawaranExistence(nomor_registrasi) {
|
||||
// URL API untuk cek penawaran
|
||||
const url = `/api/check-penawaran/${nomor_registrasi}`;
|
||||
|
||||
// Fetch data dari server
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const actionDiv = document.getElementById(`action-${nomor_registrasi}`);
|
||||
if (data.exists) {
|
||||
// Jika penawaran ada, ganti tombol menjadi "Penawaran Ulang"
|
||||
actionDiv.innerHTML = `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" title="Detail" href="/tender/penawaran/${nomor_registrasi}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<a href="/tender/penawaran/${nomor_registrasi}/edit" class="btn btn-sm btn-icon btn-clear btn-info" title="Penawaran">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
`;
|
||||
} else {
|
||||
// Jika tidak ada, tampilkan tombol "Tambah Penawaran"
|
||||
actionDiv.innerHTML = `
|
||||
<a href="/tender/penawaran/${nomor_registrasi}/create" class="btn btn-sm btn-icon btn-clear btn-primary" title="Penawaran">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
const actionDiv = document.getElementById(`action-${nomor_registrasi}`);
|
||||
actionDiv.innerHTML = `<span class="text-danger">Error loading action</span>`;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#penawaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return `${formatDate(new Date(data.tanggal_permohonan))}`
|
||||
}
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.user.name}`;
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.branch.name}`;
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.debiture.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.tujuan_penilaian.name}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return capitalizeWords(data.status)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
// Default action button, to be updated later
|
||||
let actionHtml = `
|
||||
<div class="flex flex-nowrap justify-center" id="action-${data.nomor_registrasi}">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-secondary" title="Loading..." href="#">
|
||||
<i class="ki-outline ki-loading"></i>
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Call the checkPenawaranExistence function to update the action button dynamically
|
||||
setTimeout(() => { // Using setTimeout to ensure DOM elements are rendered before updating
|
||||
checkPenawaranExistence(data.nomor_registrasi);
|
||||
}, 0);
|
||||
|
||||
return actionHtml;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
191
resources/views/penawaran/kirimEmail.blade.php
Normal file
191
resources/views/penawaran/kirimEmail.blade.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Surat Tender | {{ formatTanggalIndonesia(now()) }}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Calibri;
|
||||
margin: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 20px;
|
||||
white-space: pre-line;
|
||||
/* To handle line breaks in text */
|
||||
}
|
||||
|
||||
.content-max {
|
||||
margin-top: 20px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.flex-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.important {
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.signature {
|
||||
margin-top: 40px;
|
||||
font-family: 'Brush Script MT', cursive;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 20px;
|
||||
font-size: 0.9em;
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
foreach ($penawaran->penawaranKjpp as $kjpp) {
|
||||
if ($kjpp->kjpp->nama_pic_admin) {
|
||||
$allPeople[] = ucwords($kjpp->kjpp->nama_pic_admin);
|
||||
}
|
||||
|
||||
if ($kjpp->kjpp->detail_nama_pic_admin) {
|
||||
try {
|
||||
$decoded = json_decode($kjpp->kjpp->detail_nama_pic_admin);
|
||||
if ($decoded) {
|
||||
foreach ($decoded as $admin) {
|
||||
if (isset($admin->nama_pic_admin)) {
|
||||
$allPeople[] = ucwords($admin->nama_pic_admin);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$allPeople = array_filter($allPeople);
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
<br> Dokumen Jaminan: <br>
|
||||
@php
|
||||
$n = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br />
|
||||
<img src="{{ asset('storage/signatures/' . $user->id . '/' . $user->sign) }}" alt="{{ $user->name }}"
|
||||
width="200">
|
||||
<p>
|
||||
{{ $user->name }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
192
resources/views/penawaran/kirimEmailKJPP.blade.php
Normal file
192
resources/views/penawaran/kirimEmailKJPP.blade.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Surat Tender | {{ formatTanggalIndonesia(now()) }}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Calibri;
|
||||
margin: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 20px;
|
||||
white-space: pre-line;
|
||||
/* To handle line breaks in text */
|
||||
}
|
||||
|
||||
.content-max {
|
||||
margin-top: 20px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.flex-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.important {
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.signature {
|
||||
margin-top: 40px;
|
||||
font-family: 'Brush Script MT', cursive;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 20px;
|
||||
font-size: 0.9em;
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
foreach ($dp1->kjpp as $dp) {
|
||||
if ($dp1->kjpp->nama_pic_admin) {
|
||||
$allPeople[] = ucwords($dp1->kjpp->nama_pic_admin);
|
||||
}
|
||||
|
||||
if ($dp1->kjpp->detail_nama_pic_admin) {
|
||||
try {
|
||||
$decoded = json_decode($dp1->kjpp->detail_nama_pic_admin);
|
||||
if (is_array($decoded) && !empty($decoded)) {
|
||||
foreach ($decoded as $value) {
|
||||
// Check if the value has nama_pic_admin and it's not empty
|
||||
if (isset($value->nama_pic_admin) && !empty($value->nama_pic_admin)) {
|
||||
$allPeople[] = ucwords($value->nama_pic_admin);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty values and duplicates
|
||||
$allPeople = array_filter(array_unique($allPeople));
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
<br> Dokumen Jaminan: <br>
|
||||
@php
|
||||
$n = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br />
|
||||
<img src="{{ asset('storage/signatures/' . $user->id . '/' . $user->sign) }}" alt="{{ $user->name }}"
|
||||
width="200">
|
||||
<p>
|
||||
{{ $user->name }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
133
resources/views/penawaran/layouts/scripts.blade.php
Normal file
133
resources/views/penawaran/layouts/scripts.blade.php
Normal file
@@ -0,0 +1,133 @@
|
||||
@push('styles')
|
||||
<style>
|
||||
input.input-custom:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
input.input-custom {
|
||||
background: none;
|
||||
color: var(--tw-gray-600);
|
||||
}
|
||||
}
|
||||
|
||||
.status-custom {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#kjpp-table');
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
columns: {
|
||||
no: {
|
||||
title: 'No',
|
||||
render: (item, data) => {
|
||||
return data.numbernya;
|
||||
}
|
||||
},
|
||||
nomor_kjpp: {
|
||||
title: 'Nomor KJPP',
|
||||
render: (item, data) => {
|
||||
return `${data.kjpp.code}`
|
||||
}
|
||||
},
|
||||
nama_kjpp: {
|
||||
title: 'Nama KJPP',
|
||||
render: (item, data) => {
|
||||
return `${data.kjpp.name}`
|
||||
}
|
||||
},
|
||||
email_kantor: {
|
||||
title: 'Email Kantor',
|
||||
render: (item, data) => {
|
||||
let emails = new Set([data.kjpp.email_kantor]); // Always include the main email
|
||||
|
||||
// Check if there's a detail_email_kantor and try to parse it
|
||||
if (data.kjpp.detail_email_kantor) {
|
||||
try {
|
||||
const detailEmails = JSON.parse(data.kjpp.detail_email_kantor);
|
||||
|
||||
// If the parsed result is an array, extract emails from each object and concatenate
|
||||
if (Array.isArray(detailEmails)) {
|
||||
detailEmails.forEach(item => {
|
||||
emails.add(item);
|
||||
});
|
||||
} else {
|
||||
// If it's a single object (not an array), just add the email
|
||||
if (detailEmails) {
|
||||
emails.add(detailEmails);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to parse detail_email_kantor:', e);
|
||||
// Fallback to treating detail_email_kantor as a plain string
|
||||
emails.push(data.kjpp.detail_email_kantor);
|
||||
}
|
||||
}
|
||||
|
||||
emails = Array.from(emails);
|
||||
|
||||
// Helper function for basic email validation (regex pattern)
|
||||
const isValidEmail = (email) => {
|
||||
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
|
||||
return emailRegex.test(email);
|
||||
};
|
||||
|
||||
// Filter out invalid emails and join with line breaks
|
||||
return emails
|
||||
.filter(email => email && String(email).trim() && isValidEmail(email))
|
||||
.map(email => String(email)
|
||||
.trim()) // Ensure there are no accidental leading/trailing spaces
|
||||
.join('<br>'); // Join the emails with line breaks for rendering
|
||||
}
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
// Cek jika ada email log
|
||||
if (data.penawaran.email_tender_log && data.penawaran.email_tender_log.length > 0) {
|
||||
// Buat full string KJPP untuk matching
|
||||
const kjppString = `${data.kjpp.code} | ${data.kjpp.name}`;
|
||||
|
||||
// Filter log berdasarkan string KJPP yang sesuai
|
||||
const log = data.penawaran.email_tender_log.find(log =>
|
||||
log.kjpp === kjppString
|
||||
);
|
||||
|
||||
if (log) {
|
||||
// Set warna badge berdasarkan status
|
||||
const statusColors = {
|
||||
'success': 'badge-success',
|
||||
'failed': 'badge-danger'
|
||||
};
|
||||
|
||||
const color = statusColors[log.status] || 'badge-secondary';
|
||||
|
||||
return `<span class="badge ${color} mb-1">${log.status}</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
// Jika tidak ada log, tampilkan strip
|
||||
return '<span class="badge">-</span>';
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex justify-center items-center">
|
||||
<a href="tender/penawaran/${data.penawaran.nomor_registrasi}/suratTenderKJPP/${data.kjpp.id}" title="Show Surat Tender" class="btn btn-sm btn-icon btn-clear btn-warning"><i class="ki-outline ki-eye"></i></a>
|
||||
<a href="tender/penawaran/${data.penawaran.nomor_registrasi}/suratTenderKJPP/${data.kjpp.id}/kirimEmailKJPP" title="Kirim Email KJPP" class="btn btn-sm btn-icon btn-clear btn-primary"><i class="ki-outline ki-paper-plane"></i></a></div>`
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
</script>
|
||||
@endpush
|
||||
178
resources/views/penawaran/show.blade.php
Normal file
178
resources/views/penawaran/show.blade.php
Normal file
@@ -0,0 +1,178 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Detail Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@if ($penawaranExists)
|
||||
<a href="{{ route('tender.penawaran.editPenawaran', $noreg) }}" class="btn btn-xs btn-danger"
|
||||
title="Penawaran"><i class="ki-filled ki-arrow-circle-left"></i> Penawaran Ulang</a>
|
||||
@endif
|
||||
@if (!$penawaranExists)
|
||||
<a href="{{ route('tender.penawaran.createPenawaran', $noreg) }}" class="btn btn-xs btn-primary"
|
||||
title="Penawaran"><i class="ki-filled ki-arrow-circle-right"></i> Tambah Penawaran</a>
|
||||
@endif
|
||||
@if ($penawaranExists)
|
||||
<a href="{{ route('tender.penawaran.ulang.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
@if (!$penawaranExists)
|
||||
<a href="{{ route('tender.penawaran.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
No. registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penawaran->nomor_registrasi ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
@if ($penawaran->code)
|
||||
<label class="form-label max-w-56">
|
||||
No. Penawaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penawaran->code }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status
|
||||
</label>
|
||||
@if (isset($penawaran->status))
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ ucwords($penawaran->status) }}
|
||||
</p>
|
||||
@else
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
Tidak Ada
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($penawaran->nama_kjpp_sebelumnya) && !empty($penawaran->nama_kjpp_sebelumnya))
|
||||
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm">
|
||||
{{ $penawaran->nama_kjpp_sebelumnya }}
|
||||
</div>
|
||||
@else
|
||||
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm">
|
||||
Tidak ada
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Biaya KJPP Sebelumnya
|
||||
</label>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
@if (isset($penawaran->biaya_kjpp_sebelumnya))
|
||||
{{ formatRupiah($penawaran->biaya_kjpp_sebelumnya) }}
|
||||
@else
|
||||
{{ formatRupiah(0) }}
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Penilaian Sebelumnya
|
||||
</label>
|
||||
@if (isset($penawaran->tanggal_penilaian_sebelumnya) && !empty($penawaran->tanggal_penilaian_sebelumnya))
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($penawaran->tanggal_penilaian_sebelumnya) }}
|
||||
</p>
|
||||
@else
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
Tidak Ada
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian KJPP
|
||||
</label>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
@if (isset($tujuan_penilaian_kjpp))
|
||||
@foreach ($tujuan_penilaian_kjpp as $tpk)
|
||||
{{ $tpk->name }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</p>
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Laporan
|
||||
</label>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
@if (isset($jenis_laporan))
|
||||
@foreach ($jenis_laporan as $jl)
|
||||
{{ $jl->name }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Batas Waktu
|
||||
</label>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($penawaran->start_date) }} -
|
||||
{{ formatTanggalIndonesia($penawaran->end_date) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
@if (isset($penawaran->catatan))
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penawaran->catatan }}
|
||||
</p>
|
||||
@else
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
Tidak Ada
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP
|
||||
</label>
|
||||
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm gap-1">
|
||||
@if (isset($kjpps) && !empty(json_decode($kjpps, true)))
|
||||
@foreach ($kjpps as $kjpp)
|
||||
@if (isset($kjpp))
|
||||
<div
|
||||
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600 badge-xs">
|
||||
{{ $kjpp->name }}</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm">Tidak Ada</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
98
resources/views/penawaran/showKirimEmail.blade.php
Normal file
98
resources/views/penawaran/showKirimEmail.blade.php
Normal file
@@ -0,0 +1,98 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Show Kirim Email Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.ulang.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Registrasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nomor_registrasi" readonly value="{{ $permohonan->nomor_registrasi ?? '-' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="nama_debitur" readonly value="{{ $permohonan->debiture->name ?? '-' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" id="kjpp-table"
|
||||
data-api-url="{{ route('tender.penawaran.showKirimSurat.datatables', $noreg) }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="card-title">
|
||||
Data KJPP
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table
|
||||
class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14" data-datatable-column="no">
|
||||
No
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_kjpp">
|
||||
<span class="sort">
|
||||
<span class="sort-label">
|
||||
Nomor KJPP
|
||||
</span>
|
||||
<span class="sort-icon"> </span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_kjpp">
|
||||
<span class="sort">
|
||||
<span class="sort-label">
|
||||
Nama KJPP
|
||||
</span>
|
||||
<span class="sort-icon"> </span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="email_kantor">
|
||||
Email Kantor
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
Status Kirim
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a href="{{ route('tender.penawaran.kirimEmailAll', $noreg) }}" class="btn btn-primary">
|
||||
<i class="ki-filled ki-paper-plane"></i> Kirim
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('lpj::penawaran.layouts.scripts')
|
||||
187
resources/views/penawaran/surat_tender.blade.php
Normal file
187
resources/views/penawaran/surat_tender.blade.php
Normal file
@@ -0,0 +1,187 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Surat Tender
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.downloadSuratTender', $noreg) }}" class="btn btn-xs btn-light">
|
||||
<img src="{{ asset('img/pdf.png') }}" width="25" alt="pdf" class="pdf"></img>Download
|
||||
</span>
|
||||
@if (isset($penawaran->nomor_registrasi))
|
||||
<a href="{{ route('tender.penawaran.editPenawaran', $noreg) }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@else
|
||||
<a href="{{ route('tender.penawaran.createPenawaran', $noreg) }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5 text-gray-900">
|
||||
<p>Dear
|
||||
<span class="font-bold">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
foreach ($penawaran->penawaranKjpp as $kjpp) {
|
||||
if ($kjpp->kjpp->nama_pic_admin) {
|
||||
$allPeople[] = ucwords($kjpp->kjpp->nama_pic_admin);
|
||||
}
|
||||
|
||||
if ($kjpp->kjpp->detail_nama_pic_admin) {
|
||||
try {
|
||||
$decoded = json_decode($kjpp->kjpp->detail_nama_pic_admin);
|
||||
if ($decoded) {
|
||||
foreach ($decoded as $admin) {
|
||||
if (isset($admin->nama_pic_admin)) {
|
||||
$allPeople[] = ucwords($admin->nama_pic_admin);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$allPeople = array_filter($allPeople);
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
</p>
|
||||
<p>Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="font-bold">{{ ucwords($permohonan->debiture->name) }}</span>, tujuan penilaian
|
||||
untuk <span class="font-bold">
|
||||
{{ $penawaran->tujuanPenilaianKJPP->name }}
|
||||
</span>, laporan dalam bentuk <span class="font-bold">{{ $penawaran->jenisLaporan->name }}</span>,
|
||||
dengan data-data sebagai berikut :</p>
|
||||
<ul>
|
||||
<li>Aset Jaminan:
|
||||
<span class="font-bold">
|
||||
@foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
<li>Lokasi Jaminan:
|
||||
<span class="font-bold">
|
||||
@foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}
|
||||
@if (isset($document->jenisJaminan))
|
||||
, Kel.
|
||||
@foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach
|
||||
, Kec.
|
||||
@foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach
|
||||
,
|
||||
@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach
|
||||
,
|
||||
@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
<li>Dokumen Jaminan: <br>
|
||||
<span class="font-bold">
|
||||
@php
|
||||
$n = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi.</p>
|
||||
<p>Mohon proposal dapat saya terima segera, sebelum
|
||||
<span class="font-bold">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</p>
|
||||
<p>Best Regards,
|
||||
<div class="font-bold">
|
||||
<img src="{{ asset('storage/signatures/' . auth()->user()->id . '/' . auth()->user()->sign) }}"
|
||||
alt="{{ auth()->user()->name }}" width="200" class="signature">
|
||||
<p>
|
||||
{{ auth()->user()->name }}
|
||||
</p>
|
||||
</div>
|
||||
Sub Direktorat Appraisal
|
||||
</p>
|
||||
<p>PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.dark img.signature {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
|
||||
.dark img.pdf {
|
||||
filter: invert(1) brightness(1);
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
191
resources/views/penawaran/surat_tender_download.blade.php
Normal file
191
resources/views/penawaran/surat_tender_download.blade.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Surat Tender | {{ formatTanggalIndonesia(now()) }}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Calibri;
|
||||
margin: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 20px;
|
||||
white-space: pre-line;
|
||||
/* To handle line breaks in text */
|
||||
}
|
||||
|
||||
.content-max {
|
||||
margin-top: 20px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.flex-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.important {
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.signature {
|
||||
margin-top: 40px;
|
||||
font-family: 'Brush Script MT', cursive;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 20px;
|
||||
font-size: 0.9em;
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
foreach ($penawaran->penawaranKjpp as $kjpp) {
|
||||
if ($kjpp->kjpp->nama_pic_admin) {
|
||||
$allPeople[] = ucwords($kjpp->kjpp->nama_pic_admin);
|
||||
}
|
||||
|
||||
if ($kjpp->kjpp->detail_nama_pic_admin) {
|
||||
try {
|
||||
$decoded = json_decode($kjpp->kjpp->detail_nama_pic_admin);
|
||||
if ($decoded) {
|
||||
foreach ($decoded as $admin) {
|
||||
if (isset($admin->nama_pic_admin)) {
|
||||
$allPeople[] = ucwords($admin->nama_pic_admin);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$allPeople = array_filter($allPeople);
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
<br> Dokumen Jaminan: <br>
|
||||
@php
|
||||
$n = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br />
|
||||
<img src="{{ public_path('storage/signatures/' . auth()->user()->id . '/' . auth()->user()->sign) }}"
|
||||
alt="{{ auth()->user()->name }}" width="200">
|
||||
<p>
|
||||
{{ auth()->user()->name }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
185
resources/views/penawaran/surat_tender_kjpp.blade.php
Normal file
185
resources/views/penawaran/surat_tender_kjpp.blade.php
Normal file
@@ -0,0 +1,185 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg'), request()->route('id')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Surat Tender
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.downloadSuratTenderKJPP', ['noreg' => $noreg, 'id' => $id]) }}"
|
||||
class="btn btn-xs btn-light">
|
||||
<img src="{{ asset('img/pdf.png') }}" width="25" alt="pdf" class="pdf"></img>Download
|
||||
</a>
|
||||
<a href="{{ route('tender.penawaran.showKirimEmail', $noreg) }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5 text-gray-900">
|
||||
<p>Dear
|
||||
<span class="font-bold">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
foreach ($detail_penawaran_1 as $dp1) {
|
||||
if ($detail_penawaran_1->nama_pic_admin) {
|
||||
$allPeople[] = ucwords($detail_penawaran_1->nama_pic_admin);
|
||||
}
|
||||
|
||||
if ($detail_penawaran_1->detail_nama_pic_admin) {
|
||||
try {
|
||||
$decoded = json_decode($detail_penawaran_1->detail_nama_pic_admin);
|
||||
if (is_array($decoded) && !empty($decoded)) {
|
||||
foreach ($decoded as $value) {
|
||||
// Check if the value has nama_pic_admin and it's not empty
|
||||
if (isset($value->nama_pic_admin) && !empty($value->nama_pic_admin)) {
|
||||
$allPeople[] = ucwords($value->nama_pic_admin);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty values and duplicates
|
||||
$allPeople = array_filter(array_unique($allPeople));
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
</p>
|
||||
<p>Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="font-bold">{{ ucwords($permohonan->debiture->name) }}</span>, tujuan penilaian
|
||||
untuk <span class="font-bold">
|
||||
{{ $penawaran->tujuanPenilaianKJPP->name }}
|
||||
</span>, laporan dalam bentuk <span class="font-bold">{{ $penawaran->jenisLaporan->name }}</span>,
|
||||
dengan data-data sebagai berikut :</p>
|
||||
<ul>
|
||||
<li>Aset Jaminan:
|
||||
<span class="font-bold">
|
||||
@foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
<li>Lokasi Jaminan:
|
||||
<span class="font-bold">
|
||||
@foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}
|
||||
@if (isset($document->jenisJaminan))
|
||||
, Kel.
|
||||
@foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach
|
||||
, Kec.
|
||||
@foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach
|
||||
,
|
||||
@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach
|
||||
,
|
||||
@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
<li>Dokumen Jaminan: <br>
|
||||
<span class="font-bold">
|
||||
@php
|
||||
$n = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi.</p>
|
||||
<p>Mohon proposal dapat saya terima segera, sebelum
|
||||
<span class="font-bold">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</p>
|
||||
<p>Best Regards,
|
||||
<div class="font-bold">
|
||||
<img src="{{ asset('storage/signatures/' . auth()->user()->id . '/' . auth()->user()->sign) }}"
|
||||
alt="{{ auth()->user()->name }}" width="200" class="signature">
|
||||
<p>
|
||||
{{ auth()->user()->name }}
|
||||
</p>
|
||||
</div>
|
||||
Sub Direktorat Appraisal
|
||||
</p>
|
||||
<p>PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.dark img.signature {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
|
||||
.dark img.pdf {
|
||||
filter: invert(1) brightness(1);
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user