memperbaiki conflicts --> add feature Data Proses Penawaran

This commit is contained in:
Andy Chaerudin
2024-10-09 20:36:30 +07:00
43 changed files with 3990 additions and 1275 deletions

View File

@@ -13,108 +13,118 @@
</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 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">
Tujuan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card-body lg:py-7.5 grid grid-cols-3">
<div class="mb-5">
<div class="card grow" id="activity_2024">
<div class="card-header">
<h3 class="text-md font-medium text-gray-900">
Nomor Register Permohonan:
Status Activity
</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>
<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-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
<div class="flex items-start relative">
@if ($index > 0)
<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
@case('revisi')
<i class="ki-filled ki-notepad-edit text-base"></i>
@break
<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('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('register')
<i class="ki-filled ki-note-2 text-base"></i>
@break
@case('revisi')
<i class="ki-filled ki-notepad-edit text-base"></i>
@break
@case('assign')
<i class="ki-filled ki-file-added"></i>
@break
@case('register')
<i class="ki-filled ki-note-2 text-base"></i>
@break
@case('survey')
<i class="ki-filled ki-map text-base"></i>
@break
@case('assign')
<i class="ki-filled ki-file-added"></i>
@break
@default
<i class="ki-filled ki-people text-base"></i>
@endswitch
@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>
@include('lpj::activity.components.status')
</div>
@include('lpj::activity.components.status')
</div>
@endforeach
@endforeach
</div>
</div>
<div class="card-footer justify-center">
<!-- Add footer content if necessary -->
</div>
</div>
<div class="card-footer justify-center">
</div>
</div>
</div>
@endsection

View File

@@ -43,47 +43,10 @@
</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>

View File

@@ -4,16 +4,45 @@
{{ 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;
}
.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;
}
</style>
@endpush
<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">
@@ -22,14 +51,42 @@
</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 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>
@@ -203,9 +260,44 @@
dataTable.search(searchValue, true);
});
statusFilter.addEventListener('change', function() {
const selectedStatus = this.value;
dataTable.search(selectedStatus);
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

View File

@@ -0,0 +1,244 @@
@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;
}
</style>
@endpush
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">Team Activity</h3>
</div>
<div data-accordion="true">
@php
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
return $item->team->penilaian
->filter(function ($penilaian) use ($item) {
return $penilaian->penilaian_id == $item->user->id ||
$penilaian->surveyor_id == $item->user->id ||
$penilaian->penilai_surveyor_id == $item->user->id;
})
->count();
});
@endphp
@foreach ($sortedTeamsActivity as $index => $item)
<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]">
<span class="text-base text-gray-900 font-normal">{{ $item->user->name }}</span>
</th>
<th class="min-w-[150px]">
<span class="text-base text-gray-900 font-normal">
@php
$totalTasks = $item->team->penilaian
->filter(function ($penilaian) use ($item) {
return $penilaian->penilaian_id == $item->user->id ||
$penilaian->surveyor_id == $item->user->id ||
$penilaian->penilai_surveyor_id == $item->user->id;
})
->count();
@endphp
<p>Total Task: {{ $totalTasks }}</p>
</span>
</th>
<th>
<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>
</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 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 my-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]">Jenis Asset</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]">Due Date SLA</th>
<th class="min-w-[100px]">Paparan</th>
<th class="min-w-[100px]">Approve</th>
<th class="min-w-[50px] text-center">Keterangan</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="12" class="text-center">No data available</td>
</tr>
</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');
console.log("This is the API URL: " + apiUrl);
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 || ''}`;
},
},
jenis_asset: {
title: 'Jenis Asset',
render: (item, data) => `${data.jenis_asset || ''}`,
},
jenis_report: {
title: 'Jenis Report',
render: (item, data) => `${data.jenis_report || ''}`,
},
register: {
title: 'Register',
render: (item, data) =>
`${formatDateFromISO(data.permohonan.created_at) || ''}`,
},
assign: {
title: 'Assign',
render: (item, data) => `${formatDateFromISO(data.created_at)}`,
},
tanggal_kunjungan: {
title: 'Tgl Kunjungan',
render: (item, data) =>
`${formatDateFromISO(data.tanggal_kunjungan) || ''}`,
},
progress: {
title: 'Progress',
render: (item, data) => `${data.progress || ''}`,
},
due_date: {
title: 'Due Date',
render: (item, data) => `${data.due_date || ''}`,
},
paparan: {
title: 'Paparan',
render: (item, data) => `${data.paparan || ''}`,
},
approve: {
title: 'Approve',
render: (item, data) => `${data.approve || ''}`,
},
actions: {
title: 'Keterangan',
render: (item, data) => `${data.keterangan || ''}`,
},
},
};
// 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}`;
}
</script>
@endpush

View 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

View File

@@ -53,23 +53,25 @@
<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">
<option value="">Pilih Jenis Kantor</option>
@if (isset($branch))
@if (isset($kjpp))
@foreach ($branch as $branches)
<option value="{{ $branches->name }}"
{{ old('jenis_kantor', $kjpp->jenis_kantor) == $branches->name ? 'selected' : '' }}>
{{ $branches->name }}
</option>
@endforeach
@else
@foreach ($branch as $branches)
<option value="{{ $branches->name }}"
{{ old('jenis_kantor') == $branches->name ? 'selected' : '' }}>
{{ $branches->name }}
</option>
@endforeach
@endif
@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')

View File

@@ -36,9 +36,7 @@
<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">
@foreach ($branches as $branch)
{{ $branch->name }}
@endforeach
{{ $kjpp->jenis_kantor }}
</p>
</div>
<label class="form-label max-w-56">Nomor Ijin Usaha</label>

View File

@@ -1,12 +1,12 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('id')) }}
{{ 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', $id) }}" method="POST">
<form action="{{ route('tender.penawaran.storePenawaran', $noreg) }}" method="POST">
@csrf
<div class="card pb-2.5">
@@ -15,8 +15,8 @@
Tambah Data Penawaran
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('tender.penawaran.show', $id) }}" class="btn btn-xs btn-primary" title="Detail"><i
class="ki-outline ki-abstract-26"></i> Detail</a>
<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.index') }}" class="btn btn-xs btn-info"><i
class="ki-filled ki-exit-left"></i>
Back</a>
@@ -28,11 +28,33 @@
Nomor Registrasi
</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" value="{{ $penawaran->nomor_registrasi ?? '-' }}" name="nomor_registrasi"
class="flex w-full text-gray-600 font-medium text-sm" readonly>
@error('nomor_registrasi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<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">
@@ -40,7 +62,7 @@
Nomor Penawaran
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code"
<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>
@@ -49,44 +71,22 @@
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nama KJPP Sebelumnya
Data KJPP
</label>
<div class="flex flex-wrap items-baseline w-full">
<select name="nama_kjpp_sebelumnya[]" multiple="multiple"
class="input tomselect w-full @error('nama_kjpp_sebelumnya') border-danger @enderror"
id="nama_kjpp_sebelumnya_select">
<option value="">Pilih Nama KJPP Sebelumnya</option>
<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)
<option value="{{ $row->name }}"
{{ in_array($row->name, old('nama_kjpp_sebelumnya', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@if (isset($kjpp))
<option value="{{ $row->id }}"
{{ in_array($row->id, old('kjpp', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach
</select>
@error('nama_kjpp_sebelumnya')
<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">
Biaya KJPP Sebelumnya
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('biaya_kjpp_sebelumnya') border-danger @enderror" type="text"
name="biaya_kjpp_sebelumnya" value="{{ old('biaya_kjpp_sebelumnya') }}">
@error('biaya_kjpp_sebelumnya')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<label class="form-label max-w-56">
Tanggal Penilaian Sebelumnya
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('tanggal_penilaian_sebelumnya') border-danger @enderror"
type="date" name="tanggal_penilaian_sebelumnya"
value="{{ old('tanggal_penilaian_sebelumnya') }}">
@error('tanggal_penilaian_sebelumnya')
@error('kjpp')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -113,6 +113,39 @@
<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>
@@ -137,51 +170,24 @@
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tanggal Awal
Status
</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')
<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>
<label class="form-label max-w-56">
Tanggal Akhir
</label>
<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">Status</label>
<select id="status" 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>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
@@ -193,3 +199,19 @@
</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);
}
}
</style>
@endpush

View File

@@ -0,0 +1,223 @@
@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 pb-2.5">
<div class="card-header" 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.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="{{ $penawaran->nama_kjpp_sebelumnya ?? '' }}">
</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="{{ $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 ?? '' }}">
</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 }}
</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) }}">
@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">
<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">
<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);
}
}
</style>
@endpush

View File

@@ -16,7 +16,7 @@
<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="">
<input placeholder="Search Penawaran Tender" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
@@ -36,16 +36,32 @@
<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 Penawaran </span>
<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-[250px]" data-datatable-column="nama_kjpp_sebelumnya">
<span class="sort"> <span class="sort-label"> Nama KJPP Sebelumnya </span>
<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-[50px]" data-datatable-column="tanggal_penilaian_sebelumnya">
<span class="sort"> <span class="sort-label"> Tanggal Penilaian Sebelumnya </span>
<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>
@@ -89,37 +105,50 @@
return months[month -
1];
}
</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(`tender/penawaran/${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');
});
}
})
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-abstract-26"></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-arrow-circle-right"></i>
</a>
`;
} else {
// Jika tidak ada, tampilkan tombol "Tambah Penawaran"
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-abstract-26"></i>
</a>
<a href="/tender/penawaran/${nomor_registrasi}/create" class="btn btn-sm btn-icon btn-clear btn-primary" title="Penawaran">
<i class="ki-outline ki-arrow-circle-right"></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">
@@ -141,29 +170,64 @@
return checkbox.outerHTML.trim();
},
},
code: {
title: 'Nomor Penawaran',
nomor_registrasi: {
title: 'Nomor Registrasi',
},
nama_kjpp_sebelumnya: {
title: 'Nama KJPP Sebelumnya',
tanggal_permohonan: {
title: 'Tanggal Permohonan',
render: (item, data) => {
return `${formatDate(new Date(data.tanggal_permohonan))}`
}
},
tanggal_penilaian_sebelumnya: {
title: 'Tanggal Penilaian Sebelumnya',
render: (item, data) => formatDate(new Date(data.tanggal_penilaian_sebelumnya))
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) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail" href="tender/penawaran/${data.id}/show">
<i class="ki-outline ki-abstract-26"></i>
</a>
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Penawaran" href="tender/penawaran/${data.id}/create">
<i class="ki-outline ki-arrow-circle-right"></i>
</a>
// 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>
`;
</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;
}
}
},
};

View File

@@ -1,7 +1,39 @@
@php
function formatTanggalIndonesia($date)
{
$carbonDate = \Carbon\Carbon::parse($date);
$indonesianMonths = [
'Januari',
'Februari',
'Maret',
'April',
'Mei',
'Juni',
'Juli',
'Agustus',
'September',
'Oktober',
'November',
'Desember',
];
$month = $indonesianMonths[$carbonDate->month - 1];
return $carbonDate->format('d') . ' ' . $month . ' ' . $carbonDate->format('Y');
}
function formatRupiah($number)
{
// Convert to float if the input is a string
$number = (float) $number;
return 'Rp ' . number_format($number, 2, ',', '.');
}
@endphp
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('id')) }}
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('noreg')) }}
@endsection
@section('content')
@@ -12,8 +44,14 @@
Detail Penawaran
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('tender.penawaran.createPenawaran', $id) }}" class="btn btn-xs btn-primary"
title="Penawaran"><i class="ki-filled ki-arrow-circle-right"></i> Penawaran</a>
@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
<a href="{{ route('tender.penawaran.index') }}" class="btn btn-xs btn-info"><i
class="ki-filled ki-exit-left"></i> Back</a>
</div>
@@ -25,12 +63,140 @@
</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 }}
{{ $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
@endsection

View File

@@ -7,16 +7,238 @@
@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 card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
data-datatable-state-save="false" id="penawaran-table"
data-api-url="{{ route('tender.penawaran.ulang.datatables') }}">
<div class="card-header py-5 flex-wrap" id="basic_settings">
<h3 class="card-title">
Data Penawaran Ulang
</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">
{{-- @include('lpj::debitur.form') --}}
<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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<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-abstract-26"></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-arrow-circle-right"></i>
</a>
`;
} else {
// Jika tidak ada, tampilkan tombol "Tambah Penawaran"
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-abstract-26"></i>
</a>
<a href="/tender/penawaran/${nomor_registrasi}/create" class="btn btn-sm btn-icon btn-clear btn-primary" title="Penawaran">
<i class="ki-outline ki-arrow-circle-right"></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

View File

@@ -163,7 +163,7 @@
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
Laporan
</h3>
</div>
<div data-accordion="true">
@@ -283,21 +283,12 @@
<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>
<input class="input"
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
>
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
type="text" value="{{ $jenisPenilaian->name }}"
readonly>
@error('jenis_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
@@ -309,20 +300,11 @@
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>
<input class="input"
type="hidden" name="teams_id" value="{{ $regionName->id }}"
>
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
type="text" value="{{ $regionName->name }}" readonly>
@error('teams_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
@@ -335,8 +317,11 @@
</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">
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('surveyor_id')
@@ -351,8 +336,11 @@
</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">
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@@ -366,8 +354,11 @@
</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">
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor dan Penilai</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('penilai_surveyor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@@ -482,7 +473,7 @@
</div>
@endsection
@push('scripts')
<script>
{{-- <script>
document.addEventListener('DOMContentLoaded', function() {
let teamsSelect = document.getElementById('teams_id');
let penilaiSelect = document.getElementById('penilaian_id');
@@ -570,48 +561,48 @@
fetchPenilai(selectedTeamId);
}
});
</script>
</script> --}}
<script>
document.addEventListener('DOMContentLoaded', function() {
const revisiForm = document.getElementById('revisiForm');
const btnSubmit = document.getElementById('btnSubmit');
<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();
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();
// 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());
// Bersihkan pesan kesalahan sebelumnya
document.querySelectorAll('.alert.text-danger').forEach(el => el.remove());
// Validasi: jika ada field kosong, tampilkan pesan kesalahan
let isValid = true;
// 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 (!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
}
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();
}
// Jika semua field valid, kirim form
if (isValid) {
revisiForm.submit();
}
});
});
});
</script>
</script>
@endpush

View File

@@ -7,13 +7,10 @@
@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-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-header py-5 flex-wrap">
<h3 class="card-title">
{{-- Daftar {{}} --}}
Daftar assignment
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
@@ -27,9 +24,6 @@
</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">

View File

@@ -0,0 +1,163 @@
@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-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('otorisator.datatables', ['otorisator' => $header ]) }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar {{$header}}
</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 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="otorisator/show/${data.id}">
<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

@@ -0,0 +1,173 @@
@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">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
</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">
Laporan
</h3>
</div>
</div>
<div class="card">
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@csrf
<div class="card-body lg:py-7.5">
<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" rows="3" type="number" id="address" name="address"></textarea>
</div>
</div>
</div>
<div class="card-footer flex justify-end">
<button type="submit" name="status" value="preregister" class="btn btn-success">
Approve
</button>
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
Revisi
</button>
</div>
</form>
</div>
</div>
@endsection

View File

@@ -5,8 +5,8 @@
$(document).ready(function() {
prepareForm();
});
function prepareForm()
function prepareForm()
{
$("#registrasi_form")[0].reset();
$(":radio[name='{{ $route[0] }}_tindakan'][value='0']").attr('checked', 'checked');
@@ -16,8 +16,8 @@
// prepare data
setData();
}
function setData()
function setData()
{
let id = $("#id").val();
let token = "{{ csrf_token() }}";
@@ -53,20 +53,20 @@
function setRegionList(datas, cid)
{
$('#{{$route[0]}}_region').empty().append('<option value="0"> - Pilih Region - </option>');
$('#{{$route[0]}}_region').empty().append('<option value="0"> - Pilih Region - </option>');
$.each(datas, function(key, value){
$('#{{$route[0]}}_region').append(new Option(value, key));
});
}
function setJenisPenilaianList(datas, cid)
{
$('#{{$route[0]}}_jenis_penilaian').empty().append('<option value="0"> - Pilih Jenis Penilaian - </option>');
$('#{{$route[0]}}_jenis_penilaian').empty().append('<option value="0"> - Pilih Jenis Penilaian - </option>');
$.each(datas, function(key, value){
$('#{{$route[0]}}_jenis_penilaian').append(new Option(value, key));
});
}
@@ -85,7 +85,7 @@
}
else
{
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
$("#{{ $route[0] }}_div_catatan").show();
}
@@ -95,8 +95,8 @@
e.preventDefault();
//define variable
let token = "{{ csrf_token() }}";
let token = "{{ csrf_token() }}";
let _method = $('input[name=_method]').val();
let id = $('#{{$route[0]}}_id').val();
let tindakan = $('input[name="{{$route[0]}}_tindakan"]:checked').val();
@@ -108,7 +108,7 @@
jenis_penilaian='';
if(region==0)
region='';
var input_data = new Object();
input_data._token= token;
input_data._method= _method;
@@ -117,7 +117,7 @@
input_data.jenis_penilaian= jenis_penilaian;
input_data.region= region;
input_data.catatan = catatan;
let useURL= '{{ route($route[0].'.update', $id) }}';
$.ajax({
url: useURL,
@@ -128,7 +128,7 @@
beforeSend: function() {
},
success: function(response) {
removeErrorCssMsg();
if ('error' == response.status) {
$.each(response.message, function(index, value) {
@@ -137,25 +137,25 @@
$("#{{$route[0]}}_catatan").addClass(" border-danger");
$("#{{$route[0]}}_catatan_msg").text(value);
}
if ("jenis_penilaian" === index) {
$("#{{$route[0]}}_jenis_penilaian").addClass(" border-danger");
$("#{{$route[0]}}_jenis_penilaian_msg").text(value);
}
if ("region" === index) {
$("#{{$route[0]}}_region").addClass(" border-danger");
$("#{{$route[0]}}_region_msg").text(value);
}
});
}
else
}
else
{
toastr.success(response.message);
var url = "{{ route('registrasi.index') }}";
//toastr.success(response.message);
var url = "{{ route('registrasi.index') }}";
$(location).attr('href',url);
}
},
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
@@ -168,15 +168,15 @@
}
});
//
});
//
});
$('#{{$route[0]}}_jenis_penilaian').on('change', function (e) {
var idNya = $('#{{$route[0]}}_jenis_penilaian').find(":selected").val();
// var textNya = $('#{{$route[0]}}_jenis_penilaian').find(":selected").text();
if('1'==idNya)
{
// INTERNAL, show region
@@ -188,11 +188,11 @@
$("#{{ $route[0] }}_div_region").hide();
}
});
/*
$('#{{$route[0]}}_jenis_penilaian').on('change', function() {
console.log( this.value );
});
*/
</script>
@endpush
@endpush

View File

@@ -1,16 +1,16 @@
@push('scripts')
<script type="module">
<script type="module">
$(document).ready(function() {
prepareForm();
});
function prepareForm()
function prepareForm()
{
setData();
}
function setData()
function setData()
{
let id = $("#id").val();
let token = "{{ csrf_token() }}";
@@ -45,17 +45,17 @@
function setJenisPenilaianList(datas, cid)
{
$('#{{$route[0]}}_jenis_penilaian').empty().append('<option value="0"> - Pilih Jenis Penilaian - </option>');
$('#{{$route[0]}}_jenis_penilaian').empty().append('<option value="0"> - Pilih Jenis Penilaian - </option>');
$.each(datas, function(key, value){
$('#{{$route[0]}}_jenis_penilaian').append(new Option(value, key));
});
}
$('input[type=radio][name={{ $route[0] }}_tindakan]').change(function() {
removeErrorCssMsg();
if($(this).val()==0)
{
// show jenis pilihan
@@ -66,7 +66,7 @@
}
else
{
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
$("#{{ $route[0] }}_div_catatan").show();
}
@@ -76,8 +76,8 @@
e.preventDefault();
//define variable
let token = "{{ csrf_token() }}";
let token = "{{ csrf_token() }}";
let _method = $('input[name=_method]').val();
let id = $('#{{$route[0]}}_id').val();
let tindakan = $('input[name="{{$route[0]}}_tindakan"]:checked').val();
@@ -86,7 +86,7 @@
if(jenis_penilaian==0)
jenis_penilaian='';
var input_data = new Object();
input_data._token= token;
input_data._method= _method;
@@ -94,7 +94,7 @@
input_data.tindakan= tindakan;
input_data.jenis_penilaian= jenis_penilaian;
input_data.catatan = catatan;
let useURL= '{{ route($route[0].'.update', $id) }}';
$.ajax({
url: useURL,
@@ -105,7 +105,7 @@
beforeSend: function() {
},
success: function(response) {
removeErrorCssMsg();
if ('error' == response.status) {
$.each(response.message, function(index, value) {
@@ -114,20 +114,20 @@
$("#{{$route[0]}}_catatan").addClass(" border-danger");
$("#{{$route[0]}}_catatan_msg").text(value);
}
if ("jenis_penilaian" === index) {
$("#{{$route[0]}}_jenis_penilaian").addClass(" border-danger");
$("#{{$route[0]}}_jenis_penilaian_msg").text(value);
}
});
}
else
}
else
{
toastr.success(response.message);
var url = "{{ route('registrasi.index') }}";
var url = "{{ route('registrasi.index') }}";
$(location).attr('href',url);
}
},
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
@@ -140,9 +140,9 @@
}
});
//
});
//
});
</script>
@endpush
@endpush

View File

@@ -1,243 +1,316 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@php
// $route = Route::currentRouteName();
// dd($route); registrasi.show
$route = explode('.', Route::currentRouteName());
// $route = Route::currentRouteName();
// dd($route); registrasi.show
$route = explode('.', Route::currentRouteName());
@endphp
@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">
<h3 class="card-title">
Detail Permohonan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('registrasi.edit', $id) }}" class="btn btn-xs btn-primary" title="Register"><i class="ki-filled ki-arrow-circle-right"></i> Registrasi</a>
<a href="{{ route('registrasi.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="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="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="flex items-center gap-2">
<a href="{{ route('registrasi.edit', $id) }}" class="btn btn-xs btn-primary hidden" title="Register"><i class="ki-filled ki-arrow-circle-right"></i> Registrasi</a>
<a href="{{ route('registrasi.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">
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">
Pemohon:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
</span>
</div>
</div>
</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 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>
</div>
</div>
<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">
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>
<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>
<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">
Registrasi
</h3>
<div class="flex items-center gap-2 hidden">
<a href="{{ route('registrasi.show', $id) }}" class="btn btn-xs btn-primary" title="Detail"><i class="ki-filled ki-abstract-26"></i> Detail</a>
<a href="{{ route('registrasi.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">
<form id="{{$route[0]}}_form" name="{{$route[0]}}_form" method="POST">
<input type="hidden" id="id" name="id" value="{{ $id }}">
@method('PUT')
@csrf
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tindakan
</label>
<div class="flex gap-12">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="radio" name="{{$route[0]}}_tindakan" type="radio" value="0" id="{{ $route[0] }}_tindakan_yes" />
Yes
</label>&nbsp;&nbsp;
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="radio" name="{{$route[0]}}_tindakan" type="radio" value="1" id="{{ $route[0] }}_tindakan_no" />
No
</label>
</div>
</div>
<div id="{{$route[0]}}_div_jenis_pilihan" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mt-5">
<label class="form-label max-w-56">
Data Jenis Penilaian (Pilihan registrasi)
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="inputku select" id="{{$route[0]}}_jenis_penilaian" name="{{$route[0]}}_jenis_penilaian">
<option></option>
</select>
<em id="{{$route[0]}}_jenis_penilaian_msg" class="alert text-danger text-sm"></em>
</div>
</div>
<div id="{{ $route[0] }}_div_catatan" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mt-5">
<label class="form-label max-w-56">
Catatan
</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="inputku textarea" name="{{$route[0]}}_catatan" id="{{$route[0]}}_catatan" placeholder="Catatan..." rows="6"></textarea>
<em id="{{$route[0]}}_catatan_msg" class="alert text-danger text-sm"></em>
</div>
</div>
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mt-5">
<label class="form-label max-w-56">
Region
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="inputku select" id="{{$route[0]}}_region" name="{{$route[0]}}_region">
<option></option>
</select>
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
</div>
</div>
<div class="flex justify-end mt-5">
<button type="button" class="btn btn-primary" id="toEdit">
Save
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@include('lpj::registrasi.js.showjs')
@include('lpj::registrasi.js.editjs')

View File

@@ -0,0 +1,162 @@
@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">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Surveyor
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('surveyor.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">
Waktu Survei:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->penilaian->tanggal_kunjungan }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Keterangan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->penilaian->keterangan }}
</span>
</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 min-w-full py-2 px-2">
{{-- <div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
</div> --}}
<div class="flex flex-col gap-5 lg:gap-7.5">
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,270 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('surveyor') }}
@endsection
@section('content')
@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
<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">
Surveyor
</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('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('surveyor.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 Assigned</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">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>
</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">Kunjungan</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=""
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">Tanggal 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="">
@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 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 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 Assigned',
render: (item, data) => {
const createdAt = convertDate(data.penilaian.created_at);
return createdAt;
},
},
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}`,
},
jenis_fasilitas_kredit_id: {
title: 'Fasilitas Kredit',
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
},
actions: {
title: 'Action',
render: (item, data) => `
<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" data-modal-toggle="#modal_revisi" >
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${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);
});
function convertDate(date) {
const createdAt = new Date(date);
const day = String(createdAt.getDate()).padStart(2, '0');
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
const year = createdAt.getFullYear();
return `${day}-${month}-${year}`;
}
</script>
@endpush

View File

@@ -126,3 +126,4 @@
</form>
</div>
@endsection