Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -46,14 +46,14 @@
|
||||
@php
|
||||
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
return $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
|
||||
return $item->team->penilaianTeam
|
||||
->filter(function ($penilaianTeam) use ($item) {
|
||||
return $penilaianTeam->user_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
|
||||
@endphp
|
||||
|
||||
@foreach ($sortedTeamsActivity as $index => $item)
|
||||
@@ -70,11 +70,9 @@
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
@php
|
||||
$totalTasks = $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
$totalTasks = $item->team->penilaianTeam
|
||||
->filter(function ($penilaianTeam) use ($item) {
|
||||
return $penilaianTeam->user_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
@endphp
|
||||
@@ -156,8 +154,6 @@
|
||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||
'data-api-url');
|
||||
|
||||
console.log("This is the API URL: " + apiUrl);
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
@@ -180,7 +176,7 @@
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) => `${data.jenis_asset || ''}`,
|
||||
render: (item, data) => `${data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
|
||||
@@ -69,16 +69,28 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
<td class="py-3 max-w-[100px] align-top" >
|
||||
Dokumen Jaminan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download',['id'=>$permohonan->debiture->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2 badge-info"><i class="ki-filled ki-cloud-download mr-2"></i> Download</a>
|
||||
) @endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($detail->dokumen_jaminan) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
<br>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -132,41 +132,57 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($document->id))
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nama Dokumen">
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
@if(isset($document->id))
|
||||
@php $n = 0; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[]" value="">
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<a href="{{ route('debitur.jaminan.download',['id'=>$debitur->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
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@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">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@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) }}
|
||||
@@ -175,21 +191,103 @@
|
||||
<input class="input" type="text" name="custom_field[][$detail->jenisLegalitasJaminan->custom_field]" value="{{ $custom_field[$detail->jenisLegalitasJaminan->custom_field] }}">
|
||||
</div>
|
||||
</div>
|
||||
@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
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]">{{ $detail->keterangan ?? "" }}</textarea>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]">{{ $detail->keterangan ?? "" }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
@foreach($legalitas as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $item->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $item->id }}">
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
</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
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -311,13 +409,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();
|
||||
});
|
||||
});
|
||||
@@ -326,7 +424,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 = `
|
||||
@@ -367,11 +465,14 @@
|
||||
<script>
|
||||
function getLegalitasJaminan() {
|
||||
var legalitasJaminan = document.getElementById("jenis_jaminan_id").value;
|
||||
var url = "/basic-data/jenis-jaminan/legalitas/" + legalitasJaminan;
|
||||
var documentId = "{{ $document->id ?? "0" }}";
|
||||
var debiturId = "{{ $debitur->id }}";
|
||||
var url = `/basic-data/jenis-jaminan/legalitas/${documentId}/${legalitasJaminan}`;
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
@@ -385,66 +486,128 @@
|
||||
doctainer.innerHTML = "";
|
||||
data.forEach((item, index) => {
|
||||
doctainer.innerHTML += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
${index + 1}. ${item.name}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.id}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nama Dokumen">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
${index + 1}. ${item.name}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}">
|
||||
${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[]" value="">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="name[]" value="${item.name || ''}" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${item.custom_field && item.custom_field.length > 0 ? `
|
||||
<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, " ")}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${item.custom_field_type === "text" ? `
|
||||
<input class="input" type="text" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "number" ? `
|
||||
<input class="input" type="number" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "date" ? `
|
||||
<input class="input" type="date" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "textarea" ? `
|
||||
<textarea class="textarea" rows="3" name="custom_field[][${item.custom_field}]"></textarea>
|
||||
` : `
|
||||
<input class="input" type="text" name="custom_field[][${item.custom_field}]">
|
||||
`}
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
|
||||
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id) : ''}
|
||||
<div class="flex items-center gap-2 my-2 w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[${index}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput(${index})">Add File</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
` : ""}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
${item.custom_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, " ")}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
` : ''}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error);
|
||||
// Handle the error here
|
||||
});
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId) {
|
||||
if (typeof dokumenJaminan === 'string') {
|
||||
return `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${dokumenJaminan.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`;
|
||||
} else if (Array.isArray(dokumenJaminan)) {
|
||||
return dokumenJaminan.map(file => `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${encodeURIComponent(file)}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`).join('');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function addFileInput(index) {
|
||||
const container = document.getElementById(`file-container-${index}`);
|
||||
const newInput = document.createElement('div');
|
||||
newInput.className = 'flex items-center gap-2 mb-2 w-full';
|
||||
newInput.innerHTML = `
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[${index}][]" multiple>
|
||||
<button type="button" class="btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
`;
|
||||
container.appendChild(newInput);
|
||||
}
|
||||
|
||||
function removeFileInput(button) {
|
||||
button.closest('.flex.items-center.gap-2.mb-2').remove();
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId) {
|
||||
if (typeof dokumenJaminan === 'string') {
|
||||
return `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="badge badge-sm badge-outline mt-2">
|
||||
${dokumenJaminan.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`;
|
||||
} else if (Array.isArray(dokumenJaminan)) {
|
||||
return dokumenJaminan.map(file => `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`).join('');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function getCustomFieldInput(type, fieldName, value) {
|
||||
value = value ? JSON.parse(value)[fieldName] || '' : '';
|
||||
switch (type) {
|
||||
case "text":
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "number":
|
||||
return `<input class="input" type="number" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "date":
|
||||
return `<input class="input" type="date" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "textarea":
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[][${fieldName}]">${value}</textarea>`;
|
||||
default:
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -183,15 +183,14 @@
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang Dilakukan oleh
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="jenis_penilaian_id"
|
||||
value="{{ $jenisPenilaian->id }}">
|
||||
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $jenisPenilaian->name }}"
|
||||
readonly>
|
||||
type="text" value="{{ $jenisPenilaian->name }}" readonly>
|
||||
@error('jenis_penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -203,9 +202,7 @@
|
||||
Tim Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="teams_id" value="{{ $regionName->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id }}">
|
||||
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $regionName->name }}" readonly>
|
||||
@error('teams_id')
|
||||
@@ -214,62 +211,217 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
{{-- @php
|
||||
var_dump($penilaianTeam);
|
||||
@endphp --}}
|
||||
|
||||
<div
|
||||
class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 {{ $penilaianTeam->isEmpty() ? '' : 'hidden' }}">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
Pilih Surveyor dan Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_selection" name="surveyor_selection"
|
||||
class="tomselect input @error('surveyor_selection') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
<option value="penilai_dan_surveyor">Penilai dan Surveyor Sama</option>
|
||||
<option value="berbeda">Berbeda</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@error('surveyor_id')
|
||||
@error('surveyor_selection')
|
||||
<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">
|
||||
<select id="penilaian_id" name="penilaian_id"
|
||||
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<div id="same_surveyor_penilai" class="hidden">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<div id="different_surveyor_penilai" class="{{ $penilaianTeam->isNotEmpty() ? '' : 'hidden' }}">
|
||||
<div class="grid gap-2.5">
|
||||
|
||||
@if (
|
||||
$penilaianTeam->isNotEmpty() &&
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'surveyor' && is_null($item->user_id))
|
||||
)
|
||||
<div id="surveyorId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
<div id="surveyorId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div id="surveyorRegion" class="hidden items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pilih Region
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_region_id" name="surveyor_region_id"
|
||||
class="tomselect input @error('surveyor_region_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Region</option>
|
||||
|
||||
@if (isset($updateTeamPenilai))
|
||||
@foreach ($updateTeamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">
|
||||
{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_region_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (
|
||||
$penilaianTeam->isNotEmpty() &&
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'penilai' && is_null($item->user_id))
|
||||
)
|
||||
|
||||
<div id="penilaiId" 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">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_id" name="penilai_id"
|
||||
class="input tomselect @error('penilai_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
<div id="penilaiId" 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">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_id" name="penilai_id"
|
||||
class="input tomselect @error('penilai_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div id="penilaiRegion" class="hidden items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pilih Region
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_region_id" name="penilai_region_id"
|
||||
class="tomselect input @error('penilai_region_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Region</option>
|
||||
|
||||
@if (isset($updateTeamPenilai))
|
||||
@foreach ($updateTeamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">
|
||||
{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_region_id')
|
||||
<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">
|
||||
<label class="form-label max-w-56">
|
||||
Jadwal Kunjungan
|
||||
@@ -307,16 +459,9 @@
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -376,8 +521,57 @@
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
document.getElementById('surveyor_selection').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const sameSurveyorPenilai = document.getElementById('same_surveyor_penilai');
|
||||
const differentSurveyorPenilai = document.getElementById('different_surveyor_penilai');
|
||||
|
||||
if (selectedValue === 'penilai_dan_surveyor') {
|
||||
sameSurveyorPenilai.classList.remove('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
} else if (selectedValue === 'berbeda') {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.remove('hidden');
|
||||
|
||||
} else {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('surveyor_id').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const surveyorRegion = document.getElementById('surveyorRegion');
|
||||
|
||||
if (selectedValue === 'pilih_dari_region') {
|
||||
surveyorRegion.classList.remove('hidden');
|
||||
surveyorRegion.classList.add('flex');
|
||||
} else {
|
||||
surveyorRegion.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('penilai_id').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const penilaiRegion = document.getElementById('penilaiRegion');
|
||||
|
||||
if (selectedValue === 'pilih_dari_region') {
|
||||
penilaiRegion.classList.remove('hidden');
|
||||
penilaiRegion.classList.add('flex');
|
||||
} else {
|
||||
penilaiRegion.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const revisiForm = document.getElementById('revisiForm');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('penilaian') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('otorisator.'. strtolower($header)) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -57,10 +57,7 @@
|
||||
<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>
|
||||
@@ -86,10 +83,48 @@
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
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!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`permohonan/${data}`, {
|
||||
type: 'POST'
|
||||
}).then((response) => {
|
||||
swal.fire('eddited!', 'Pelaporan has been edited.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while 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,
|
||||
@@ -135,9 +170,6 @@
|
||||
return `${data.tujuan_penilaian.name}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status'
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<form id="approveForm" action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@csrf
|
||||
<div class="card-body lg:py-7.5">
|
||||
@@ -160,14 +160,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer flex justify-end">
|
||||
<button type="submit" name="status" value="preregister" class="btn btn-success">
|
||||
<button onclick="return otorisator()" type="button" name="status" value="preregister" class="btn btn-success">
|
||||
Approve
|
||||
</button>
|
||||
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
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!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
document.getElementById('approveForm').submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($permohonan->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $permohonan->id }}">
|
||||
@endif
|
||||
@csrf
|
||||
|
||||
@@ -52,19 +53,14 @@
|
||||
Tujuan Penilaian
|
||||
</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">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -83,19 +79,14 @@
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -107,22 +98,17 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Flafond</option>
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -135,10 +121,10 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="sudah_bayar" ? 'selected' : '' }} value="sudah_bayar">Sudah Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="belum_bayar" ? 'selected' : '' }} value="belum_bayar">Belum Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -149,12 +135,16 @@
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($permohonan->status=='revisi')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
Catatan : <br>
|
||||
@@ -211,19 +201,14 @@
|
||||
Tujuan Penilaian
|
||||
</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">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -242,19 +227,14 @@
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -266,22 +246,17 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Flafond</option>
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -294,10 +269,10 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar">Sudah Bayar</option>
|
||||
<option value="belum_bayar">Belum Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -308,41 +283,16 @@
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<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 Permohonan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status') border-danger bg-danger-light @enderror" name="status" id="status">
|
||||
<option value="">Pilih Status Permohonan</option>
|
||||
@if(isset($status))
|
||||
@foreach($status as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->slug }}" {{ isset($permohonan->status) && $permohonan->status == $row->slug ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->slug }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
<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="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Penawaran </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="debiture">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="start_date">
|
||||
@@ -132,8 +132,16 @@
|
||||
'nomor_registrasi': {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
code: {
|
||||
title: 'Kode Penawaran',
|
||||
debiture: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan) {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
start_date: {
|
||||
title: 'Tanggal Penawaran',
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::prosespenawaran.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
@include('lpj::prosespenawaran.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
$(document).ready(function() {
|
||||
prepareForm();
|
||||
});
|
||||
|
||||
function prepareForm()
|
||||
|
||||
function prepareForm()
|
||||
{
|
||||
setData();
|
||||
}
|
||||
|
||||
function setData()
|
||||
{
|
||||
function setData()
|
||||
{
|
||||
let id = $("#id").val();
|
||||
let token = "{{ csrf_token() }}";
|
||||
// alert('token = ' + token);
|
||||
@@ -33,7 +33,7 @@
|
||||
// }
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if ('success' == response.status)
|
||||
{
|
||||
$("#textReg").text(response.penawaran.nomor_registrasi);
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
function setTablesKJPP1(datas)
|
||||
{
|
||||
let i=1;
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
@@ -72,7 +72,7 @@
|
||||
markup +='<td valign="top"><div class="input-group"><span class="inputku btn btn-input" id="{{$route[1]}}_rp_'+value.id+'">Rp.</span><input type="text" disabled="" style="text-align: right;" onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" class="inputku input" id="{{$route[1]}}_biayaPenawaran_'+value.id+'" name="{{$route[1]}}_biayaPenawaran_'+value.id+'"></div><em id="{{$route[1]}}_biayaPenawaran_msg_'+value.id+'" class="alert text-danger text-sm"></em></td>';
|
||||
markup +='<td><input type="file" disabled="" class="inputku file-input" id="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" name="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" accept="application/pdf" /><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td><div class="flex flex-nowrap justify-center">';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-notepad-edit"></i></a>';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-bookmark"></i></a>';
|
||||
markup +='<a disabled="" class="delete btn btn-sm btn-icon btn-clear btn-danger" id="{{$route[1]}}_icon_delete_'+value.id+'" onclick="deleteData('+value.id+',\''+kjppName+'\')" title="Hapus Proses Penawaran '+kjppName+'"><i class="ki-outline ki-trash"></i></a>';
|
||||
markup +='<label class="switch"><input name="{{$route[1]}}_check_'+value.id+'" id="{{$route[1]}}_check_'+value.id+'" onclick="switchProses('+value.id+')" type="checkbox" value="0"/><span class="switch-label">Proses</span></label></div></td>';
|
||||
markup += '</tr>';
|
||||
@@ -107,11 +107,11 @@
|
||||
// updateAll penawaran & permohonan status
|
||||
$("#{{$route[1]}}_toEdit").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateAll',$id) }}";
|
||||
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = "{{ $id }}";
|
||||
@@ -122,15 +122,15 @@
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if ('success' == response.status)
|
||||
{
|
||||
// toastr.success(response.message);
|
||||
// success
|
||||
var message = response.message;
|
||||
toastrku("success", message);
|
||||
setTimeout(function () {
|
||||
var url = "{{ route('tender.prosespenawaran.index') }}";
|
||||
setTimeout(function () {
|
||||
var url = "{{ route('tender.prosespenawaran.index') }}";
|
||||
$(location).attr('href',url);
|
||||
}, 2000);
|
||||
|
||||
@@ -147,8 +147,8 @@
|
||||
console.log(response);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::prosespenawaranulang.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
@include('lpj::prosespenawaranulang.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
$(document).ready(function() {
|
||||
prepareForm();
|
||||
});
|
||||
|
||||
function prepareForm()
|
||||
|
||||
function prepareForm()
|
||||
{
|
||||
setData();
|
||||
}
|
||||
|
||||
function setData()
|
||||
{
|
||||
function setData()
|
||||
{
|
||||
let id = $("#id").val();
|
||||
let token = "{{ csrf_token() }}";
|
||||
// alert('token = ' + token);
|
||||
@@ -49,7 +49,7 @@
|
||||
var message = response.message;
|
||||
toastrku("error", message);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr) {
|
||||
},
|
||||
@@ -57,10 +57,10 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setTablesKJPP1(datas)
|
||||
{
|
||||
let i=1;
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
@@ -77,7 +77,7 @@
|
||||
markup +='<td valign="top"><div class="input-group"><span class="inputku btn btn-input" id="{{$route[1]}}_rp_'+value.id+'">Rp.</span><input type="text" disabled="" style="text-align: right;" onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" class="inputku input" id="{{$route[1]}}_biayaPenawaran_'+value.id+'" name="{{$route[1]}}_biayaPenawaran_'+value.id+'"></div><em id="{{$route[1]}}_biayaPenawaran_msg_'+value.id+'" class="alert text-danger text-sm"></em></td>';
|
||||
markup +='<td><input type="file" disabled="" class="inputku file-input" id="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" name="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" accept="application/pdf" /><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td><div class="flex flex-nowrap justify-center">';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-notepad-edit"></i></a>';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-bookmark"></i></a>';
|
||||
markup +='<a disabled="" class="delete btn btn-sm btn-icon btn-clear btn-danger" id="{{$route[1]}}_icon_delete_'+value.id+'" onclick="deleteData('+value.id+',\''+kjppName+'\')" title="Hapus Proses Penawaran '+kjppName+'"><i class="ki-outline ki-trash"></i></a>';
|
||||
markup +='<label class="switch"><input name="{{$route[1]}}_check_'+value.id+'" id="{{$route[1]}}_check_'+value.id+'" onclick="switchProses('+value.id+')" type="checkbox" value="0"/><span class="switch-label">Proses</span></label></div></td>';
|
||||
markup += '</tr>';
|
||||
@@ -92,7 +92,7 @@
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).on("input", "input:file", function(e) {
|
||||
let fileName = e.target.files[0].name;
|
||||
let inputFile = e.target.id;
|
||||
@@ -109,4 +109,4 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
||||
@@ -81,6 +81,15 @@
|
||||
<option></option>
|
||||
</select>
|
||||
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_catatan2" 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]}}_catatan2" id="{{$route[0]}}_catatan2" placeholder="Catatan..." rows="6"></textarea>
|
||||
<em id="{{$route[0]}}_catatan2_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").show();
|
||||
$("#{{ $route[0] }}_div_catatan").hide();
|
||||
$("#{{ $route[0] }}_div_region").hide();
|
||||
$("#{{ $route[0] }}_div_catatan2").show();
|
||||
// prepare data
|
||||
setData();
|
||||
}
|
||||
@@ -94,12 +95,14 @@
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").show();
|
||||
$("#{{ $route[0] }}_catatan").val('');
|
||||
$("#{{ $route[0] }}_div_catatan").hide();
|
||||
$("#{{ $route[0] }}_div_catatan2").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
|
||||
$("#{{ $route[0] }}_div_catatan").show();
|
||||
$("#{{ $route[0] }}_div_catatan2").hide();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -115,6 +118,7 @@
|
||||
let jenis_penilaian = $("#{{$route[0]}}_jenis_penilaian").val();
|
||||
let region = $("#{{$route[0]}}_region").val();
|
||||
let catatan = $("#{{$route[0]}}_catatan").val();
|
||||
let catatan2 = $("#{{$route[0]}}_catatan2").val();
|
||||
|
||||
if(jenis_penilaian==0)
|
||||
jenis_penilaian='';
|
||||
@@ -129,6 +133,7 @@
|
||||
input_data.jenis_penilaian= jenis_penilaian;
|
||||
input_data.region= region;
|
||||
input_data.catatan = catatan;
|
||||
input_data.catatan2 = catatan2;
|
||||
|
||||
let useURL= '{{ route($route[0].'.update', $id) }}';
|
||||
$.ajax({
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<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">
|
||||
<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>
|
||||
@@ -208,6 +208,15 @@
|
||||
<option></option>
|
||||
</select>
|
||||
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div><br />
|
||||
<div id="{{ $route[0] }}_div_catatan2" 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]}}_catatan2" id="{{$route[0]}}_catatan2" placeholder="Catatan..." rows="6"></textarea>
|
||||
<em id="{{$route[0]}}_catatan2_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-5">
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<em id="" class="alert text-danger text-sm"></em>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a href="javascript:void(0)" class="badge badge-sm badge-outline">SPK_Dokumen.pdf <i class="ki-filled ki-cloud-download"></i></a></div>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a download id="pdfSPK" class="badge badge-sm badge-outline" target="_blank">Dokumen SPK.pdf <i class="ki-filled ki-cloud-download"></i></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
@@ -133,10 +133,10 @@
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a onclick="showRegistrasiFinal(${data.id})" class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail">
|
||||
<a onclick="showRegistrasiFinal(${data.permohonan.id})" class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" href="registrasifinal/${data.id}/edit">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" href="registrasifinal/${data.permohonan.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
$("#textCodePenawaran").text(response.penawaran.code);
|
||||
$("#textStatusPenawaran").text(response.penawaran.status);
|
||||
setRegionList(response.regions,0);
|
||||
// alert(response.datas.dokumen);
|
||||
$("#pdfSPK").attr("href", response.datas.dokumen);
|
||||
|
||||
// success
|
||||
// var message = response.message;
|
||||
|
||||
@@ -45,10 +45,9 @@
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
{{ $permohonan->tujuanPenilaian->name }} {!! $permohonan->dokumen !!}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
182
resources/views/spk/documentSPK.blade.php
Normal file
182
resources/views/spk/documentSPK.blade.php
Normal file
File diff suppressed because one or more lines are too long
185
resources/views/spk/dokumennya.blade.php
Normal file
185
resources/views/spk/dokumennya.blade.php
Normal file
File diff suppressed because one or more lines are too long
211
resources/views/spk/edit.blade.php
Normal file
211
resources/views/spk/edit.blade.php
Normal file
File diff suppressed because one or more lines are too long
@@ -1,27 +1,26 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.tujuan-penilaian') }}
|
||||
{{ Breadcrumbs::render('spk') }}
|
||||
@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-table" data-api-url="{{ route('basicdata.tujuan-penilaian.datatables') }}">
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="spk-table" data-api-url="{{ route('spk.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
SPK Menu
|
||||
Daftar SPK
|
||||
</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 Doc SPK" id="search" type="text" value="">
|
||||
<input placeholder="Search SPK" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<!-- <div class="flex flex-wrap gap-2.5">
|
||||
<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.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.tujuan-penilaian.create') }}"> Tambah Tujuan Penilaian </a>
|
||||
</div> -->
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -32,12 +31,28 @@
|
||||
<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"> No SPK </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Perihal </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="start_date">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_kjpp_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="nama_kjpp_sebelumnya">
|
||||
<span class="sort"> <span class="sort-label">KJPP Data</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>
|
||||
@@ -62,87 +77,131 @@
|
||||
@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() }}'
|
||||
}
|
||||
});
|
||||
<script type="text/javascript">
|
||||
function spkShow(regId)
|
||||
{
|
||||
var url = "{{ url('show') }}/"+regId;
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
$.ajax(`basic-data/tujuan-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('#tujuan-penilaian-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
function spkCreate(regId)
|
||||
{
|
||||
var url1 = "/spk/"+regId+"/edit";
|
||||
var url = "{{ url('/') }}"+url1;
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
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();
|
||||
},
|
||||
function formatTanggalIndonesia(dateString) {
|
||||
const date = new Date(dateString);
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const monthNames = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'];
|
||||
const month = monthNames[date.getMonth()];
|
||||
const year = date.getFullYear();
|
||||
return `${day} ${month} ${year}`;
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#spk-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: 'Tujuan Penilaian',
|
||||
},
|
||||
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/${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>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
'nomor_registrasi': {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
code: {
|
||||
title: 'Kode Penawaran',
|
||||
render: (item, data) => {
|
||||
if(data.penawaran) {
|
||||
return `${data.penawaran.code}`;
|
||||
}
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
date_range: {
|
||||
title: 'Tanggal Penawaran',
|
||||
render: (item, data) => {
|
||||
const startDate = formatTanggalIndonesia(data.penawaran.start_date);
|
||||
const endDate = formatTanggalIndonesia(data.penawaran.end_date);
|
||||
return `${startDate} - ${endDate}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_kjpp_name: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
if(data.penawaran.tujuan_penilaian_kjpp) {
|
||||
return `${data.penawaran.tujuan_penilaian_kjpp.name}`;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
nama_kjpp_sebelumnya: {
|
||||
title: 'Nama KJPP Terpilih',
|
||||
render: (item, data) => {
|
||||
return `${data.penawaran.nama_kjpp_sebelumnya}`+'<br />'
|
||||
+`${data.penawaran.biaya_kjpp_sebelumnya}`+'<br /> '
|
||||
+`${data.penawaran.tanggal_penilaian_sebelumnya}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `${data.penawaran.status}`.toUpperCase();
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
var spkShow ='';
|
||||
var spkCreate='';
|
||||
if(!data.dokumen)
|
||||
{
|
||||
spkCreate=`<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" onclick="spkCreate(${data.penawaran.id})" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
}
|
||||
else
|
||||
{
|
||||
spkShow =`<div class="flex flex-nowrap justify-center">
|
||||
<a href="/spk/${data.id}/download" class="btn btn-sm btn-icon btn-clear btn-primary" title="Download SPK">
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a> `;
|
||||
spkCreate=`<a class="btn btn-sm btn-icon btn-clear btn-info" title="Buat SPK" onclick="spkCreate(${data.penawaran.id})" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">`
|
||||
+spkShow+spkCreate+
|
||||
`</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
|
||||
|
||||
|
||||
39
resources/views/spk/js/editjs.blade.php
Normal file
39
resources/views/spk/js/editjs.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
<script type="text/javascript">
|
||||
function buildSPKPDF(penawaran_id) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "Yakin Generate SPK ke PDF?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`spk/${penawaran_id}`, {
|
||||
type: 'PUT'
|
||||
}).then((response) => {
|
||||
// alert('ok Sukses');
|
||||
swal.fire('Success!', 'File SPK berhasil di generate.', 'success').then(() => {
|
||||
// window.location.reload();
|
||||
});
|
||||
$('#download-button').removeAttr('disabled');
|
||||
$("#download-button").attr("href", response.spkpenawaran_path);
|
||||
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while generate the PDF file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Nomor Lambung', 'index' => 0],
|
||||
['label' => 'Model Unit', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Merk', 'index' => 3],
|
||||
['label' => 'Negara Pembuat', 'index' => 4],
|
||||
['label' => 'Tahun Pembelian', 'index' => 5],
|
||||
['label' => 'Nomor Faktur/Invoice', 'index' => 6],
|
||||
['label' => 'Nomor Kontrak Pembelian', 'index' => 7],
|
||||
['label' => 'Nama Pemilik', 'index' => 8],
|
||||
['label' => 'Alamaat Pemilik', 'index' => 9],
|
||||
['label' => 'Nomor Asuransi', 'index' => 10],
|
||||
['label' => 'Nomor Rangka', 'index' => 11],
|
||||
['label' => 'Nomor Mesin', 'index' => 12],
|
||||
['label' => 'Hour Mesin', 'index' => 13],
|
||||
['label' => 'Overhaul Mesin', 'index' => 14],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Kondisi Objek Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$kondisiObjeck = [];
|
||||
|
||||
$kondisiObjeck = [
|
||||
['label' => 'Mesin dan Panel Instrument', 'index' => 0],
|
||||
['label' => 'Fungsi mesin dan panel instrument', 'index' => 1],
|
||||
['label' => 'Interior (jok, dll)', 'index' => 2],
|
||||
['label' => 'Rangka dan Karoseri', 'index' => 3],
|
||||
['label' => 'Ban', 'index' => 4],
|
||||
['label' => 'Velg', 'index' => 5],
|
||||
['label' => 'Air Conditioner', 'index' => 6],
|
||||
['label' => 'Aksesoris Tambahan lainnya', 'index' => 7],
|
||||
['label' => 'LCD', 'index' => 8],
|
||||
['label' => 'Perlengkapan Keamanan', 'index' => 9],
|
||||
['label' => 'Asuransi', 'index' => 10],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($kondisiObjeck) > 0)
|
||||
@foreach ($kondisiObjeck as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -104,8 +104,8 @@
|
||||
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
|
||||
name="lantai">
|
||||
<option value="">Select Lantai</option>
|
||||
@if (isset($posisiKavling))
|
||||
@foreach ($posisiKavling as $item)
|
||||
@if (isset($lantai))
|
||||
@foreach ($lantai as $item)
|
||||
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -126,8 +126,8 @@
|
||||
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
|
||||
name="view">
|
||||
<option value="">Select View</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($viewUnit))
|
||||
@foreach ($viewUnit as $item)
|
||||
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -146,8 +146,8 @@
|
||||
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_unit">
|
||||
<option value="">Select Bentuk Unit</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($bentukTanah))
|
||||
@foreach ($bentukTanah as $item)
|
||||
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
232
resources/views/surveyor/components/bangunan.blade.php
Normal file
232
resources/views/surveyor/components/bangunan.blade.php
Normal file
@@ -0,0 +1,232 @@
|
||||
|
||||
{{-- @if ($analisaType == 'tanah_bangunan') --}}
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="y-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Bangunan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah_bagunan" value="sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah_bagunan" value="tidak sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('luas_tanah_bagunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Jenis Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('jenis_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="jenis_bangunan">
|
||||
<option value="">Select Jenis Bangunan</option>
|
||||
@if (isset($jenisBangunan))
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('jenis_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Kondisi Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisi_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="kondisi_bangunan">
|
||||
<option value="">Select Kondisi Bangunan</option>
|
||||
@if (isset($kondisiBangunan))
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisi_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sifat Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56"> Sifat Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('sifat_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="sifat_bangunan">
|
||||
<option value="">Select Sifat Bangunan</option>
|
||||
@if (isset($sifatBangunan))
|
||||
@foreach ($sifatBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sifat_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spek Bangunan -->
|
||||
<div class="gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Spek Bangunan</label>
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full" id="spek-bangunan-container">
|
||||
<div class="spek-bangunan w-full gap-4">
|
||||
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
||||
@if (@isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
<div>
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('name') border-danger bg-danger-light @enderror"
|
||||
name="name[]">
|
||||
<option value="">Select {{ $item->name }}</option>
|
||||
@foreach ($spekBangunan as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<option value="{{ $spek->name }}"
|
||||
{{ old('name') == $spek->name ? 'selected' : '' }}>
|
||||
{{ $spek->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
class="mt-2 btn btn-danger btn-outline btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah bangunan
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Sarana pelengkap -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Sarana pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('sarana_pelengkap') border-danger bg-danger-light @enderror"
|
||||
name="sarana_pelengkap">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- @endif --}}
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const spekBangunanContainer = document.getElementById('spek-bangunan-container');
|
||||
|
||||
function updateDeleteButtonsVisibility() {
|
||||
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
|
||||
// Only show the delete buttons if there are more than one form
|
||||
allDeleteButtons.forEach(button => {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
button.style.display = 'inline-block';
|
||||
} else {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('addBagunan').addEventListener('click', function() {
|
||||
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
|
||||
|
||||
// Clear the selected values of the cloned input fields
|
||||
newDiv.querySelectorAll('select').forEach(select => {
|
||||
select.value = '';
|
||||
});
|
||||
|
||||
// Append the cloned div to the container
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
|
||||
// Add event listener to the delete button in the cloned div
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
spekBangunanContainer.removeChild(newDiv);
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Update delete buttons visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Initial delete button visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
|
||||
// Add delete functionality to the initial form
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const spekBangunan = this.closest('.spek-bangunan');
|
||||
|
||||
// Make sure not to delete the last remaining form
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
spekBangunan.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -5,6 +5,7 @@
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card min-w-full">
|
||||
<div class="card min-w-full">
|
||||
@@ -120,7 +121,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
|
||||
@@ -167,6 +167,8 @@
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
|
||||
@@ -177,25 +179,33 @@
|
||||
|
||||
@if (isset($fotoJaminan))
|
||||
@foreach ($fotoJaminan->ruteJaminan as $item)
|
||||
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<div id="inputContainerRute" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@error('foto_rute.*')
|
||||
<span class="alert text-danger text-sm">{{ $message }}</span>
|
||||
@@ -211,9 +221,17 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -231,7 +249,7 @@
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
|
||||
</div>
|
||||
@php
|
||||
@@ -267,9 +285,16 @@
|
||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||
style="width: 12rem;">
|
||||
@endif
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<textarea name="name_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]) ? str_replace($view['label'] . ': ', '', $fotoJaminan->objekJaminan[$view['index']]->name_objek) : '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -289,7 +314,7 @@
|
||||
|
||||
|
||||
<div class="flex flex-wrap gap-4 w-full">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<label class="form-label">
|
||||
<span class="form-label">Lantai</span>
|
||||
</label>
|
||||
@@ -336,10 +361,16 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -377,10 +408,16 @@
|
||||
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -401,9 +438,18 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -436,8 +482,16 @@
|
||||
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -459,11 +513,266 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal Kamera -->
|
||||
|
||||
<div class="modal fade" data-modal="true" id="cameraModal" data-backdrop="" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Ambil Foto</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true" id="closeModal">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Camera Interface -->
|
||||
<div class="modal-body">
|
||||
<div class="camera-container relative">
|
||||
<video id="video" class="w-full h-auto" autoplay playsinline></video>
|
||||
<canvas id="canvas" class="hidden w-full h-auto"></canvas>
|
||||
<canvas id="drawingCanvas" class="hidden absolute top-0 left-0 w-full h-full"></canvas>
|
||||
<div id="textOverlay" class="position-absolute top-0 left-0 w-100 h-100 pointer-events-none">
|
||||
<!-- Text elements will be added here dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer mt-2">
|
||||
<div id="cameraControls" class="flex justify-center gap-2 mt-4">
|
||||
<button id="startButton" class="btn btn-primary">
|
||||
<i class="ki-outline ki-camera"></i> Start Camera
|
||||
</button>
|
||||
<button id="takePhotoButton" class="btn btn-success" disabled>
|
||||
<i class="ki-outline ki-photograph"></i> Ambil Foto
|
||||
</button>
|
||||
<button id="switchButton" class="btn btn-info" disabled>
|
||||
<i class="ki-outline ki-arrows-circle"></i> Switch Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Editor Controls -->
|
||||
<div id="editorControls" class=" flex flex-wrap gap-2 mt-4">
|
||||
<div class="drawing-tools flex gap-2">
|
||||
|
||||
<button class="tool-btn btn btn-sm" data-tool="brush">
|
||||
<i class="ki-filled ki-brush"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="rectangle">
|
||||
<i class="ki-filled ki-frame"></i>
|
||||
</button>
|
||||
<button class="btn btn-light btn-sm tool-btn" data-tool="arrow">
|
||||
<i class="ki-duotone ki-arrow-right fs-2"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="circle">
|
||||
<i class="ki-filled ki-mouse-circle"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="text">
|
||||
<i class="ki-filled ki-text"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="drawing-settings flex gap-2">
|
||||
<input type="color" id="colorPicker" class="w-8 h-8 rounded">
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="range" id="brushSize" min="1" max="20" value="5"
|
||||
class="range range-sm">
|
||||
<span id="brushSizeValue" class="text-sm">5px</span>
|
||||
</div>
|
||||
<input type="text" id="textInput" class="input" placeholder="Enter text">
|
||||
<button type="button" class="btn btn-primary" id="confirmTextBtn">Add Text</button>
|
||||
</div>
|
||||
|
||||
<div class="history-controls flex gap-2">
|
||||
<button id="undoButton" class="btn btn-sm">
|
||||
<i class="ki-filled ki-arrows-loop"></i>
|
||||
</button>
|
||||
<button id="resetButton" class="btn btn-sm">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="final-controls flex gap-2">
|
||||
<button type="button" class="btn btn-light btn-sm" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="backButton" class="btn btn-warning btn-sm">
|
||||
<i class="ki-outline ki-arrow-left"></i> Kembali
|
||||
</button>
|
||||
<button id="saveButton" class="btn btn-success btn-sm">
|
||||
<i class="ki-outline ki-check"></i> Simpan
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
<script>
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.draggable-text {
|
||||
z-index: 1000;
|
||||
}
|
||||
.draggable-text:hover {
|
||||
outline: 1px dashed #666;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Initialize camera editor
|
||||
const editor = new UniversalCameraEditor();
|
||||
|
||||
// Get all camera buttons
|
||||
const cameraButtons = document.querySelectorAll('#btnCamera');
|
||||
const modal = document.getElementById('cameraModal');
|
||||
const closeModal = document.getElementById('closeModal');
|
||||
|
||||
// Current input field to update
|
||||
let currentInputField = null;
|
||||
|
||||
// Confirm text button
|
||||
|
||||
|
||||
// Handle camera button click
|
||||
cameraButtons.forEach(button => {
|
||||
button.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const inputContainer = this.closest('.input-group');
|
||||
currentInputField = inputContainer.querySelector('input[type="file"]');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('modal-open');
|
||||
editor.startCamera();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
closeModal.addEventListener('click', function() {
|
||||
modal.classList.add('hidden');
|
||||
editor.closeCamera();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Override save function
|
||||
editor.saveAndUpload = async function() {
|
||||
try {
|
||||
// Membuat canvas akhir
|
||||
const finalCanvas = document.createElement('canvas');
|
||||
finalCanvas.width = this.canvas.width;
|
||||
finalCanvas.height = this.canvas.height;
|
||||
const ctx = finalCanvas.getContext('2d');
|
||||
|
||||
// Menggambar foto asli dan hasil edit di canvas akhir
|
||||
ctx.drawImage(this.canvas, 0, 0);
|
||||
ctx.drawImage(this.drawingCanvas, 0, 0);
|
||||
|
||||
// Konversi canvas ke Blob dan buat file
|
||||
finalCanvas.toBlob(async (blob) => {
|
||||
const file = new File([blob], `camera_photo_${Date.now()}.jpg`, {
|
||||
type: "image/jpeg"
|
||||
});
|
||||
|
||||
// Membuat FileList dan memperbarui field input
|
||||
const dataTransfer = new DataTransfer();
|
||||
dataTransfer.items.add(file);
|
||||
|
||||
if (currentInputField) {
|
||||
currentInputField.files = dataTransfer.files;
|
||||
|
||||
// Trigger event "change" untuk memperbarui tampilan
|
||||
const event = new Event('change', {
|
||||
bubbles: true
|
||||
});
|
||||
currentInputField.dispatchEvent(event);
|
||||
|
||||
// Tampilkan preview jika container preview ada
|
||||
const previewContainer = currentInputField.closest('.input-group')
|
||||
.querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = ''; // Bersihkan container preview
|
||||
previewContainer.appendChild(img); // Tambah gambar preview
|
||||
}
|
||||
}
|
||||
|
||||
// Menutup modal
|
||||
const modal = document.getElementById('cameraModal');
|
||||
modal.classList.remove('show');
|
||||
modal.style.display = 'none';
|
||||
modal.setAttribute('aria-hidden', 'true');
|
||||
document.body.classList.remove('modal-open');
|
||||
|
||||
// Menghapus backdrop modal jika ada
|
||||
const backdrop = document.querySelector('.modal-backdrop');
|
||||
if (backdrop) {
|
||||
backdrop.remove();
|
||||
}
|
||||
|
||||
// Hentikan stream kamera
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
editor.stream = null;
|
||||
}
|
||||
|
||||
// Mengatur ulang ke kondisi awal (reset kamera)
|
||||
editor.closeCamera()
|
||||
|
||||
}, 'image/jpeg', 0.8);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error saving photo:', error);
|
||||
alert('Error saving photo. Please try again.');
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Preview for regular file input change
|
||||
document.addEventListener('change', function(e) {
|
||||
if (e.target && e.target.type === 'file') {
|
||||
const file = e.target.files[0];
|
||||
if (file && file.type.startsWith('image/')) {
|
||||
const previewContainer = e.target.closest('.input-group').querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = '';
|
||||
previewContainer.appendChild(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Handle escape key
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
const modal = document.getElementById('cameraModal');
|
||||
if (modal.classList.contains('modal-open')) {
|
||||
modal.classList.remove('modal-open');
|
||||
modal.classList.add('hidden');
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// Generic function to handle adding new input and delete functionality
|
||||
|
||||
@@ -139,48 +139,62 @@
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
||||
|
||||
@php
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
|
||||
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (
|
||||
isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
|
||||
) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'tanah_bangunan';
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'tanah_bangunan';
|
||||
}
|
||||
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<input type="hidden" name="action" value="{{ $analisaType }}">
|
||||
<input type="hidden" name="type" value="{{ $analisaType }}">
|
||||
|
||||
@if ($analisaType == 'tanah_bangunan')
|
||||
@include('lpj::surveyor.components.tanah-bangunan')
|
||||
@else
|
||||
@include('lpj::surveyor.components.tanah')
|
||||
@elseif($analisaType == 'unit')
|
||||
@include('lpj::surveyor.components.apartemen-kantor')
|
||||
@elseif($analisaType == 'alat-berat')
|
||||
@include('lpj::surveyor.components.alat-berat')
|
||||
@elseif($analisaType == 'mesin')
|
||||
@include('lpj::surveyor.components.mesin')
|
||||
@elseif($analisaType == 'kapal')
|
||||
@include('lpj::surveyor.components.kapal')
|
||||
@elseif($analisaType == 'kendaraan')
|
||||
@include('lpj::surveyor.components.kendaraan')
|
||||
@endif
|
||||
|
||||
@if($analisaType == 'tanah_bangunan')
|
||||
@include('lpj::surveyor.components.bangunan')
|
||||
@endif
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-green-600 text-white py-4 px-6">
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
<div class=" bg-white rounded-lg overflow-hidden">
|
||||
<div class=" text-white py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -244,9 +258,9 @@
|
||||
<select
|
||||
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
|
||||
name="lalu_lintas">
|
||||
<option value="">Select PLalulintas Depan Lokasi</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
<option value="">Select Lalulintas Depan Lokasi</option>
|
||||
@if (isset($laluLintasLokasi))
|
||||
@foreach ($laluLintasLokasi as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -268,8 +282,9 @@
|
||||
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
|
||||
name="gol_mas_sekitar">
|
||||
<option value="">Select Golongan Hidup Sekitar</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
|
||||
@if (isset($golMasySekitar))
|
||||
@foreach ($golMasySekitar as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -291,8 +306,8 @@
|
||||
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
|
||||
name="tingkat_keramaian">
|
||||
<option value="">Select Tingkat Keramaian</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
@if (isset($tingkatKeramaian))
|
||||
@foreach ($tingkatKeramaian as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -446,9 +461,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" bg-white rounded-lg overflow-hidden">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -472,6 +488,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Rute Menuju</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@@ -539,14 +556,17 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container mx-auto ">
|
||||
<!-- Informasi Tata Ruang -->
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
|
||||
<div class="">
|
||||
<!-- Header -->
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
|
||||
</div>
|
||||
|
||||
@@ -656,15 +676,47 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Gistaru</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute"
|
||||
class="file-input file-input-bordered w-full" accept="image/*">
|
||||
<button id="gistaru" type="button" class="btn btn-light"
|
||||
onclick="openModal('gistaru')">
|
||||
<i class="ki-outline ki-abstract-33"></i> Gistaru
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Bumi</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button id="bumi" type="button" class="btn btn-light"
|
||||
onclick="openModal('bumi')">
|
||||
<i class="ki-outline ki-abstract-33"></i> Bumi
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Peta Section -->
|
||||
|
||||
<div class="mt-2" style="margin-top: 20px">
|
||||
<input type="hidden" name="lat" id="lat"
|
||||
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
|
||||
<input type="hidden" name="lng" id="lng"
|
||||
value="{{ old('lng', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lng : '') }}">
|
||||
<div class="bg-info border p-6 rounded-lg shadow-lg flex items-center justify-center"
|
||||
<div class=" border p-6 rounded-lg shadow-lg flex items-center justify-center"
|
||||
style="height: 300px">
|
||||
<iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
@@ -706,6 +758,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="submit" class="btn btn-success">
|
||||
@@ -717,8 +770,74 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="screenshotContainer" style="height: 500px">
|
||||
<iframe id="mapFrameGis" style="width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer flex justify-end">
|
||||
<button id="takeScreenshot" class="btn btn-success">Take Screenshot</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script>
|
||||
function getMap(params) {
|
||||
const iframe = document.getElementById('mapFrameGis');
|
||||
const maps = [
|
||||
'https://gistaru.atrbpn.go.id/rtronline/',
|
||||
'https://bhumi.atrbpn.go.id/peta'
|
||||
];
|
||||
|
||||
iframe.src = maps[params];
|
||||
}
|
||||
|
||||
function openModal(type) {
|
||||
const modalGistaru = document.getElementById('gistaru');
|
||||
const modalBumi = document.getElementById('bumi');
|
||||
|
||||
if (type === 'bumi') {
|
||||
modalBumi.setAttribute('data-modal-toggle', '#modal');
|
||||
}else if (type === 'gistaru') {
|
||||
modalGistaru.setAttribute('data-modal-toggle', '#modal');
|
||||
}
|
||||
|
||||
getMap(type === 'gistaru' ? 0 : 1);
|
||||
}
|
||||
|
||||
document.getElementById('takeScreenshot').addEventListener('click', () => {
|
||||
const screenshotContainer = document.getElementById('screenshotContainer');
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = screenshotContainer.offsetWidth;
|
||||
canvas.height = screenshotContainer.offsetHeight;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(document.getElementById('mapFrame'), 0, 0, canvas.width, canvas.height);
|
||||
const dataURL = canvas.toDataURL('image/jpeg');
|
||||
|
||||
// Tampilkan gambar di atas input
|
||||
const inputRute = document.getElementById('inputRute');
|
||||
const img = document.createElement('img');
|
||||
img.src = dataURL;
|
||||
img.style.maxWidth = '100%';
|
||||
img.style.maxHeight = '200px';
|
||||
inputRute.parentNode.insertBefore(img, inputRute);
|
||||
|
||||
// Isi input dengan data URL gambar
|
||||
inputRute.value = dataURL;
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
<script>
|
||||
// Fungsi untuk mengambil lokasi pengguna
|
||||
function getUserLocation() {
|
||||
|
||||
488
resources/views/surveyor/components/kapal.blade.php
Normal file
488
resources/views/surveyor/components/kapal.blade.php
Normal file
@@ -0,0 +1,488 @@
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Jenis</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<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">Size</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Size</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<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">Kondisi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Jenis</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<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">Klasifikasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Jenis</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Nama Kapal', 'index' => 0],
|
||||
['label' => 'Pemilik Kapal', 'index' => 1],
|
||||
['label' => 'Bendera', 'index' => 2],
|
||||
['label' => 'Nomor Tanda Selar', 'index' => 3],
|
||||
['label' => 'Kapal', 'index' => 4],
|
||||
['label' => 'Galangan', 'index' => 5],
|
||||
['label' => 'Kapal/Shipyard', 'index' => 6],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 7],
|
||||
['label' => 'Tahun Lanuncing', 'index' => 8],
|
||||
['label' => 'DWT (ton)', 'index' => 9],
|
||||
['label' => 'LWT (ton)', 'index' => 10],
|
||||
['label' => 'Gross Tonnage (ton)', 'index' => 11],
|
||||
['label' => 'Net Tonnage (ton)', 'index' => 12],
|
||||
['label' => 'Tenaga Mesin (HP)', 'index' => 13],
|
||||
['label' => 'LOA', 'index' => 14],
|
||||
['label' => 'LBP', 'index' => 15],
|
||||
['label' => 'Beam', 'index' => 16],
|
||||
['label' => 'Depth', 'index' => 17],
|
||||
['label' => 'Draft', 'index' => 18],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end" style="margin-top: 10px">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah mesin
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Struktur Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Lambung Kapal', 'index' => 0],
|
||||
['label' => 'Dek', 'index' => 1],
|
||||
['label' => 'Struktur Rangka', 'index' => 2],
|
||||
['label' => 'Palka', 'index' => 3],
|
||||
['label' => 'Pondasi Mesin', 'index' => 4],
|
||||
['label' => 'Area Mesin', 'index' => 5],
|
||||
['label' => 'Cat dan Korosi', 'index' => 6],
|
||||
['label' => 'Sistem Pengelasan', 'index' => 7]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Peralatan Keselamatan --}}
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Peralatan Keselamatan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Sekoci/Lifeboat', 'index' => 0],
|
||||
['label' => 'Jaket Pelampung', 'index' => 1],
|
||||
['label' => 'Alat Pemadam', 'index' => 2],
|
||||
['label' => 'Rambu Darurat', 'index' => 3],
|
||||
['label' => 'Sistem Alarm', 'index' => 4],
|
||||
['label' => 'Sistem Pencegah', 'index' => 5],
|
||||
['label' => 'Kebaran', 'index' => 6],
|
||||
['label' => 'Lampu Darurat', 'index' => 7]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Sistwm Navigasi dan Komunikasi --}}
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Sistem Navigasi dan Komunikasi</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Gps', 'index' => 0],
|
||||
['label' => 'Radat', 'index' => 1],
|
||||
['label' => 'Radio Komunikasi', 'index' => 2],
|
||||
['label' => 'Lampu Navigasi', 'index' => 3],
|
||||
['label' => 'Sistem Kendali otomatis', 'index' => 4],
|
||||
['label' => 'Kompas', 'index' => 5],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Sistwm Mesin dan Penggerak Kapal --}}
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Sistem Mesin dan Penggerak Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Mesin Utama', 'index' => 0],
|
||||
['label' => 'Mesin Bantu', 'index' => 1],
|
||||
['label' => 'Pompa Pendingin', 'index' => 2],
|
||||
['label' => 'Sistem Pelumasan', 'index' => 3],
|
||||
['label' => 'Propeller', 'index' => 4],
|
||||
['label' => 'Sistem Kelistrikan', 'index' => 5],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Sistwm kelistrikan dan Elektronik --}}
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Sistem Kelistrikan dan Elektronik</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Lampu Navigasi', 'index' => 0],
|
||||
['label' => 'Sistem Penerangan', 'index' => 1],
|
||||
['label' => 'Sistem Panel Distribusi', 'index' => 2],
|
||||
['label' => 'Kabel dan Perangkat Pendukung', 'index' => 3],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Linkungan dan Kebersihan Kapal --}}
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Linkungan dan Kebersihan Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Kebersihan Dek Luar', 'index' => 0],
|
||||
['label' => 'Tangki Limbah', 'index' => 1],
|
||||
['label' => 'Sistem Pengelolaan Limbah', 'index' => 2],
|
||||
['label' => 'Pengelolaan Air Ballast', 'index' => 3],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
160
resources/views/surveyor/components/kendaraan.blade.php
Normal file
160
resources/views/surveyor/components/kendaraan.blade.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Order Penilaian</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Survey</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" name="tanggal_survey" class="input" placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama Wakil Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input" placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<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">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input" placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">BPKB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="tanggal_survey" class="input" placeholder="BPKP">
|
||||
@error('hadapMataAngin')
|
||||
<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">STNK</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="tanggal_survey" class="input" placeholder="STNK">
|
||||
@error('hadapMataAngin')
|
||||
<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">Deskripsi kendaraan sesuai dokument</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Tipe/Model', 'index' => 0],
|
||||
['label' => 'Merek', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Negara Pembuat', 'index' => 3],
|
||||
['label' => 'Kondisi Mesin', 'index' => 4],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
133
resources/views/surveyor/components/mesin.blade.php
Normal file
133
resources/views/surveyor/components/mesin.blade.php
Normal file
@@ -0,0 +1,133 @@
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Tipe/Model', 'index' => 0],
|
||||
['label' => 'Merek', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Negara Pembuat', 'index' => 3],
|
||||
['label' => 'Kondisi Mesin', 'index' => 4],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end" style="margin-top: 10px">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah mesin
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Tanah</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -246,235 +246,3 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($analisaType == 'tanah_bangunan')
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Bangunan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah_bagunan" value="sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah_bagunan" value="tidak sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('luas_tanah_bagunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Jenis Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('jenis_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="jenis_bangunan">
|
||||
<option value="">Select Jenis Bangunan</option>
|
||||
@if (isset($jenisBangunan))
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('jenis_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Kondisi Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisi_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="kondisi_bangunan">
|
||||
<option value="">Select Kondisi Bangunan</option>
|
||||
@if (isset($kondisiBangunan))
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisi_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sifat Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56"> Sifat Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('sifat_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="sifat_bangunan">
|
||||
<option value="">Select Sifat Bangunan</option>
|
||||
@if (isset($sifatBangunan))
|
||||
@foreach ($sifatBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sifat_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spek Bangunan -->
|
||||
<div class="gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Spek Bangunan</label>
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full" id="spek-bangunan-container">
|
||||
<div class="spek-bangunan w-full gap-4">
|
||||
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
||||
@if (@isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
<div>
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('name') border-danger bg-danger-light @enderror"
|
||||
name="name[]">
|
||||
<option value="">Select {{ $item->name }}</option>
|
||||
@foreach ($spekBangunan as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<option value="{{ $spek->name }}"
|
||||
{{ old('name') == $spek->name ? 'selected' : '' }}>
|
||||
{{ $spek->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
class="mt-2 btn btn-danger btn-outline btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah bangunan
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Sarana pelengkap -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Sarana pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('sarana_pelengkap') border-danger bg-danger-light @enderror"
|
||||
name="sarana_pelengkap">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const spekBangunanContainer = document.getElementById('spek-bangunan-container');
|
||||
|
||||
function updateDeleteButtonsVisibility() {
|
||||
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
|
||||
// Only show the delete buttons if there are more than one form
|
||||
allDeleteButtons.forEach(button => {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
button.style.display = 'inline-block';
|
||||
} else {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('addBagunan').addEventListener('click', function() {
|
||||
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
|
||||
|
||||
// Clear the selected values of the cloned input fields
|
||||
newDiv.querySelectorAll('select').forEach(select => {
|
||||
select.value = '';
|
||||
});
|
||||
|
||||
// Append the cloned div to the container
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
|
||||
// Add event listener to the delete button in the cloned div
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
spekBangunanContainer.removeChild(newDiv);
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Update delete buttons visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Initial delete button visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
|
||||
// Add delete functionality to the initial form
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const spekBangunan = this.closest('.spek-bangunan');
|
||||
|
||||
// Make sure not to delete the last remaining form
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
spekBangunan.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -33,7 +33,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $model->code ?? '' }}" >
|
||||
name="code" value="{{ $model->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -51,6 +51,41 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isset($header[1]) && $header[1] == 'spek-bangunan')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kategori
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('spek_kategori_bangunan_id') border-danger bg-danger-light @enderror"
|
||||
name="spek_kategori_bangunan_id">
|
||||
<option value="">Select Kategori Bangunan</option>
|
||||
@if (isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
@if (isset($model->spek_kategori_bangunan_id))
|
||||
<option value="{{ $model->spek_kategori_bangunan_id }}"
|
||||
{{ $model->spek_kategori_bangunan_id == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('spek_kategori_bangunan_id') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('spek_kategori_bangunan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('surveyor.bentuk-tanah') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.' . $header[1]) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
@if (request()->has('form') && request('form') !== 'data-pembanding')
|
||||
<div class="card-footer">
|
||||
<form action="{{ route('surveyor.submitSurveyor', $surveyor) }}" method="POST">
|
||||
<form action="{{ route('surveyor.submitSurveyor', $surveyor ) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -201,10 +202,10 @@
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Assigned',
|
||||
render: (item, data) => {
|
||||
const createdAt = convertDate(data.penilaian.created_at);
|
||||
return createdAt;
|
||||
},
|
||||
// render: (item, data) => {
|
||||
// const createdAt = convertDate(data.penilaian.created_at);
|
||||
// return createdAt;
|
||||
// },
|
||||
},
|
||||
|
||||
user_id: {
|
||||
@@ -231,9 +232,6 @@
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" data-modal-toggle="#modal_revisi" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
@@ -249,10 +247,10 @@
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
statusFilter.addEventListener('change', function() {
|
||||
const selectedStatus = this.value;
|
||||
dataTable.search(selectedStatus);
|
||||
});
|
||||
// statusFilter.addEventListener('change', function() {
|
||||
// const selectedStatus = this.value;
|
||||
// dataTable.search(selectedStatus);
|
||||
// });
|
||||
|
||||
function convertDate(date) {
|
||||
const createdAt = new Date(date);
|
||||
|
||||
585
resources/views/surveyor/js/camera-editor.blade.php
Normal file
585
resources/views/surveyor/js/camera-editor.blade.php
Normal file
@@ -0,0 +1,585 @@
|
||||
@push('scripts')
|
||||
<script>
|
||||
class UniversalCameraEditor {
|
||||
constructor() {
|
||||
// Initialize elements
|
||||
this.video = document.getElementById('video');
|
||||
this.canvas = document.getElementById('canvas');
|
||||
this.drawingCanvas = document.getElementById('drawingCanvas');
|
||||
this.ctx = this.drawingCanvas.getContext('2d');
|
||||
|
||||
// Buttons
|
||||
this.startButton = document.getElementById('startButton');
|
||||
this.takePhotoButton = document.getElementById('takePhotoButton');
|
||||
this.switchButton = document.getElementById('switchButton');
|
||||
this.backButton = document.getElementById('backButton');
|
||||
this.saveButton = document.getElementById('saveButton');
|
||||
this.undoButton = document.getElementById('undoButton');
|
||||
this.resetButton = document.getElementById('resetButton');
|
||||
|
||||
// Drawing controls
|
||||
this.colorPicker = document.getElementById('colorPicker');
|
||||
this.brushSize = document.getElementById('brushSize');
|
||||
this.brushSizeValue = document.getElementById('brushSizeValue');
|
||||
|
||||
// Text modal elements
|
||||
this.textModal = document.getElementById('textModal');
|
||||
this.textInput = document.getElementById('textInput');
|
||||
this.confirmTextBtn = document.getElementById('confirmTextBtn');
|
||||
this.cancelTextBtn = document.getElementById('cancelTextBtn');
|
||||
|
||||
// Initialize state
|
||||
this.stream = null;
|
||||
this.currentFacingMode = 'environment';
|
||||
this.isDrawing = false;
|
||||
this.currentTool = 'brush';
|
||||
this.drawingHistory = [];
|
||||
this.historyIndex = -1;
|
||||
|
||||
// Drawing coordinates
|
||||
this.startX = 0;
|
||||
this.startY = 0;
|
||||
this.lastX = 0;
|
||||
this.lastY = 0;
|
||||
|
||||
// Setup
|
||||
this.setupCanvas();
|
||||
this.setupEventListeners();
|
||||
this.setupDrawingContext();
|
||||
|
||||
|
||||
// Add text overlay container
|
||||
this.textOverlay = document.getElementById('textOverlay');
|
||||
this.activeTextElement = null;
|
||||
this.isDraggingText = false;
|
||||
this.textOffset = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
|
||||
// Current input field reference
|
||||
this.currentInputField = null;
|
||||
|
||||
}
|
||||
|
||||
setupCanvas() {
|
||||
// Set initial canvas size
|
||||
this.canvas.width = 1280;
|
||||
this.canvas.height = 960;
|
||||
this.drawingCanvas.width = 1280;
|
||||
this.drawingCanvas.height = 960;
|
||||
}
|
||||
|
||||
setupDrawingContext() {
|
||||
this.ctx.strokeStyle = this.colorPicker.value;
|
||||
this.ctx.lineWidth = this.brushSize.value;
|
||||
this.ctx.lineCap = 'round';
|
||||
this.ctx.lineJoin = 'round';
|
||||
}
|
||||
|
||||
async startCamera() {
|
||||
try {
|
||||
if (this.stream) {
|
||||
this.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
|
||||
const constraints = {
|
||||
video: {
|
||||
facingMode: this.currentFacingMode,
|
||||
width: {
|
||||
ideal: 1280
|
||||
},
|
||||
height: {
|
||||
ideal: 960
|
||||
}
|
||||
},
|
||||
audio: false
|
||||
};
|
||||
|
||||
this.stream = await navigator.mediaDevices.getUserMedia(constraints);
|
||||
this.video.srcObject = this.stream;
|
||||
|
||||
// Enable buttons after camera starts
|
||||
this.takePhotoButton.disabled = false;
|
||||
this.switchButton.disabled = false;
|
||||
|
||||
// Show video, hide canvas
|
||||
this.video.style.display = 'block';
|
||||
this.canvas.style.display = 'none';
|
||||
this.drawingCanvas.style.display = 'none';
|
||||
|
||||
// Hide editor controls
|
||||
document.getElementById('editorControls').classList.add('hidden');
|
||||
document.getElementById('cameraControls').classList.remove('hidden');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error accessing camera:', error);
|
||||
alert('Error accessing camera. Please make sure you have granted camera permissions.');
|
||||
}
|
||||
}
|
||||
|
||||
takePhoto() {
|
||||
// Draw video frame to canvas
|
||||
const context = this.canvas.getContext('2d');
|
||||
context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);
|
||||
|
||||
// Hide video, show canvases
|
||||
this.video.style.display = 'none';
|
||||
this.canvas.style.display = 'block';
|
||||
this.drawingCanvas.style.display = 'block';
|
||||
|
||||
// Show editor controls, hide camera controls
|
||||
document.getElementById('editorControls').classList.remove('hidden');
|
||||
document.getElementById('cameraControls').classList.add('hidden');
|
||||
|
||||
// Clear drawing history
|
||||
this.drawingHistory = [];
|
||||
this.historyIndex = -1;
|
||||
this.saveDrawingState();
|
||||
}
|
||||
|
||||
switchCamera() {
|
||||
this.currentFacingMode = this.currentFacingMode === 'environment' ? 'user' : 'environment';
|
||||
this.startCamera();
|
||||
}
|
||||
|
||||
resetToCamera() {
|
||||
// Clear canvases
|
||||
const context = this.canvas.getContext('2d');
|
||||
context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
|
||||
// Reset history
|
||||
this.drawingHistory = [];
|
||||
this.historyIndex = -1;
|
||||
|
||||
// Restart camera
|
||||
this.startCamera();
|
||||
}
|
||||
|
||||
saveDrawingState() {
|
||||
// Trim history if we're not at the end
|
||||
if (this.historyIndex < this.drawingHistory.length - 1) {
|
||||
this.drawingHistory = this.drawingHistory.slice(0, this.historyIndex + 1);
|
||||
}
|
||||
|
||||
// Save current state
|
||||
this.drawingHistory.push(this.drawingCanvas.toDataURL());
|
||||
this.historyIndex++;
|
||||
}
|
||||
|
||||
undo() {
|
||||
if (this.historyIndex > 0) {
|
||||
this.historyIndex--;
|
||||
this.redrawHistory();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
resetDrawing() {
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
this.saveDrawingState();
|
||||
}
|
||||
|
||||
// Implement all event listeners from previous code here
|
||||
setupEventListeners() {
|
||||
// Camera controls
|
||||
this.startButton.onclick = () => this.startCamera();
|
||||
this.takePhotoButton.onclick = () => this.takePhoto();
|
||||
this.switchButton.onclick = () => this.switchCamera();
|
||||
this.backButton.onclick = () => this.resetToCamera();
|
||||
|
||||
// Drawing controls
|
||||
this.setupDrawingEvents();
|
||||
this.setupToolButtons();
|
||||
|
||||
// Settings changes
|
||||
this.colorPicker.oninput = (e) => this.ctx.strokeStyle = e.target.value;
|
||||
this.brushSize.oninput = (e) => {
|
||||
this.ctx.lineWidth = e.target.value;
|
||||
this.brushSizeValue.textContent = `${e.target.value}px`;
|
||||
};
|
||||
|
||||
// History controls
|
||||
this.undoButton.onclick = () => this.undo();
|
||||
this.resetButton.onclick = () => this.resetDrawing();
|
||||
|
||||
// Save functionality
|
||||
this.saveButton.onclick = () => this.saveAndUpload();
|
||||
|
||||
|
||||
// Text tool modal controls
|
||||
this.confirmTextBtn.onclick = () => {
|
||||
const text = this.textInput.value.trim();
|
||||
if (text) {
|
||||
this.addDraggableText(text);
|
||||
this.textInput.value = '';
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
setupToolButtons() {
|
||||
const toolButtons = document.querySelectorAll('.tool-btn');
|
||||
toolButtons.forEach(button => {
|
||||
button.onclick = () => {
|
||||
toolButtons.forEach(btn => btn.classList.remove('active'));
|
||||
button.classList.add('active');
|
||||
this.currentTool = button.dataset.tool;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// Implement drawing events from previous code here
|
||||
setupDrawingEvents() {
|
||||
// Mouse events
|
||||
this.drawingCanvas.addEventListener('mousedown', (e) => this.startDrawing(e));
|
||||
this.drawingCanvas.addEventListener('mousemove', (e) => this.draw(e));
|
||||
this.drawingCanvas.addEventListener('mouseup', () => this.stopDrawing());
|
||||
this.drawingCanvas.addEventListener('mouseout', () => this.stopDrawing());
|
||||
|
||||
// Touch events
|
||||
this.drawingCanvas.addEventListener('touchstart', (e) => {
|
||||
if (this.shouldPreventDefault(e)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
const touch = e.touches[0];
|
||||
const mouseEvent = new MouseEvent('mousedown', {
|
||||
clientX: touch.clientX,
|
||||
clientY: touch.clientY
|
||||
});
|
||||
this.startDrawing(mouseEvent);
|
||||
}, {
|
||||
passive: false
|
||||
});
|
||||
|
||||
this.drawingCanvas.addEventListener('touchmove', (e) => {
|
||||
if (this.shouldPreventDefault(e)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
const touch = e.touches[0];
|
||||
const mouseEvent = new MouseEvent('mousemove', {
|
||||
clientX: touch.clientX,
|
||||
clientY: touch.clientY
|
||||
});
|
||||
this.draw(mouseEvent);
|
||||
}, {
|
||||
passive: false
|
||||
});
|
||||
|
||||
this.drawingCanvas.addEventListener('touchend', () => {
|
||||
this.stopDrawing();
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
|
||||
// Implement drawing methods from previous code here
|
||||
startDrawing(e) {
|
||||
this.isDrawing = true;
|
||||
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||
const scaleX = this.drawingCanvas.width / rect.width;
|
||||
const scaleY = this.drawingCanvas.height / rect.height;
|
||||
|
||||
this.startX = (e.clientX - rect.left) * scaleX;
|
||||
this.startY = (e.clientY - rect.top) * scaleY;
|
||||
this.lastX = this.startX;
|
||||
this.lastY = this.startY;
|
||||
|
||||
if (this.currentTool === 'brush') {
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.startX, this.startY);
|
||||
}
|
||||
}
|
||||
|
||||
addDraggableText(text) {
|
||||
const textElement = document.createElement('div');
|
||||
textElement.className = 'draggable-text';
|
||||
textElement.style.cssText = `
|
||||
position: absolute;
|
||||
cursor: move;
|
||||
user-select: none;
|
||||
color: ${this.colorPicker.value};
|
||||
font-size: ${this.brushSize.value * 2}px;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
`;
|
||||
|
||||
// Create text span
|
||||
const textSpan = document.createElement('span');
|
||||
textSpan.textContent = text;
|
||||
textElement.appendChild(textSpan);
|
||||
|
||||
// Create delete button
|
||||
const deleteBtn = document.createElement('button');
|
||||
deleteBtn.innerHTML = '×';
|
||||
deleteBtn.style.cssText = `
|
||||
border: none;
|
||||
background: none;
|
||||
color: #ff4444;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
`;
|
||||
textElement.appendChild(deleteBtn);
|
||||
|
||||
// Show/hide delete button on hover
|
||||
textElement.addEventListener('mouseenter', () => {
|
||||
deleteBtn.style.opacity = '1';
|
||||
});
|
||||
textElement.addEventListener('mouseleave', () => {
|
||||
deleteBtn.style.opacity = '0';
|
||||
});
|
||||
|
||||
// Delete functionality
|
||||
deleteBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
textElement.remove();
|
||||
this.saveDrawingState();
|
||||
});
|
||||
|
||||
// Center the text initially
|
||||
textElement.style.left = '50%';
|
||||
textElement.style.top = '50%';
|
||||
textElement.style.transform = 'translate(-50%, -50%)';
|
||||
|
||||
// Add drag functionality
|
||||
this.setupDraggableText(textElement);
|
||||
|
||||
this.textOverlay.appendChild(textElement);
|
||||
this.saveDrawingState();
|
||||
}
|
||||
|
||||
setupDraggableText(element) {
|
||||
let isDragging = false;
|
||||
let currentX;
|
||||
let currentY;
|
||||
let initialX;
|
||||
let initialY;
|
||||
let xOffset = 0;
|
||||
let yOffset = 0;
|
||||
|
||||
const dragStart = (e) => {
|
||||
if (this.currentTool === 'text') {
|
||||
const event = e.type === 'mousedown' ? e : e.touches[0];
|
||||
initialX = event.clientX - xOffset;
|
||||
initialY = event.clientY - yOffset;
|
||||
|
||||
if (e.target === element || e.target.parentNode === element) {
|
||||
isDragging = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const drag = (e) => {
|
||||
if (isDragging) {
|
||||
e.preventDefault();
|
||||
const event = e.type === 'mousemove' ? e : e.touches[0];
|
||||
|
||||
currentX = event.clientX - initialX;
|
||||
currentY = event.clientY - initialY;
|
||||
|
||||
xOffset = currentX;
|
||||
yOffset = currentY;
|
||||
|
||||
setTranslate(currentX, currentY, element);
|
||||
}
|
||||
};
|
||||
|
||||
const dragEnd = () => {
|
||||
if (isDragging) {
|
||||
isDragging = false;
|
||||
this.saveDrawingState();
|
||||
}
|
||||
};
|
||||
|
||||
const setTranslate = (xPos, yPos, el) => {
|
||||
el.style.transform = `translate(${xPos}px, ${yPos}px)`;
|
||||
};
|
||||
|
||||
// Mouse events
|
||||
element.addEventListener('mousedown', dragStart);
|
||||
document.addEventListener('mousemove', drag);
|
||||
document.addEventListener('mouseup', dragEnd);
|
||||
|
||||
// Touch events
|
||||
element.addEventListener('touchstart', dragStart);
|
||||
document.addEventListener('touchmove', drag);
|
||||
document.addEventListener('touchend', dragEnd);
|
||||
}
|
||||
|
||||
// Add this CSS to your stylesheet
|
||||
|
||||
|
||||
draw(e) {
|
||||
if (!this.isDrawing) return;
|
||||
|
||||
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||
const scaleX = this.drawingCanvas.width / rect.width;
|
||||
const scaleY = this.drawingCanvas.height / rect.height;
|
||||
const x = (e.clientX - rect.left) * scaleX;
|
||||
const y = (e.clientY - rect.top) * scaleY;
|
||||
|
||||
switch (this.currentTool) {
|
||||
case 'arrow':
|
||||
// Restore the previous state before drawing new arrow
|
||||
if (this.historyIndex >= 0) {
|
||||
this.redrawHistory();
|
||||
} else {
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
}
|
||||
this.drawArrow(this.startX, this.startY, x, y);
|
||||
break;
|
||||
|
||||
case 'brush':
|
||||
this.ctx.lineTo(x, y);
|
||||
this.ctx.stroke();
|
||||
break;
|
||||
|
||||
case 'rectangle':
|
||||
// Restore the previous state before drawing new rectangle
|
||||
if (this.historyIndex >= 0) {
|
||||
this.redrawHistory();
|
||||
} else {
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
}
|
||||
this.ctx.beginPath();
|
||||
this.ctx.strokeRect(this.startX, this.startY, x - this.startX, y - this.startY);
|
||||
break;
|
||||
|
||||
case 'circle':
|
||||
// Restore the previous state before drawing new circle
|
||||
if (this.historyIndex >= 0) {
|
||||
this.redrawHistory();
|
||||
} else {
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
}
|
||||
const radius = Math.sqrt(Math.pow(x - this.startX, 2) + Math.pow(y - this.startY, 2));
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(this.startX, this.startY, radius, 0, Math.PI * 2);
|
||||
this.ctx.stroke();
|
||||
break;
|
||||
}
|
||||
|
||||
this.lastX = x;
|
||||
this.lastY = y;
|
||||
}
|
||||
|
||||
drawArrow(fromX, fromY, toX, toY) {
|
||||
const headLength = 20;
|
||||
const headAngle = Math.PI / 6;
|
||||
|
||||
// Calculate angle
|
||||
const angle = Math.atan2(toY - fromY, toX - fromX);
|
||||
|
||||
// Draw main line
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(fromX, fromY);
|
||||
this.ctx.lineTo(toX, toY);
|
||||
this.ctx.stroke();
|
||||
|
||||
// Draw arrowhead
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(toX, toY);
|
||||
this.ctx.lineTo(
|
||||
toX - headLength * Math.cos(angle - headAngle),
|
||||
toY - headLength * Math.sin(angle - headAngle)
|
||||
);
|
||||
this.ctx.moveTo(toX, toY);
|
||||
this.ctx.lineTo(
|
||||
toX - headLength * Math.cos(angle + headAngle),
|
||||
toY - headLength * Math.sin(angle + headAngle)
|
||||
);
|
||||
this.ctx.stroke();
|
||||
}
|
||||
|
||||
startDrawing(e) {
|
||||
this.isDrawing = true;
|
||||
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||
const scaleX = this.drawingCanvas.width / rect.width;
|
||||
const scaleY = this.drawingCanvas.height / rect.height;
|
||||
|
||||
this.startX = (e.clientX - rect.left) * scaleX;
|
||||
this.startY = (e.clientY - rect.top) * scaleY;
|
||||
this.lastX = this.startX;
|
||||
this.lastY = this.startY;
|
||||
|
||||
if (this.currentTool === 'brush') {
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(this.startX, this.startY);
|
||||
}
|
||||
}
|
||||
|
||||
stopDrawing() {
|
||||
if (this.isDrawing) {
|
||||
this.isDrawing = false;
|
||||
if (this.currentTool === 'brush') {
|
||||
this.ctx.closePath();
|
||||
}
|
||||
this.saveDrawingState();
|
||||
}
|
||||
}
|
||||
|
||||
redrawHistory() {
|
||||
if (this.historyIndex >= 0 && this.drawingHistory[this.historyIndex]) {
|
||||
const img = new Image();
|
||||
img.src = this.drawingHistory[this.historyIndex];
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
this.ctx.drawImage(img, 0, 0);
|
||||
} else {
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
}
|
||||
}
|
||||
closeEditor() {
|
||||
if (this.stream) {
|
||||
this.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
|
||||
// Clear canvases and text overlay
|
||||
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||
const mainCtx = this.canvas.getContext('2d');
|
||||
mainCtx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
this.textOverlay.innerHTML = '';
|
||||
|
||||
// Reset state
|
||||
this.drawingHistory = [];
|
||||
this.historyIndex = -1;
|
||||
this.currentInputField = null;
|
||||
|
||||
// Close modals
|
||||
this.cameraModal.hide();
|
||||
this.textInputModal.hide();
|
||||
}
|
||||
|
||||
// Override this method in your implementation
|
||||
saveAndUpload() {
|
||||
|
||||
}
|
||||
|
||||
closeCamera() {
|
||||
// Stop the video stream
|
||||
if (this.stream) {
|
||||
this.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
|
||||
// Hide video and canvas elements
|
||||
this.video.style.display = 'none';
|
||||
this.canvas.style.display = 'none';
|
||||
this.drawingCanvas.style.display = 'none';
|
||||
|
||||
|
||||
// Reset any additional state if needed
|
||||
this.stream = null;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@@ -61,14 +61,14 @@
|
||||
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
|
||||
name="regions_id">
|
||||
<option value="">Select Region</option>
|
||||
@if (isset($region))
|
||||
@foreach ($region as $regions)
|
||||
@if (isset($regions))
|
||||
@foreach ($regions as $region)
|
||||
@if (isset($teams))
|
||||
<option value="{{ $regions->id }}"
|
||||
{{ $teams->regions_id == $regions->id ? 'selected' : '' }}>
|
||||
{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}"
|
||||
{{ $teams->regions_id == $region->id ? 'selected' : '' }}>
|
||||
{{ $region->name }}</option>
|
||||
@else
|
||||
<option value="{{ $regions->id }}">{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}">{{ $region->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -98,6 +98,7 @@
|
||||
@endforeach
|
||||
</option>
|
||||
@else
|
||||
|
||||
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||
|
||||
@foreach ($users->roles as $role)
|
||||
|
||||
Reference in New Issue
Block a user