prerbaikan export dan penambahan role di team penilai

This commit is contained in:
majid
2024-09-13 17:02:04 +07:00
parent 0ae0374e5e
commit 53ccf7de11
15 changed files with 1107 additions and 388 deletions

View File

@@ -0,0 +1,511 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@push('styles')
<style>
.divider {
border: none;
height: 1px;
background-color: #ddd;
margin: 20px 0;
}
.h1 {
font-size: 16px;
font-weight: 600;
margin-bottom: 10px;
}
</style>
@endpush
@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">
Form Data 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>
Back</a>
</div>
</div>
<div class="card-body">
<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>
</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>
<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>
</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-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>
</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">
Assign
</button>
<button type="submit" class="btn btn-light">
Print From
</button>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@@ -1,128 +1,262 @@
@extends('layouts.main')
@section('breadcrumbs')
{{-- {{ Breadcrumbs::render('penilaian') }} --}}
{{ Breadcrumbs::render('basicdata.penilaian') }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($debitur->id) ? 'Edit' : 'Tambah' }} Debitur
</h3>
<div class="flex items-center gap-2">
@if (isset($debitur->id))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat
Permohonan </a>
<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
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
Back</a>
</div>
</div>
<div class=" card-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 {{}} --}}
</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 Permohonan" id="search" type="text" value="">
</label>
</div>
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="user_id">
<span class="sort"> <span class="sort-label"> User Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch_id">
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="status">
<span class="sort"> <span class="sort-label"> Status </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
{{-- @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">
<form action="" method="POST" class="grid gap-5">
{{-- @if (isset($debitur->id))
@method('PUT')
@endif
@csrf --}}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Cabang
</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="branch_id" id="branch_id">
<option value="">Pilih Cabang</option>
</select>
<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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
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="">
@error('cif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor Rekening
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nomor_rekening') border-danger bg-danger-light @enderror"
type="number" name="nomor_rekening" value=""
@error('nomor_rekening')
<em class="alert text-danger text-sm"></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 Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
name="name" value="">
@error('name')
<em class="alert text-danger text-sm"></em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
NPWP
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number"
name="npwp" value="{{ $debitur->npwp ?? '' }}">
@error('npwp')
<em class="alert text-danger text-sm"></em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Email
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email"
name="email" value="{{ $debitur->email ?? '' }}">
@error('email')
<em class="alert text-danger text-sm"></em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
No Handphone
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number"
name="phone" value="">
@error('phone')
<em class="alert text-danger text-sm"></em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@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');
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
tanggal_permohonan: {
title: 'Tanggal Permohonan'
},
user_id: {
title: 'User Pemohon',
render: (item, data) => {
return `${data.user.name}`;
},
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => {
return `${data.branch.name}`;
},
},
debitur_id: {
title: 'Debitur',
render: (item, data) => {
return `${data.debiture.name}`;
},
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => {
return `${data.tujuan_penilaian.name}`;
},
},
status: {
title: 'Status'
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/penilaian/${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