Merge branch 'staging' into feature/senior-officer

This commit is contained in:
majid
2024-10-04 10:05:46 +07:00
52 changed files with 4404 additions and 773 deletions

View File

@@ -0,0 +1,138 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('authorization') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="authorization-table" data-api-url="{{ route('authorization.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Authorization
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
<input placeholder="Search Authorization" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="#"> Tambah Authorization </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[250px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="branche_name">
<span class="sort"> <span class="sort-label"> Cabang </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="debiture_name">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="nama_tujuan_penilaian">
<span class="sort"> <span class="sort-label"> Tujuan Penilain </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="account_officer">
<span class="sort"> <span class="sort-label"> Account Officer </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="module">
const element = document.querySelector('#authorization-table');
const searchInput = document.getElementById('search');
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
branche_name: {
title: 'Cabang',
},
debiture_name: {
title: 'Debitur',
},
nama_tujuan_penilaian: {
title: 'Tujuan Penilain',
},
account_officer: {
title: 'Account Officer',
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" href="/debitur/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
},
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
dataTable.showSpinner();
// Custom search functionality
searchInput.addEventListener('input', function () {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush

View File

@@ -0,0 +1,77 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
@if (isset($jenisLaporan->id))
<form action="{{ route('basicdata.jenis_laporan.update', $jenisLaporan->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisLaporan->id }}">
@method('PUT')
@else
<form method="POST" action="{{ route('basicdata.jenis_laporan.store') }}">
@endif
@csrf
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($jenisLaporan->id) ? 'Edit' : 'Tambah' }} Jenis Laporan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis_laporan.index') }}" class="btn btn-xs btn-info"><i
class="ki-filled ki-exit-left"></i> Back</a>
</div>
</div>
<div class="card-body grid gap-5">
@if (isset($jenisLaporan->id))
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Code
</label>
<div class="flex flex-wrap items-baseline w-full">
<input readonly
class="input border-warning bg-warning-light @error('code') border-danger @enderror"
type="text" name="code" value="{{ $jenisLaporan->code ?? '' }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@else
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Kode Laporan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code"
value="{{ $ijin_usaha->code ?? old('code') }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nama Laporan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name"
value="{{ $jenisLaporan->name ?? old('name') }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,153 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.jenis_laporan') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
data-datatable-state-save="false" id="jenis-laporan-table"
data-api-url="{{ route('basicdata.jenis_laporan.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Jenis Laporan
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
<input placeholder="Search Jenis Laporan" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis_laporan.export') }}"> Export to
Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis_laporan.create') }}"> Tambah Jenis
Laporan </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Kode Laporan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Jenis Laporan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript">
function deleteData(data) {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
$.ajax(`basic-data/jenis_laporan/${data}`, {
type: 'DELETE'
}).then((response) => {
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
window.location.reload();
});
}).catch((error) => {
console.error('Error:', error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
});
}
})
}
</script>
<script type="module">
const element = document.querySelector('#jenis-laporan-table');
const searchInput = document.getElementById('search');
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
code: {
title: 'Code',
},
name: {
title: 'Jenis Laporan',
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis_laporan/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
},
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush

View File

@@ -32,7 +32,7 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code"
value="{{ $kjpp->code ?? old('code') }}">
value="{{ isset($kjpp->id) ? $kjpp->code : (empty($kjpp->id) ? $fullKjppNumber : old('code')) }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
@@ -49,11 +49,11 @@
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Jenis Kantor / Cabang</label>
<label class="form-label max-w-56">Jenis Kantor</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('jenis_kantor') border-danger @enderror"
<select id="jenis_kantor" class="select w-full @error('jenis_kantor') border-danger @enderror"
name="jenis_kantor">
<option value="">Pilih Jenis Kantor / Cabang</option>
<option value="">Pilih Jenis Kantor</option>
@if (isset($branch))
@if (isset($kjpp))
@foreach ($branch as $branches)
@@ -78,7 +78,8 @@
</div>
<label class="form-label max-w-56">Nomor Ijin Usaha</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('nomor_ijin_usaha') border-danger @enderror"
<select id="nomor_ijin_usaha"
class="select w-full @error('nomor_ijin_usaha') border-danger @enderror"
name="nomor_ijin_usaha">
<option value="">Pilih Nomor Ijin Usaha</option>
@if (isset($ijin_usaha))
@@ -345,46 +346,42 @@
<label class="form-label max-w-56">
Ijin Usaha
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($ijin_usaha as $row)
<label class="switch">
@if (isset($kjpp->ijin_usaha_id))
<input type="checkbox"
@if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="ijin_usaha_id[]" />
@else
<input type="checkbox"
@if (in_array($row->code, old('ijin_usaha_id', []))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="ijin_usaha_id[]" />
@endif
<span class="switch-label">
<div class="flex flex-wrap items-baseline w-full">
<select name="ijin_usaha_id[]" multiple="multiple"
class="input tomselect w-full @error('ijin_usaha_id') border-danger @enderror"
id="ijin_usaha_select">
<option value="">Pilih Ijin Usaha</option>
@foreach ($ijin_usaha as $row)
<option value="{{ $row->code }}"
{{ isset($kjpp->ijin_usaha_id) ? (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '') : (in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '') }}>
{{ $row->name }}
</span>
</label>
@endforeach
</option>
@endforeach
</select>
@error('ijin_usaha_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Pengalaman (Jenis Aset)
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($jenis_aset as $row)
<label class="switch">
@if (isset($kjpp->jenis_aset_id))
<input type="checkbox"
@if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="jenis_aset_id[]" />
@else
<input type="checkbox"
@if (in_array($row->code, old('jenis_aset_id', []))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="jenis_aset_id[]" />
@endif
<span class="switch-label">
<div class="flex flex-wrap items-baseline w-full">
<select name="jenis_aset_id[]" multiple="multiple"
class="input tomselect w-full @error('jenis_aset_id') border-danger @enderror"
id="jenis_aset_select">
<option value="">Pilih Jenis Aset</option>
@foreach ($jenis_aset as $row)
<option value="{{ $row->code }}"
{{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id ?? '[]', true))) ? 'selected' : '' }}>
{{ $row->name }}
</span>
</label>
@endforeach
</option>
@endforeach
</select>
@error('jenis_aset_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

View File

@@ -45,7 +45,7 @@
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="jenis_kantor">
<span class="sort"> <span class="sort-label"> Jenis Kantor / Cabang </span>
<span class="sort"> <span class="sort-label"> Jenis Kantor </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
@@ -130,7 +130,7 @@
title: 'Nama KJPP',
},
jenis_kantor: {
title: 'Jenis Kantor / Cabang',
title: 'Jenis Kantor',
},
actions: {
title: 'Action',

View File

@@ -33,7 +33,7 @@
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Jenis Kantor / Cabang</label>
<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)
@@ -63,7 +63,7 @@
{{ $district->name }}
@endforeach ,
@foreach ($cities as $city)
{{ $city->name }}
{{ ucwords(strtolower($city->name)) }}
@endforeach ,
@foreach ($provinces as $province)
{{ $province->name }}
@@ -148,32 +148,50 @@
<label class="form-label max-w-56">
Ijin Usaha
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($ijin_usahas as $row)
<label class="switch">
<input type="checkbox" @if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="ijin_usaha_id[]" disabled="" />
<span class="switch-label">
{{ $row->name }}
</span>
</label>
@endforeach
<div class="flex flex-wrap items-baseline w-full">
@if (isset($kjpp->ijin_usaha_id))
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm gap-1">
@foreach (json_decode($kjpp->ijin_usaha_id, true) as $ijin_code)
@php
$ijin_usaha = $ijin_usahas->firstWhere('code', $ijin_code);
@endphp
@if ($ijin_usaha)
<div
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
{{ $ijin_usaha->name }}
</div>
@endif
@endforeach
</div>
@else
<div class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">No
business license
selected.</div>
@endif
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Pengalaman (Jenis Aset)
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($jenis_jaminan as $row)
<label class="switch">
<input type="checkbox" @if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="jenis_aset_id[]" disabled="" />
<span class="switch-label">
{{ $row->name }}
</span>
</label>
@endforeach
<div class="flex flex-wrap items-baseline w-full gap-1">
@if (isset($kjpp->jenis_aset_id))
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
@php
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
@endphp
@if ($jenis_aset)
<span
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
{{ $jenis_aset->name }}
</span>
@endif
@endforeach
@else
<span class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">
No asset type selected.
</span>
@endif
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

View File

@@ -1,22 +1,195 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('tender.penawaran') }}
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('id')) }}
@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">
@csrf
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
Tambah Data Penawaran
</h3>
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
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.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 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
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor Penawaran
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code"
value="{{ old('code') }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nama KJPP Sebelumnya
</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>
@foreach ($kjpp as $row)
<option value="{{ $row->name }}"
{{ in_array($row->name, old('nama_kjpp_sebelumnya', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@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')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tujuan Penilaian KJPP
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="tujuan_penilaian_kjpp_id"
class="select w-full @error('tujuan_penilaian_kjpp_id') border-danger @enderror"
name="tujuan_penilaian_kjpp_id">
<option value="">Pilih Tujuan Penilaian KJPP</option>
@if (isset($tujuan_penilaian_kjpp))
@foreach ($tujuan_penilaian_kjpp as $tp)
<option value="{{ $tp->id }}"
{{ old('tujuan_penilaian_kjpp_id') == $tp->id ? 'selected' : '' }}>
{{ $tp->name }}
</option>
@endforeach
@endif
</select>
@error('tujuan_penilaian_kjpp_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<label class="form-label max-w-56">
Jenis Laporan
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="jenis_laporan_id"
class="select w-full @error('jenis_laporan_id') border-danger @enderror"
name="jenis_laporan_id">
<option value="">Pilih Jenis Laporan</option>
@if (isset($jenis_laporan))
@foreach ($jenis_laporan as $jl)
<option value="{{ $jl->id }}"
{{ old('jenis_laporan_id') == $jl->id ? 'selected' : '' }}>
{{ $jl->name }}
</option>
@endforeach
@endif
</select>
@error('jenis_laporan_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tanggal Awal
</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>
<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">
Save
</button>
</div>
</div>
</div>
<div class="card-body">
{{-- @include('lpj::debitur.form') --}}
</div>
</div>
</form>
</div>
@endsection

View File

@@ -7,15 +7,173 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false"
id="currency-table" data-api-url="{{ route('basicdata.currency.datatables') }}">
<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.datatables') }}">
<div class="card-header py-5 flex-wrap" id="basic_settings">
<h3 class="card-title">
Data Penawaran
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
<input placeholder="Search KJPP" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('tender.penawaran.exportPenawaran') }}"> Export to
Excel
</a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Nomor Penawaran </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="nama_kjpp_sebelumnya">
<span class="sort"> <span class="sort-label"> Nama KJPP Sebelumnya </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>
<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];
}
</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');
});
}
})
}
</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();
},
},
code: {
title: 'Nomor Penawaran',
},
nama_kjpp_sebelumnya: {
title: 'Nama KJPP Sebelumnya',
},
tanggal_penilaian_sebelumnya: {
title: 'Tanggal Penilaian Sebelumnya',
render: (item, data) => formatDate(new Date(data.tanggal_penilaian_sebelumnya))
},
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>
</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,36 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('id')) }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
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>
<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">
No. registrasi
</label>
<div class="flex flex-wrap items-baseline w-full">
<p class="flex w-full text-gray-600 font-medium text-sm">
{{ $penawaran->nomor_registrasi }}
</p>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -244,7 +244,7 @@
</div>
</div>
<div class="card-footer flex justify-end">
<button type="submit" name="status" value="register" class="btn btn-success">
<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">

View File

@@ -7,7 +7,8 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card 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('permohonan.datatables') }}">
<div class="card 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('permohonan.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Permohonan
@@ -27,46 +28,48 @@
</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">
<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>
<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="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
@@ -98,7 +101,7 @@
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
@@ -171,11 +174,12 @@
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" href="permohonan/${data.id}/edit">
return `
<div class="flex flex-nowrap justify-center gap-1.5">
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-outline btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
@@ -186,7 +190,7 @@
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function () {
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);

View File

@@ -0,0 +1,96 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@php
// $route = Route::currentRouteName();
// dd($route);
$route = explode('.', Route::currentRouteName());
@endphp
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<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="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
Tambah Registrasi
</h3>
<div class="flex items-center gap-2">
<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 grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
No. registrasi
</label>
<div class="flex flex-wrap items-baseline w-full">
<label class="card-title" id="textReg">
No. registrasi
</label>
</div>
</div>
<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">
<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">
<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">
<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">
<button type="button" class="btn btn-primary" id="toEdit">
Save
</button>
</div>
</div>
</div>
</form>
</div>
@endsection
@include('lpj::registrasi.js.editjs')

View File

@@ -0,0 +1,169 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('registrasi') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="registrasi-table" data-api-url="{{ route('registrasi.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Registrasi
</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 Registrasi" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="user_id">
<span class="sort"> <span class="sort-label"> User Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch_id">
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="status">
<span class="sort"> <span class="sort-label"> Status </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
function showPermohonanData(regId)
{
var url = "{{ url('registrasi') }}/"+regId;
$(location).attr('href',url);
}
</script>
<script type="module">
const element = document.querySelector('#registrasi-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 onclick="showPermohonanData(${data.id})" class="btn btn-sm btn-icon btn-clear btn-warning" title="Detail">
<i class="ki-outline ki-eye"></i>
</a>
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Register" href="registrasi/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
</div>`;
},
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function () {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush

View File

@@ -0,0 +1,196 @@
@push('scripts')
<script type="module">
$(document).ready(function() {
prepareForm();
});
function prepareForm()
{
$("#registrasi_form")[0].reset();
$(":radio[name='{{ $route[0] }}_tindakan'][value='0']").attr('checked', 'checked');
$("#{{ $route[0] }}_div_jenis_pilihan").show();
$("#{{ $route[0] }}_div_catatan").hide();
$("#{{ $route[0] }}_div_region").hide();
// prepare data
setData();
}
function setData()
{
let id = $("#id").val();
let token = "{{ csrf_token() }}";
// alert('token = ' + token);
var useURL = "{{ route('registrasi.setData') }}";
var input_data = new Object();
input_data._token = token;
input_data.id = id;
$.ajax({
url: useURL,
type: "POST",
data: input_data,
dataType: "json",
beforeSend: function() {
// if ($("#myLoader").hasClass("pre-loader hidden")) {
// pleaseStartLoader();
// }
},
success: function(response) {
console.log(response);
$("#textReg").text(response.datas.nomor_registrasi);
setJenisPenilaianList(response.jenisPenilaians,0);
setRegionList(response.regions,0);
},
error: function(xhr) {
},
complete: function() {
}
});
}
function setRegionList(datas, cid)
{
$('#{{$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>');
$.each(datas, function(key, value){
$('#{{$route[0]}}_jenis_penilaian').append(new Option(value, key));
});
}
$('input[type=radio][name={{ $route[0] }}_tindakan]').change(function() {
if($(this).val()==0)
{
// show jenis pilihan
// hide catatan
$("#{{ $route[0] }}_div_jenis_pilihan").show();
$("#{{ $route[0] }}_catatan").val('');
$("#{{ $route[0] }}_div_catatan").hide();
}
else
{
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
$("#{{ $route[0] }}_div_catatan").show();
}
});
$("#toEdit").click(function(e) {
e.preventDefault();
//define variable
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();
let jenis_penilaian = $("#{{$route[0]}}_jenis_penilaian").val();
let region = $("#{{$route[0]}}_region").val();
let catatan = $("#{{$route[0]}}_catatan").val();
if(jenis_penilaian==0)
jenis_penilaian='';
if(region==0)
region='';
var input_data = new Object();
input_data._token= token;
input_data._method= _method;
input_data.id= id;
input_data.tindakan= tindakan;
input_data.jenis_penilaian= jenis_penilaian;
input_data.region= region;
input_data.catatan = catatan;
let useURL= '{{ route($route[0].'.update', $id) }}';
$.ajax({
url: useURL,
type: "PUT",
cache: false,
data: input_data,
dataType: "json",
beforeSend: function() {
},
success: function(response) {
if ('error' == response.status) {
$.each(response.message, function(index, value) {
if ("catatan" === index) {
$("#{{$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
{
//toastr.success(response.message);
var url = "{{ route('registrasi.index') }}";
$(location).attr('href',url);
}
},
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
// console.log(errors);
console.log(response);
},
complete: function() {
// pleaseStopLoader();
}
});
//
});
$('#{{$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
$("#{{ $route[0] }}_div_region").show();
}
else
{
// selain INTERNAL, hide region
$("#{{ $route[0] }}_div_region").hide();
}
});
/*
$('#{{$route[0]}}_jenis_penilaian').on('change', function() {
console.log( this.value );
});
*/
</script>
@endpush

View File

@@ -0,0 +1,148 @@
@push('scripts')
<script type="module">
$(document).ready(function() {
prepareForm();
});
function prepareForm()
{
setData();
}
function setData()
{
let id = $("#id").val();
let token = "{{ csrf_token() }}";
// alert('token = ' + token);
var useURL = "{{ route('registrasi.showData') }}";
var input_data = new Object();
input_data._token = token;
input_data.id = id;
$.ajax({
url: useURL,
type: "POST",
data: input_data,
dataType: "json",
beforeSend: function() {
// if ($("#myLoader").hasClass("pre-loader hidden")) {
// pleaseStartLoader();
// }
},
success: function(response) {
console.log(response);
$("#textReg").text(response.datas.nomor_registrasi);
// setJenisPenilaianList(response.jenisPenilaians,0);
},
error: function(xhr) {
},
complete: function() {
}
});
}
function setJenisPenilaianList(datas, cid)
{
$('#{{$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() {
if($(this).val()==0)
{
// show jenis pilihan
// hide catatan
$("#{{ $route[0] }}_div_jenis_pilihan").show();
$("#{{ $route[0] }}_catatan").val('');
$("#{{ $route[0] }}_div_catatan").hide();
}
else
{
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
$("#{{ $route[0] }}_div_catatan").show();
}
});
$("#toEdit").click(function(e) {
e.preventDefault();
//define variable
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();
let jenis_penilaian = $("#{{$route[0]}}_jenis_penilaian").val();
let catatan = $("#{{$route[0]}}_catatan").val();
if(jenis_penilaian==0)
jenis_penilaian='';
var input_data = new Object();
input_data._token= token;
input_data._method= _method;
input_data.id= id;
input_data.tindakan= tindakan;
input_data.jenis_penilaian= jenis_penilaian;
input_data.catatan = catatan;
let useURL= '{{ route($route[0].'.update', $id) }}';
$.ajax({
url: useURL,
type: "PUT",
cache: false,
data: input_data,
dataType: "json",
beforeSend: function() {
},
success: function(response) {
if ('error' == response.status) {
$.each(response.message, function(index, value) {
if ("catatan" === index) {
$("#{{$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
{
toastr.success(response.message);
var url = "{{ route('registrasi.index') }}";
$(location).attr('href',url);
}
},
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
// console.log(errors);
console.log(response);
},
complete: function() {
// pleaseStopLoader();
}
});
//
});
</script>
@endpush

View File

@@ -0,0 +1,316 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@php
// $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">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('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">
Pemohon:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Detail Debutur
</h3>
</div>
<div class="card-table scrollable-x-auto pb-3">
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-2 text-gray-600 font-normal">
Name
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Email
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->email ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Phone
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->phone ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Address
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->address ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
&nbsp;
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
</td>
</tr>
</table>
</div>
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-3 text-gray-600 font-normal">
Cabang
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->branch->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
CIF
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->cif ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Nomor Rekening
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->nomor_rekening ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
NPWP
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->npwp ?? "" }}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
</div>
<div data-accordion="true">
@foreach($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? ""}},
<br> {{ $dokumen->pemilik->village->name ?? "" }}, {{ $dokumen->pemilik->district->name ?? "" }}, {{ $dokumen->pemilik->city->name ?? "" }}, {{ $dokumen->pemilik->province->name ?? "" }} - {{ $dokumen->pemilik->village->postal_code ?? "" }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if(isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download',['id'=>$permohonan->debiture->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? "" }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
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,77 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
@if (isset($tujuanPenilaianKJPP->id))
<form action="{{ route('basicdata.tujuan_penilaian_kjpp.update', $tujuanPenilaianKJPP->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $tujuanPenilaianKJPP->id }}">
@method('PUT')
@else
<form method="POST" action="{{ route('basicdata.tujuan_penilaian_kjpp.store') }}">
@endif
@csrf
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($tujuanPenilaianKJPP->id) ? 'Edit' : 'Tambah' }} Tujuan Penilaian KJPP
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.tujuan_penilaian_kjpp.index') }}" class="btn btn-xs btn-info"><i
class="ki-filled ki-exit-left"></i> Back</a>
</div>
</div>
<div class="card-body grid gap-5">
@if (isset($tujuanPenilaianKJPP->id))
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Code
</label>
<div class="flex flex-wrap items-baseline w-full">
<input readonly
class="input border-warning bg-warning-light @error('code') border-danger @enderror"
type="text" name="code" value="{{ $tujuanPenilaianKJPP->code ?? '' }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@else
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Kode Tujuan Penilaian KJPP
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code"
value="{{ $ijin_usaha->code ?? old('code') }}">
@error('code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nama Tujuan Penilaian KJPP
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name"
value="{{ $tujuanPenilaianKJPP->name ?? old('name') }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,154 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.tujuan_penilaian_kjpp') }}
@endsection
@section('content')
<div class="grid">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
data-datatable-state-save="false" id="tujuan-penilaian-kjpp"
data-api-url="{{ route('basicdata.tujuan_penilaian_kjpp.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Tujuan Penilaian KJPP
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
<input placeholder="Search Tujuan Penilaian KJPP" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('basicdata.tujuan_penilaian_kjpp.export') }}"> Export
to
Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.tujuan_penilaian_kjpp.create') }}">
Tambah Penilaian KJPP </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Kode Tujuan Penilaian KJPP </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Nama Tujuan Penilaian KJPP </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript">
function deleteData(data) {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
$.ajax(`basic-data/tujuan_penilaian_kjpp/${data}`, {
type: 'DELETE'
}).then((response) => {
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
window.location.reload();
});
}).catch((error) => {
console.error('Error:', error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
});
}
})
}
</script>
<script type="module">
const element = document.querySelector('#tujuan-penilaian-kjpp');
const searchInput = document.getElementById('search');
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
code: {
title: 'Kode Tujuan Penilaian KJPP',
},
name: {
title: 'Nama Tujuan Penilaian KJPP',
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/tujuan_penilaian_kjpp/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
},
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush