97 lines
4.2 KiB
PHP

@extends('dashboard.layouts.main')
@section('body_main')
<div class="container-xxl flex-grow-1 container-p-y">
<!-- Breadcrumb -->
<h4 class="fw-bold py-3 mb-4">
<span class="text-muted fw-light">Dashboard /</span> Verifikasi Makanan
</h4>
<!-- Card Master Menu -->
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2">
<!-- Judul Kiri -->
<h5 class="mb-0">
Verifikasi Makanan <strong id="confirm_pekerjaan_time"></strong>
</h5>
<!-- Kanan: Tombol Export + Input Tanggal -->
<div class="d-flex align-items-center gap-2">
<!-- Tombol Export -->
<button type="button" class="btn btn-sm btn-info" id="data_pending" onclick="datapending()">
<i class="fa-solid fa-circle-info"></i> Info Data Pending
</button>
<button type="button" class="btn btn-sm btn-primary" id="buttonLabel" onclick="labelDownload()" disabled>
<i class="fa-solid fa-qrcode"></i> Cetak Label
</button>
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="exportPekerjaan()">
<i class="fa fa-download me-1"></i> Export
</button>
<!-- Input Tanggal -->
<div class="input-group input-group-sm" style="width: 240px;">
<span class="input-group-text bg-white">
<i class="fa fa-calendar-alt"></i>
</span>
<input
type="text"
class="form-control tanggal-input"
id="tanggal"
placeholder="Pilih tanggal"
readonly>
</div>
</div>
</div>
<div class="card-body">
<table class="table" id="datatablePekerjaan"></table>
</div>
</div>
</div>
@include('dashboard.pesanan.pekerjaan.modal.detail')
@include('dashboard.pesanan.pekerjaan.modal.action')
@include('dashboard.pesanan.pekerjaan.modal.infoDataPending')
<x-modalExport modalId="modalExportPekerjaan" form="/dashboard/pekerjaan/export" confirm="Verifikasi Makanan"/>
<script src="{{ ver('/js/pekerjaan/_init.js') }}"></script>
<script src="{{ ver('/js/pekerjaan/dt.js') }}"></script>
<script src="{{ ver('/js/pekerjaan/action.js') }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
flatpickr('#tanggal', {
dateFormat: "Y-m-d",
mode: "multiple",
locale: "id", // opsional: agar hari/bulan dalam Bahasa Indonesia
onValueUpdate: function(selectedDates, dateStr, instance) {
const selectedFormattedDates = selectedDates.map(d => {
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
})
initDt(selectedFormattedDates);
if(selectedFormattedDates.length > 0){
const tanggalList = selectedFormattedDates;
let tanggalRapi = '';
if (tanggalList.length === 1) {
tanggalRapi = tanggalList[0];
} else if (tanggalList.length === 2) {
tanggalRapi = tanggalList.join(' dan ');
} else if (tanggalList.length > 2) {
tanggalRapi = tanggalList.slice(0, -1).join(', ') + ', dan ' + tanggalList.slice(-1);
}
$("#confirm_pekerjaan_time").text(': '+ tanggalRapi)
}else{
$("#confirm_pekerjaan_time").text('Hari Ini');
}
}
});
$("#confirm_pekerjaan_time").text('Hari Ini');
initDt();
});
</script>
@endsection