Merge branch 'staging' into feature/senior-officer

This commit is contained in:
majid
2025-01-30 21:44:06 +07:00
27 changed files with 1097 additions and 394 deletions

View File

@@ -0,0 +1,89 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
@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($customField->id))
<form action="{{ route('basicdata.custom-field.update', $customField->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $customField->id }}">
@method('PUT')
@else
<form method="POST" action="{{ route('basicdata.custom-field.store') }}">
@endif
@csrf
<div class="card border border-agi-100 pb-2.5">
<div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title">
{{ isset($customField->id) ? 'Edit' : 'Tambah' }} Custom Field
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.custom-field.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
</div>
</div>
<div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $customField->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Label
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('label') border-danger bg-danger-light @enderror" type="text" name="label" value="{{ $customField->label ?? '' }}">
@error('label')
<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">
Type
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input @error('type') border-danger bg-danger-light @enderror" name="type">
<option value="text" {{ (isset($customField->type) && $customField->type == 'text') ? 'selected' : '' }}>Text</option>
<option value="radio" {{ (isset($customField->type) && $customField->type == 'radio') ? 'selected' : '' }}>Radio</option>
<option value="number" {{ (isset($customField->type) && $customField->type == 'select') ? 'selected' : '' }}>Select</option>
<option value="option" {{ (isset($customField->type) && $customField->type == 'checkbox') ? 'selected' : '' }}>Checkbox</option>
</select>
@error('type')
<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">
Urutan Prioritas
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('urutan_prioritas') border-danger bg-danger-light @enderror" type="number" name="urutan_prioritas" value="{{ $customField->urutan_prioritas ?? $urutan_prioritas }}">
@error('urutan_prioritas')
<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.custom-field') }}
@endsection
@section('content')
<div class="grid">
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="custom-field-table" data-api-url="{{ route('basicdata.custom-field.datatables') }}">
<div class="card-header bg-agi-50 py-5 flex-wrap">
<h3 class="card-title">
Daftar Custom Field
</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 Custom Field" 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.custom-field.export') }}"> Export to Excel </a>
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.custom-field.create') }}"> Tambah Custom Field </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="name">
<span class="sort"> <span class="sort-label"> Custom Field </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="type">
<span class="sort"> <span class="sort-label"> Type </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="urutan_prioritas">
<span class="sort"> <span class="sort-label"> Urutan Prioritas </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 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/custom-field/${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('#custom-field-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();
},
},
label: {
title: 'Custom Field',
},
type: {
title: 'Type',
},
urutan_prioritas: {
title: 'Urutan Prioritas',
},
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/custom-field/${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

@@ -16,16 +16,16 @@
</p>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor Permohonan
</label>
<div class="flex flex-wrap items-baseline w-full">
<p class="text-base text-gray-700 font-bold">
{{ $permohonan->nomor_registrasi ?? "-" }}
</p>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor Permohonan
</label>
<div class="flex flex-wrap items-baseline w-full">
<p class="text-base text-gray-700 font-bold">
{{ $permohonan->nomor_registrasi ?? "-" }}
</p>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Pemilik Jaminan
@@ -314,38 +314,30 @@
</div>
@if($detail->details)
@if($detail->jenisLegalitasJaminan->custom_field)
@php $custom_field = json_decode($detail->details,true) @endphp
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" value="{{ $custom_field[$detail->jenisLegalitasJaminan->custom_field] ?? '' }}">
@if($detail->jenisLegalitasJaminan->custom_fields)
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ getCustomField($key)->label ?? "" }}
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" value="{{ json_decode($detail->details)->{getCustomField($key)->name} ?? '' }}">
</div>
</div>
</div>
@endforeach
@endif
@else
@if($detail->jenisLegalitasJaminan->custom_field)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
</label>
<div class="flex flex-wrap items-baseline w-full">
@if($detail->jenisLegalitasJaminan->custom_field_type === "text")
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "number")
<input class="input" type="number" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "date")
<input class="input" type="date" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "textarea")
<textarea class="textarea" rows="3" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2"></textarea>
@else
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@endif
@if($detail->jenisLegalitasJaminan->custom_fields)
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ getCustomField($key)->label }}
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" placeholder="...">
</div>
</div>
</div>
@endforeach
@endif
@endif
@@ -393,25 +385,17 @@
</div>
</div>
@if($item->custom_field)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ str_replace('_',' ',$item->custom_field) }}
</label>
<div class="flex flex-wrap items-baseline w-full">
@if($item->custom_field_type === "text")
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "number")
<input class="input" type="number" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "date")
<input class="input" type="date" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "textarea")
<textarea class="textarea" rows="3" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2"></textarea>
@else
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@endif
@if($item->custom_fields)
@foreach($item->custom_fields as $field)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ getCustomField($field)->label }}
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="custom_field[{{$item->id}}][{{getCustomField($field)->name}}]" placeholder="...">
</div>
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -437,13 +421,13 @@
@push('scripts')
{{--Pemilik Jaminan--}}
<script>
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
// Function to add delete event listeners to existing buttons
function addDeleteListeners() {
document.querySelectorAll(".delete-button").forEach(button => {
button.addEventListener("click", function() {
button.addEventListener("click", function () {
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
});
});
@@ -452,7 +436,7 @@
// Add delete listeners to existing buttons
addDeleteListeners();
document.getElementById("tambah_sertifikat").addEventListener("click", function() {
document.getElementById("tambah_sertifikat").addEventListener("click", function () {
const newDiv = document.createElement("div");
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
newDiv.innerHTML = `
@@ -547,16 +531,16 @@
</div>
</div>
${item.custom_field ? `
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
${item.custom_field.replace(/_/g, " ")}
${field.label}
</label>
<div class="flex flex-wrap items-baseline w-full">
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
${getCustomFieldInput(field.type, field.name, item.details, item.id)}
</div>
</div>
` : ""}
`).join('') : ""}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
@@ -637,19 +621,19 @@
return dokumenNomor;
}
function getCustomFieldInput(type, fieldName, value) {
function getCustomFieldInput(type, fieldName, value, itemId) {
value = value ? JSON.parse(value)[fieldName] || "" : "";
switch (type) {
case "text":
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
case "number":
return `<input class="input" type="number" name="custom_field[][${fieldName}]" value="${value}">`;
return `<input class="input" type="number" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
case "date":
return `<input class="input" type="date" name="custom_field[][${fieldName}]" value="${value}">`;
return `<input class="input" type="date" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
case "textarea":
return `<textarea class="textarea" rows="3" name="custom_field[][${fieldName}]">${value}</textarea>`;
return `<textarea class="textarea" rows="3" name="custom_field[${itemId}][${fieldName}]">${value}</textarea>`;
default:
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
}
}
</script>

View File

@@ -92,28 +92,28 @@
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis Legalitas Jaminan
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($jenisLegalitasJaminan as $row)
<label class="switch">
@if ( isset($jenisJaminan) && !empty(json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true)))
<input type="checkbox" @if (in_array($row->code, json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true))) {{ 'checked' }} @endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis Legalitas Jaminan
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach ($jenisLegalitasJaminan as $row)
<label class="switch">
@if ( isset($jenisJaminan) && !empty(json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true)))
<input type="checkbox" @if (in_array($row->code, json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true))) {{ 'checked' }} @endif
value="{{ $row->code }}" name="jenis_legalitas_jaminan_id[]" />
@else
<input type="checkbox" value="{{ $row->code }}"
name="jenis_legalitas_jaminan_id[]" />
@endif
<span class="switch-label">
@else
<input type="checkbox" value="{{ $row->code }}"
name="jenis_legalitas_jaminan_id[]" />
@endif
<span class="switch-label">
{{ $row->name }}
</span>
</label>
@endforeach
</label>
@endforeach
</div>
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save

View File

@@ -10,83 +10,107 @@
<form action="{{ route('basicdata.jenis-legalitas-jaminan.update', $jenisLegalitasJaminan->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisLegalitasJaminan->id }}">
@method('PUT')
@else
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
@endif
@csrf
<div class="card border border-agi-100 pb-2.5">
<div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title">
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-legalitas-jaminan.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($jenisLegalitasJaminan->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 bg-danger-light @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->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">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisLegalitasJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@else
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
@endif
@csrf
<div class="card border border-agi-100 pb-2.5">
<div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title">
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-legalitas-jaminan.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($jenisLegalitasJaminan->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 bg-danger-light @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->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">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $jenisLegalitasJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tambahkan inputan custom_field -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Custom Field
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('custom_field') border-danger bg-danger-light @enderror" type="text" name="custom_field" value="{{ $jenisLegalitasJaminan->custom_field ?? '' }}">
@error('custom_field')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tambahkan inputan custom_field -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Custom Field
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('custom_field') border-danger bg-danger-light @enderror" type="text" name="custom_field" value="{{ $jenisLegalitasJaminan->custom_field ?? '' }}">
@error('custom_field')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tambahkan inputan custom_field_type -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Custom Field Type
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('custom_field_type') border-danger bg-danger-light @enderror" name="custom_field_type">
<option value="">Pilih Tipe</option>
<option value="text" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'text') ? 'selected' : '' }}>Text</option>
<option value="number" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'number') ? 'selected' : '' }}>Number</option>
<option value="date" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'date') ? 'selected' : '' }}>Date</option>
</select>
@error('custom_field_type')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tambahkan inputan custom_field_type -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Custom Field Type
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('custom_field_type') border-danger bg-danger-light @enderror" name="custom_field_type">
<option value="">Pilih Tipe</option>
<option value="text" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'text') ? 'selected' : '' }}>Text</option>
<option value="number" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'number') ? 'selected' : '' }}>Number</option>
<option value="date" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'date') ? 'selected' : '' }}>Date</option>
</select>
@error('custom_field_type')
<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">
Custom Fields
</label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
@foreach($customFields as $customField)
<label class="switch">
@if ( isset($jenisLegalitasJaminan) && !empty($jenisLegalitasJaminan->custom_fields))
<input type="checkbox" @if (in_array($customField->id, $jenisLegalitasJaminan->custom_fields))
{{ 'checked' }}
@endif
value="{{ $customField->id }}" name="custom_fields[]"/>
@else
<input type="checkbox" value="{{ $customField->id }}"
name="custom_fields[]"/>
@endif
<span class="switch-label">
{{ $customField->urutan_prioritas.'. '.$customField->label }}
</span>
</label>
@endforeach
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div>
@endsection

View File

@@ -56,8 +56,8 @@
</head>
<body>
<div class="container">
Dear <span class="important">
<div class="container">
Dear <span class="important">
@php
$allPeople = [];
@@ -76,7 +76,7 @@
}
}
}
} catch (\Exception $e) {
} catch (Exception $e) {
// Handle invalid JSON silently
}
}
@@ -85,104 +85,100 @@
$allPeople = array_filter($allPeople);
$totalPeople = count($allPeople);
@endphp
@if ($totalPeople > 0)
@foreach ($allPeople as $index => $person)
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
@endforeach
@else
Tidak Ada
@endif
@if ($totalPeople > 0)
@foreach ($allPeople as $index => $person)
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
@endforeach
@else
Tidak Ada
@endif
</span>
<div class="content">
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
</div>
<div class="content">
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
</div>
<div class="content-max">
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->jenisJaminan->name }}
@endforeach
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->address }}, Kel. @foreach ($villages as $village)
{{ $village->name }}
@endforeach, Kec. @foreach ($districts as $district)
{{ $district->name }}
@endforeach,@foreach ($cities as $city)
{{ ucwords(strtolower($city->name)) }}
@endforeach,@foreach ($provinces as $province)
{{ $province->name }}
@endforeach
@endforeach
</span>
Luas Tanah / Luas Bangunan:
@php
$luas_tanah = null;
$luas_bangunan = null;
@endphp
@foreach ($permohonan->debiture->documents as $document)
@foreach ($document->detail as $detail)
@php
$details = json_decode($detail->details);
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@php
$luas_tanah = $details->{'luas_tanah'};
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@php
$luas_bangunan = $details->{'luas_bangunan'};
@endphp
@endif
@endif
<div class="content-max">
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->jenisJaminan->name }}
@endforeach
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->address }}, Kel. @foreach ($villages as $village)
{{ $village->name }}
@endforeach, Kec. @foreach ($districts as $district)
{{ $district->name }}
@endforeach,@foreach ($cities as $city)
{{ ucwords(strtolower($city->name)) }}
@endforeach,@foreach ($provinces as $province)
{{ $province->name }}
@endforeach
@endforeach
</span>
@if ($luas_tanah !== null && $luas_bangunan !== null)
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
@elseif ($luas_tanah !== null)
{{ $luas_tanah }} m<sup>2</sup>
@elseif ($luas_bangunan !== null)
{{ $luas_bangunan }} m<sup>2</sup>
@endif
</div>
Luas Tanah / Luas Bangunan:
@php
$luas_tanah = null;
$luas_bangunan = null;
@endphp
<div class="content">
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
Mohon proposal dapat saya terima segera, sebelum <span
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
</div>
@foreach ($permohonan->debiture->documents as $document)
@foreach ($document->detail as $detail)
@php
$details = json_decode($detail->details);
@endphp
<div class="signature">
Best Regards,<br />
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
alt="{{ $permohonan->user->name }}" width="200">
<p>
{{ $permohonan->user->name }}
</p>
</div>
@if (is_object($details))
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
)
@php
$luas_tanah = $details->luas_tanah;
@endphp
@endif
<div class="footer">
PT. Bank Artha Graha Internasional, Tbk.<br>
Gedung Bank Artha Graha, Lantai 3<br>
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
Telp. 021 - 3903040 (H)
</div>
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
)
@php
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif
@endforeach
@endforeach
@if ($luas_tanah !== null && $luas_bangunan !== null)
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
@elseif ($luas_tanah !== null)
{{ $luas_tanah }} m<sup>2</sup>
@elseif ($luas_bangunan !== null)
{{ $luas_bangunan }} m<sup>2</sup>
@endif
</div>
<div class="content">
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br/>
Mohon proposal dapat saya terima segera, sebelum <span
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
</div>
<div class="signature">
Best Regards,<br/>
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
alt="{{ $permohonan->user->name }}" width="200">
<p>
{{ $permohonan->user->name }}
</p>
</div>
<div class="footer">
PT. Bank Artha Graha Internasional, Tbk.<br>
Gedung Bank Artha Graha, Lantai 3<br>
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
Telp. 021 - 3903040 (H)
</div>
</div>
</body>
</html>

View File

@@ -133,21 +133,15 @@
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
@php
$luas_tanah = $details->{'luas_tanah'};
$luas_tanah = $details->luas_tanah;
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
@php
$luas_bangunan = $details->{'luas_bangunan'};
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif

View File

@@ -116,21 +116,15 @@
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@php
$luas_tanah = $details->{'luas_tanah'};
@endphp
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
@php
$luas_tanah = $details->luas_tanah;
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
@php
$luas_bangunan = $details->{'luas_bangunan'};
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif

View File

@@ -131,21 +131,15 @@
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
@php
$luas_tanah = $details->{'luas_tanah'};
$luas_tanah = $details->luas_tanah;
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
@php
$luas_bangunan = $details->{'luas_bangunan'};
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif

View File

@@ -13,7 +13,7 @@
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('tender.penawaran.downloadSuratTenderKJPP', ['noreg' => $noreg, 'id' => $id]) }}"
class="btn btn-xs btn-light">
class="btn btn-xs btn-light">
<img src="{{ asset('img/pdf.png') }}" width="25" alt="pdf" class="pdf"></img>Download
</a>
<a href="{{ route('tender.penawaran.showKirimEmail', $noreg) }}" class="btn btn-xs btn-info"><i
@@ -42,7 +42,7 @@
}
}
}
} catch (\Exception $e) {
} catch (Exception $e) {
// Handle invalid JSON silently
}
}
@@ -114,21 +114,17 @@
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
)
@php
$luas_tanah = $details->{'luas_tanah'};
$luas_tanah = $details->luas_tanah;
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
)
@php
$luas_bangunan = $details->{'luas_bangunan'};
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif
@@ -152,7 +148,7 @@
<p>Best Regards,
<div class="font-bold">
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
alt="{{ $permohonan->user->name }}" width="200" class="signature">
alt="{{ $permohonan->user->name }}" width="200" class="signature">
<p>
{{ $permohonan->user->name }}
</p>

View File

@@ -56,8 +56,8 @@
</head>
<body>
<div class="container">
Dear <span class="important">
<div class="container">
Dear <span class="important">
@php
$allPeople = [];
@@ -87,104 +87,100 @@
$allPeople = array_filter(array_unique($allPeople));
$totalPeople = count($allPeople);
@endphp
@if ($totalPeople > 0)
@foreach ($allPeople as $index => $person)
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
@endforeach
@else
Tidak Ada
@endif
@if ($totalPeople > 0)
@foreach ($allPeople as $index => $person)
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
@endforeach
@else
Tidak Ada
@endif
</span>
<div class="content">
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
</div>
<div class="content">
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
</div>
<div class="content-max">
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->jenisJaminan->name }}
@endforeach
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->address }}, Kel. @foreach ($villages as $village)
{{ $village->name }}
@endforeach, Kec. @foreach ($districts as $district)
{{ $district->name }}
@endforeach,@foreach ($cities as $city)
{{ ucwords(strtolower($city->name)) }}
@endforeach,@foreach ($provinces as $province)
{{ $province->name }}
@endforeach
@endforeach
</span>
Luas Tanah / Luas Bangunan:
@php
$luas_tanah = null;
$luas_bangunan = null;
@endphp
@foreach ($permohonan->debiture->documents as $document)
@foreach ($document->detail as $detail)
@php
$details = json_decode($detail->details);
@endphp
@if (is_object($details))
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
isset($details->{'luas_tanah'}) &&
is_numeric($details->{'luas_tanah'}))
@php
$luas_tanah = $details->{'luas_tanah'};
@endphp
@endif
@if (
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
isset($details->{'luas_bangunan'}) &&
is_numeric($details->{'luas_bangunan'}))
@php
$luas_bangunan = $details->{'luas_bangunan'};
@endphp
@endif
@endif
<div class="content-max">
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->jenisJaminan->name }}
@endforeach
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
{{ $document->address }}, Kel. @foreach ($villages as $village)
{{ $village->name }}
@endforeach, Kec. @foreach ($districts as $district)
{{ $district->name }}
@endforeach,@foreach ($cities as $city)
{{ ucwords(strtolower($city->name)) }}
@endforeach,@foreach ($provinces as $province)
{{ $province->name }}
@endforeach
@endforeach
</span>
@if ($luas_tanah !== null && $luas_bangunan !== null)
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
@elseif ($luas_tanah !== null)
{{ $luas_tanah }} m<sup>2</sup>
@elseif ($luas_bangunan !== null)
{{ $luas_bangunan }} m<sup>2</sup>
@endif
</div>
Luas Tanah / Luas Bangunan:
@php
$luas_tanah = null;
$luas_bangunan = null;
@endphp
<div class="content">
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
Mohon proposal dapat saya terima segera, sebelum <span
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
</div>
@foreach ($permohonan->debiture->documents as $document)
@foreach ($document->detail as $detail)
@php
$details = json_decode($detail->details);
@endphp
<div class="signature">
Best Regards,<br />
<img src="{{ public_path('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
alt="{{ $permohonan->user->name }}" width="200">
<p>
{{ $permohonan->user->name }}
</p>
</div>
@if (is_object($details))
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
)
@php
$luas_tanah = $details->luas_tanah;
@endphp
@endif
<div class="footer">
PT. Bank Artha Graha Internasional, Tbk.<br>
Gedung Bank Artha Graha, Lantai 3<br>
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
Telp. 021 - 3903040 (H)
</div>
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
)
@php
$luas_bangunan = $details->luas_bangunan;
@endphp
@endif
@endif
@endforeach
@endforeach
@if ($luas_tanah !== null && $luas_bangunan !== null)
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
@elseif ($luas_tanah !== null)
{{ $luas_tanah }} m<sup>2</sup>
@elseif ($luas_bangunan !== null)
{{ $luas_bangunan }} m<sup>2</sup>
@endif
</div>
<div class="content">
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br/>
Mohon proposal dapat saya terima segera, sebelum <span
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
</div>
<div class="signature">
Best Regards,<br/>
<img src="{{ public_path('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
alt="{{ $permohonan->user->name }}" width="200">
<p>
{{ $permohonan->user->name }}
</p>
</div>
<div class="footer">
PT. Bank Artha Graha Internasional, Tbk.<br>
Gedung Bank Artha Graha, Lantai 3<br>
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
Telp. 021 - 3903040 (H)
</div>
</div>
</body>
</html>