Memperbaiki Conflict Staging dan Tender

This commit is contained in:
2024-09-25 17:35:59 +07:00
45 changed files with 4082 additions and 31 deletions

View File

@@ -0,0 +1,120 @@
@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" id="advanced_settings_appearance">
<h3 class="card-title">
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">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card grow" id="activity_2024">
<div class="card-header">
<h3 class="text-md font-medium text-gray-900">
Status Activity
</h3>
</div>
<div class="card-body">
<div class="flex flex-col">
@foreach ($status_permohonan as $index => $status)
{{-- Cek apakah status adalah "Revisi" dan status permohonan tidak sama, maka tidak ditampilkan --}}
@if (strtolower($status->name) == 'revisi' && strtolower($status->name) != strtolower($permohonan->status))
@continue
@endif
<div class="flex items-start relative">
@if ($index < count($status_permohonan) - 1)
<div
class="w-9 left-0 top-9 absolute bottom-0 translate-x-1/2
{{ strtolower($status->name) == strtolower($permohonan->status) ? 'border-l border-l-primary' : 'border-l border-l-gray-300' }}">
</div>
@endif
<div
class="flex items-center justify-center shrink-0 rounded-full
{{ strtolower($status->name) == strtolower($permohonan->status) ? ' btn-outline btn-primary' : 'bg-gray-100 border-gray-300 text-gray-600' }}
size-9">
@switch(strtolower($status->name))
@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
@default
<i class="ki-filled ki-people text-base"></i>
@endswitch
</div>
@include('lpj::activity.components.status')
</div>
@endforeach
</div>
</div>
<div class="card-footer justify-center">
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,94 @@
<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 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 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
{{-- Tampilkan informasi assign jika status 'assign' --}}
@if (strtolower($status->name) == 'assign' && $isCurrentStatus)
<div class="card shadow-none">
<div class="card-body grid grid-cols-3 gap-5">
{{-- Informasi Penilai, Surveyor, dan Penilai Surveyor --}}
<div>
@isset($permohonan->penilaian)
@if ($penilai = $permohonan->penilaian->userPenilai->name ?? null)
<div class="mb-3">
<p class="text-md font-medium text-gray-900">Penilai:</p>
<span class="text-2sm text-gray-700">{{ $penilai }}</span>
</div>
@endif
@if ($surveyor = $permohonan->penilaian->userSurveyor->name ?? null)
<div class="mb-3">
<p class="text-md font-medium text-gray-900">Surveyor:</p>
<span class="text-2sm text-gray-700">{{ $surveyor }}</span>
</div>
@endif
@if ($penilaiSurveyor = $permohonan->penilaian->userPenilaiSurveyor->name ?? null)
<div class="mb-3">
<p class="text-md font-medium text-gray-900">Penilai Surveyor:</p>
<span class="text-2sm text-gray-700">{{ $penilaiSurveyor }}</span>
</div>
@endif
@endisset
</div>
{{-- Teams --}}
<div>
<h3 class="text-md font-medium text-gray-900">Teams:</h3>
<ul>
@foreach ($permohonan->penilaian->teams->teamsUsers as $item)
<li class="text-xs text-gray-800 leading-[22px]">{{ $item->user->name }}</li>
@endforeach
</ul>
</div>
{{-- Catatan --}}
<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>

View File

@@ -0,0 +1,211 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('activity') }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
Activity
</div>
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
{{-- Daftar {{}} --}}
</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 Penilaian" id="search" type="text" value="">
</label>
</div>
<div class="flex">
<select class="select select-sm w-28" name="select" id="status-filter">
<option value="">Pilih Status</option>
@foreach ($status_permohonan as $item)
<option value="{{ strtolower($item->name) }}">{{ $item->name }}</option>
@endforeach
</select>
</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="5"
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) => `${data.user.name}`,
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => `${data.branch.name}`,
},
debitur_id: {
title: 'Debitur',
render: (item, data) => `${data.debiture.name}`,
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => `${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) => `
<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="activity/${data.id}/show">
<i class="ki-outline ki-eye"></i>
</a>
</div>`,
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
statusFilter.addEventListener('change', function() {
const selectedStatus = this.value;
dataTable.search(selectedStatus);
});
</script>
@endpush

View File

@@ -59,7 +59,7 @@
@if(isset($document->id))
<input type="hidden" name="jenis_jaminan_id" value="{{ $document->jenis_jaminan_id }}">
@endif
<select onchange="getLegalitasJaminan()" {{ isset($document->id) ? "disabled" : "" }} class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
<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))

View 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 pb-2.5">
<div class="card-header" 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

View File

@@ -0,0 +1,160 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.jenis-penilaian') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
data-datatable-state-save="false" id="jenis-penilaian-table"
data-api-url="{{ route('basicdata.jenis-penilaian.datatables') }}">
<div class="card-header 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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<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

View File

@@ -71,21 +71,31 @@
Nama Lengkap
</label>
<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 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="{{ $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">
Nomor ID/KTP
&nbsp;
</label>
<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 ?? '' }}">
@error('nomor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<button type="button" id="tambah_sertifikat" class="btn btn-primary btn-xs">Tambah Nama di Sertifikat</button>
</div>
</div>
@@ -242,3 +252,43 @@
</div>
</div>
@endsection
@push('scripts')
<script>
document.getElementById('tambah_sertifikat').addEventListener('click', function() {
const namaSertifikatDiv = document.getElementById('nama_sertifikat');
const newDiv = document.createElement('div');
newDiv.innerHTML = `
<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 @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="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
@error('nomor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
</div>
</div>
</div>
`;
namaSertifikatDiv.appendChild(newDiv);
// Event listener untuk tombol hapus
newDiv.querySelector('.delete-button').addEventListener('click', function() {
namaSertifikatDiv.removeChild(newDiv);
});
});
</script>
@endpush

View File

@@ -0,0 +1,617 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@push('styles')
<style>
.modal {
width: 50%;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
@endpush
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('penilaian.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">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Detail Debutur
</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">
Name
</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">
Phone
</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">
Address
</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">
&nbsp;
</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 min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
</div>
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</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 hidden" id="accordion_1_content_1">
<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 Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? '' }},
<br> {{ $dokumen->pemilik->village->name ?? '' }},
{{ $dokumen->pemilik->district->name ?? '' }},
{{ $dokumen->pemilik->city->name ?? '' }},
{{ $dokumen->pemilik->province->name ?? '' }} -
{{ $dokumen->pemilik->village->postal_code ?? '' }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach ($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? '' }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if (isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? '' }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
Form Assignment
</h3>
</div>
<div class="card-body">
<form
action="{{ isset($penilaian->nomor_registrasi) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}"
method="POST" class="">
@if (isset($penilaian->nomor_registrasi))
@method('PUT')
@endif
@csrf
<div class="pl-1 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang Dilakukan oleh
</label>
<input type="hidden" name="nomor_registrasi"
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
name="jenis_penilaian_id" id="jenis_penilaian_id">
<option value="">Jenis Penilaian</option>
@foreach ($jenisPenilaian as $item)
@if (isset($penilaian->nomor_registrasi))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endif
@endforeach
</select>
@error('jenis_penilaian_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">
Tim Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('teams_id') border-danger bg-danger-light @enderror"
name="teams_id" id="teams_id">
<option value="">Pilih Tim Penilai</option>
@foreach ($teamPenilai as $item)
@if (isset($penilaian->nomor_registrasi))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->regions->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
@endif
@endforeach
</select>
@error('teams_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">
Surveyor yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="surveyor_id" name="surveyor_id"
class="input select @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor</option>
</select>
@error('surveyor_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">
Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="penilaian_id" name="penilaian_id"
class="input select @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
</select>
@error('penilaian_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">
Surveyor dan penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
class="input select @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor dan Penilai</option>
</select>
@error('penilai_surveyor_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">
Jadwal Kunjungan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="datetime-local" name="tanggal_kunjungan"
value="{{ isset($penilaian->tanggal_kunjungan) ? \Carbon\Carbon::createFromTimestamp($penilaian->tanggal_kunjungan)->format('Y-m-d\TH:i') : '' }}">
@error('tanggal_kunjungan')
<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('keterangan') border-danger bg-danger-light @enderror" rows="3"
type="text" name="keterangan">{{ $penilaian->keterangan ?? '' }}</textarea>
</div>
@error('keterangan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end card-footer mt-2">
<button type="submit" class="btn btn-success">
Aprove
</button>
<button type="button" data-modal-toggle="#modal_revisi" class="btn btn-warning ml-3">
Revisi
</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" data-modal="true" id="modal_revisi" data-backdrop="static" data-keyboard="false">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Revisi</h3>
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
<i class="ki-outline ki-cross"></i>
</button>
</div>
<div class="modal-body">
<form
action="{{ route('penilaian.revisi', $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi) }}"
method="POST" enctype="multipart/form-data" id="revisiForm">
@csrf
@method('PUT')
<input type="hidden" name="action" value="revisi">
<input type="hidden" name="nomor_registrasi"
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
<div class="pl-1 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dokumen Revisi</label>
<div class="flex flex-wrap items-baseline w-full">
<input id="dokumen"
class="file-input @error('dokumen') border-danger bg-danger-light @enderror"
type="file" name="dokumen">
@error('dokumen')
<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 id="keterangan" class="textarea @error('keterangan') border-danger bg-danger-light @enderror"
rows="3" name="keterangan"></textarea>
@error('keterangan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class="modal-footer justify-end mt-2">
<div class="flex gap-4">
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function() {
let teamsSelect = document.getElementById('teams_id');
let penilaiSelect = document.getElementById('penilaian_id');
let surveyorSelect = document.getElementById('surveyor_id');
let penilaiSurveyorSelect = document.getElementById('penilai_surveyor_id');
let selectedSurveyorId = @json($penilaian->surveyor_id ?? null);
let selectedPenilaiId = @json($penilaian->penilaian_id ?? null);
let selectedPenilaiSurveyorId = @json($penilaian->penilai_surveyor_id ?? null);
function fetchPenilai(teamId) {
penilaiSelect.innerHTML = '<option value="">Pilih Penilai</option>';
surveyorSelect.innerHTML = '<option value="">Pilih Surveyor</option>';
penilaiSurveyorSelect.innerHTML = '<option value="">Pilih Penilai Surveyor</option>';
if (teamId) {
fetch(`/penilaian/getUserTeams/${teamId}`)
.then(response => response.json())
.then(data => {
if (data && data.length > 0) {
data.forEach((user) => {
let optionPenilai = document.createElement('option');
let optionSurveyor = document.createElement('option');
let optionPenilaiSurveyor = document.createElement('option');
optionPenilai.value = user.id;
optionSurveyor.value = user.id;
optionPenilaiSurveyor.value = user.id;
optionPenilai.text = user.name;
optionSurveyor.text = user.name;
optionPenilaiSurveyor.text = user.name;
// Tambahkan pengguna ke semua select
penilaiSelect.appendChild(optionPenilai);
surveyorSelect.appendChild(optionSurveyor);
penilaiSurveyorSelect.appendChild(optionPenilaiSurveyor);
if (selectedPenilaiId && selectedPenilaiId == user.id) {
optionPenilai.selected = true;
}
if (selectedSurveyorId && selectedSurveyorId == user.id) {
optionSurveyor.selected = true;
}
if (selectedPenilaiSurveyorId && selectedPenilaiSurveyorId == user
.id) {
optionPenilaiSurveyor.selected = true;
}
});
} else {
let noUserOption = document.createElement('option');
noUserOption.value = '';
noUserOption.text = 'Tidak ada pengguna yang sesuai.';
penilaiSelect.appendChild(noUserOption);
surveyorSelect.appendChild(noUserOption.cloneNode(true));
penilaiSurveyorSelect.appendChild(noUserOption.cloneNode(true));
}
})
.catch(error => {
console.error('Error fetching team members:', error);
let errorOption = document.createElement('option');
errorOption.value = '';
errorOption.text = 'Terjadi kesalahan.';
penilaiSelect.appendChild(errorOption);
surveyorSelect.appendChild(errorOption.cloneNode(true));
penilaiSurveyorSelect.appendChild(errorOption.cloneNode(true));
});
} else {
let defaultOption = document.createElement('option');
defaultOption.value = '';
defaultOption.text = 'Pilih tim terlebih dahulu.';
penilaiSelect.appendChild(defaultOption);
surveyorSelect.appendChild(defaultOption.cloneNode(true));
penilaiSurveyorSelect.appendChild(defaultOption.cloneNode(true));
}
}
teamsSelect.addEventListener('change', function() {
let teamId = this.value;
fetchPenilai(teamId);
});
let selectedTeamId = teamsSelect.value;
if (selectedTeamId) {
fetchPenilai(selectedTeamId);
}
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const revisiForm = document.getElementById('revisiForm');
const btnSubmit = document.getElementById('btnSubmit');
btnSubmit.addEventListener('click', function(event) {
// Cegah form dari pengiriman default
event.preventDefault();
// Ambil nilai dari input dan textarea
const dokumenRevisi = document.getElementById('dokumen').value;
const keteranganRevisi = document.getElementById('keterangan').value.trim();
// Bersihkan pesan kesalahan sebelumnya
document.querySelectorAll('.alert.text-danger').forEach(el => el.remove());
// Validasi: jika ada field kosong, tampilkan pesan kesalahan
let isValid = true;
if (!dokumenRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Dokumen Revisi harus diisi.';
document.getElementById('dokumen').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
if (!keteranganRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Catatan harus diisi.';
document.getElementById('keterangan').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
// Jika semua field valid, kirim form
if (isValid) {
revisiForm.submit();
}
});
});
</script>
@endpush

View File

@@ -0,0 +1,169 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('penilaian') }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
Daftar Penilaian
</div>
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
{{-- Daftar {{}} --}}
</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 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('permohonan.export') }}"> Export to Excel </a>
</div>
</div>
</div>
</div>
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('penilaian.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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="module">
const element = document.querySelector('#permohonan-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) => {
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'
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="penilaian/${data.id}/assignment">
<i class="ki-outline ki-eye"></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

View File

@@ -128,6 +128,34 @@
</div>
</div>
<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_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
<option value="">Pilih Status Bayar</option>
<option {{ $permohonan->status_bayar=="sudah_bayar" ? 'selected' : '' }} value="sudah_bayar">Sudah Bayar</option>
<option {{ $permohonan->status_bayar=="belum_bayar" ? 'selected' : '' }} value="belum_bayar">Belum Bayar</option>
</select>
@error('status')
<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 NJOP
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
@error('nilai_njop')
<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">
Status Permohonan
@@ -282,6 +310,34 @@
</div>
</div>
<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_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
<option value="">Pilih Status Bayar</option>
<option value="sudah_bayar">Sudah Bayar</option>
<option value="belum_bayar">Belum Bayar</option>
</select>
@error('status')
<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 NJOP
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
@error('nilai_njop')
<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">
Status Permohonan

View File

@@ -0,0 +1,61 @@
@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($region->id))
<form action="{{ route('basicdata.region.update', $region->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $region->id }}">
@method('PUT')
@else
<form method="POST" action="{{ route('basicdata.region.store') }}">
@endif
@csrf
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($region->id) ? 'Edit' : 'Tambah' }} region
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.region.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="{{ $region->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="{{ $region->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

View File

@@ -0,0 +1,152 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.region') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="region-table" data-api-url="{{ route('basicdata.region.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Region
</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 region" 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.region.export') }}"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.region.create') }}"> Tambah Region </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"> Region </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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<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/region/${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('#region-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: 'Region',
},
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/region/${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

View File

@@ -0,0 +1,128 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@section('content')
{{-- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> --}}
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<form action="{{ isset($teams->id) ? route('basicdata.teams.update', $teams->id) : route('basicdata.teams.store') }}"
method="POST">
@if (isset($teams->id))
@method('PUT')
<input type="hidden" name="id" value="{{ $teams->id }}">
@endif
@csrf
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($teams->id) ? 'Edit' : 'Tambah' }} Teams
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.teams.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="{{ $teams->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">
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="{{ $teams->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">Region</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
name="regions_id">
<option value="">Select Region</option>
@if (isset($region))
@foreach ($region as $regions)
@if (isset($teams))
<option value="{{ $regions->id }}"
{{ $teams->regions_id == $regions->id ? 'selected' : '' }}>
{{ $regions->name }}</option>
@else
<option value="{{ $regions->id }}">{{ $regions->name }}</option>
@endif
@endforeach
@endif
</select>
@error('regions_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">Users</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror select2"
name="user[]" multiple="multiple">
<option value="">Select Team Group</option>
@if (isset($user))
@foreach ($user as $users)
@if (isset($teams))
<option value="{{ $users->id }}"
{{ in_array($users->id, $selectedUsers) ? 'selected' : '' }}>
{{ $users->name . ' | ' }}
@foreach ($users->roles as $role)
{{ $role->name }}
@endforeach
</option>
@else
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
@foreach ($users->roles as $role)
{{ $role->name }}
@endforeach
</option>
@endif
@endforeach
@endif
</select>
@error('user')
<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

View File

@@ -0,0 +1,176 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.teams') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
data-datatable-state-save="false" id="teams-table" data-api-url="{{ route('basicdata.teams.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Teams
</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 teams" 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.teams.export') }}"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.teams.create') }}"> Tambah Teams </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"> Region Name </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Anggota Team </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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<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/teams/${data}`, {
type: 'DELETE'
}).then((response) => {
swal.fire('Deleted!', 'Team 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('#teams-table');
const searchInput = document.getElementById('search');
const apiUrl = element.getAttribute('data-api-url');
console.log("API URL:", apiUrl);
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();
},
},
region_name: {
title: 'Region Name',
render: (item, data) => {
return (
`<ul>
<li>${data.region_name}</li>
<li>${data.team_name}</li>
</ul>
`)
},
},
user_team: {
title: 'User Team',
render: (item, data) => {
if (data.user_team && data.user_team.length) {
return `<ul>${data.user_team.map(user =>
`<li>${user.nama} | ${user.roles.join(', ')}</li>`
).join('')}</ul>`;
} else {
return '<ul><li>N/A</li></ul>';
}
},
},
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/teams/${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