penambahan form assign so

This commit is contained in:
majid
2024-09-18 17:40:24 +07:00
parent 53ccf7de11
commit eb92e1b8f7
9 changed files with 366 additions and 690 deletions

View File

@@ -12,12 +12,6 @@
background-color: #ddd;
margin: 20px 0;
}
.h1 {
font-size: 16px;
font-weight: 600;
margin-bottom: 10px;
}
</style>
@endpush
@@ -28,484 +22,194 @@
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
Form Data Jaminan
Form Penilai Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.penilaian.index') }}" class="btn btn-xs btn-info"><i
class="ki-filled ki-exit-left"></i>
<a href="{{ route('penilaian.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
Back</a>
</div>
</div>
<div class="card-body">
<form
action="{{ isset($penilaian->permohonan_id) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}"
method="POST" class="">
<form action="" method="POST" class="">
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-5 lg:gap-7.5">
<div class="grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-24">
Nomor Registrasi
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nomor_registrasi') border-danger bg-danger-light @enderror"
type="text" name="nomor_registrasi" 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-12">
Nama Pemohon
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="text" name="cif" value="{{ $permohonan->user->name }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-12">
Tanggal Pemohon
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="date" name="cif" value="{{ $permohonan->tanggal_permohonan }}">
</div>
@if (isset($penilaian->permohonan_id))
@method('PUT')
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
@else
<input type="number" name="permohonan_id" value="{{ $permohonan->id }}">
@endif
@csrf
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 p-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang Dilakukan oleh
</label>
<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->permohonan_id))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endif
@endforeach
</select>
@error('jenis_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label ">
Status
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="text" name="cif" value="{{ $permohonan->status }}">
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tim Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('teams_id') border-danger bg-danger-light @enderror"
name="teams_id" id="teams_id">
<option value="">Pilih Tim Penilai</option>
@foreach ($teamPenilai as $item)
@if (isset($penilaian->permohonan_id))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->regions->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
@endif
@endforeach
</select>
@error('teams_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label">
Cabang Pemohon
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="text" name="cif" value="{{ $permohonan->branch->name }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-24">
Cabang Penilai
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="">
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="user_id" name="user_id"
class="input @error('user_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
</select>
</div>
</div>
<div class="grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-24">
Nomor Registrasi cabang
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jadwal Kunjungan
</label>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-24">
Nama Bagian
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="">
</div>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="datetime-local" name="tanggal_kunjungan"
value="{{ isset($penilaian->tanggal_kunjungan) ? \Carbon\Carbon::createFromTimestamp($penilaian->tanggal_kunjungan)->format('Y-m-d\TH:i') : '' }}">
@error('tanggal_kunjungan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Catatan
</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea @error('keterangan') border-danger bg-danger-light @enderror" rows="3" type="text"
name="keterangan">{{ $penilaian->keterangan ?? '' }}</textarea>
</div>
@error('keterangan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</br>
<div class="divider"></div>
<div class="grid gap-5">
<div>
<h1 class="h1">1. IDENTITAS DEBITUR</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nama Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="text" name="cif" value="{{ $permohonan->debiture->name }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Alamat
</label>
<div class="flex flex-wrap items-baseline w-full">
<p>
{{ $permohonan->debiture->address . ' ' . $permohonan->debiture->village->name . ', ' . $permohonan->debiture->district->name . ', ' . $permohonan->debiture->city->name . ', ' . $permohonan->debiture->province->name . ' ' . '(' . $permohonan->debiture->postal_code . ')' }}
</p>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor Cif
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="{{ $permohonan->debiture->cif }}">
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">2. LETAK JAMINAN</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Alamat jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea @error('cif') border-danger bg-danger-light @enderror" rows="3" type="number"
name="cif" value=""></textarea>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Kode Dati II
</label>
<div class="flex flex-wrap items-baseline w-full">
<section class="input w-full">
<option value="">1</option>
</section>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Debitur/Wakil Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Telepon
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror"
type="number" name="cif" value="">
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">3. FASILITAS KREDIT</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis Fasilitas
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($jenisFasilitas as $item)
<option value="">{{ $item->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nilai Plafond
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($nilaiPlafond as $item)
<option value="">{{ $item->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">4. TUJUAN PENILAIAN</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
<option value="">{{ $permohonan->tujuanPenilaian->name }}</option>
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">5. JENIS JAMINAN</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($jenisJaminan as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">6. TIPE JAMINAN</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
tipe jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($jenisJaminan as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div>
<h1 class="h1">7. DATA-DATA</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 border">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"">
<label class="form-label max-w-56 ">
Update By
</label>
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('user') border-danger bg-danger-light @enderror"
type="text" name="user" value="">
@error('province_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('update_at') border-danger bg-danger-light @enderror"
type="text" name="update_at" value="">
@error('city_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
</div>
</div>
</div>
<div>
<h1 class="h1">6. TIPE JAMINAN</h1>
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 p-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang Dilakukan oleh
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($jenisPenilaian as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tim Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
@foreach ($teamPenilai as $item)
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
@endforeach
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="text" name="penilai_tunjuk" value="">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jadwal Kunjungan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="date" name="tanggal_kunjungan" value="">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tanggal
</label>
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="date" name="tanggal_kunjungan" value="">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Catatan
</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea @error('keterangan') border-danger bg-danger-light @enderror" rows="3"
type="text" name="keterangan" value=""></textarea>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"">
<label class="form-label max-w-56 ">
Update By
</label>
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('user') border-danger bg-danger-light @enderror"
type="text" name="user" value="">
@error('province_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<input
class="input @error('update_at') border-danger bg-danger-light @enderror"
type="text" name="update_at" value="">
@error('city_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="divider"></div>
<div class="flex justify-end gap-2">
<button type="submit" class="btn btn-primary">
Save
</button>
<button type="submit" class="btn btn-info">
<div class="flex justify-end card-footer">
<button type="submit"
@if ($permohonan->status == 'Assign') class="btn btn-success"
@else
class="btn btn-warning" @endif>
Assign
</button>
<button type="submit" class="btn btn-light">
Print From
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function() {
let teamsSelect = document.getElementById('teams_id');
let penilaiSelect = document.getElementById('user_id');
// Mengambil nilai user_id dari variabel PHP
let selectedUserId = @json($penilaian->user_id ?? null); // Gunakan null jika tidak ada
function fetchPenilai(teamId) {
penilaiSelect.innerHTML = '';
if (teamId) {
fetch(`/penilaian/getUserTeams/${teamId}`)
.then(response => response.json())
.then(data => {
if (data && data.length > 0) {
data.forEach((user) => {
let option = document.createElement('option');
option.value = user.id;
option.text = user.name;
if (selectedUserId && selectedUserId == user.id) {
option.selected = true;
}
penilaiSelect.appendChild(option);
});
} else {
let option = document.createElement('option');
option.value = '';
option.text = 'Tidak ada penilai.';
penilaiSelect.appendChild(option);
}
})
.catch(error => {
console.error('Error fetching team members:', error);
let option = document.createElement('option');
option.value = '';
option.text = 'Terjadi kesalahan.';
penilaiSelect.appendChild(option);
});
} else {
let option = document.createElement('option');
option.value = '';
option.text = 'Pilih tim terlebih dahulu.';
penilaiSelect.appendChild(option);
}
}
teamsSelect.addEventListener('change', function() {
let teamId = this.value;
fetchPenilai(teamId);
});
let selectedTeamId = teamsSelect.value;
if (selectedTeamId) {
fetchPenilai(selectedTeamId);
}
});
</script>
@endpush

View File

@@ -1,7 +1,7 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render('basicdata.penilaian') }}
{{ Breadcrumbs::render('penilaian') }}
@endsection
@section('content')
@@ -9,15 +9,8 @@
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
@if (isset($status_permohonan))
@foreach ($status_permohonan as $item)
<a href="" class="btn btn-xs btn-outline btn-primary"> {{ $item->name }} </a>
@endforeach
@endif
Daftar Penilaian
</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('permohonan.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
{{-- Daftar {{}} --}}
@@ -25,16 +18,19 @@
<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 Permohonan" id="search" type="text" value="">
<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>
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </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('permohonan.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">
@@ -93,99 +89,10 @@
</div>
@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="penilaian-table" data-api-url="{{ route('basicdata.penilaian.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar penilaian
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
<input placeholder="Search penilaian" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('basicdata.penilaian.export') }}"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.penilaian.create') }}"> Tambah penilaian </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Code </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection --}}
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript">
function deleteData(data) {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
$.ajax(`basic-data/penilaian/${data}`, {
type: 'DELETE'
}).then((response) => {
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
window.location.reload();
});
}).catch((error) => {
console.error('Error:', error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
});
}
})
}
</script>
<script type="module">
const element = document.querySelector('#permohonan-table');
const searchInput = document.getElementById('search');
@@ -242,8 +149,8 @@
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/penilaian/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="penilaian/${data.id}/edit">
<i class="ki-outline ki-eye"></i>
</a>
</div>`;
},