@error('pegawai')
{{ $message }}
@enderror
@php
$bulan = array(
[
"id" => "1",
"bulan" => "Januari"
],
[
"id" => "2",
"bulan" => "Februari"
],
[
"id" => "3",
"bulan" => "Maret"
],
[
"id" => "4",
"bulan" => "April"
],
[
"id" => "5",
"bulan" => "Mei"
],
[
"id" => "6",
"bulan" => "Juni"
],
[
"id" => "7",
"bulan" => "Juli"
],
[
"id" => "8",
"bulan" => "Agustus"
],
[
"id" => "9",
"bulan" => "September"
],
[
"id" => "10",
"bulan" => "Oktober"
],
[
"id" => "11",
"bulan" => "November"
],
[
"id" => "12",
"bulan" => "Desember"
]);
@endphp
@php
$pecah_tanggal = explode("-", $tanggal_mulai);
$tahun_filter = $pecah_tanggal[0];
$bulan_filter = $pecah_tanggal[1];
@endphp
@error('bulan')
{{ $message }}
@enderror
@php
$last = date('Y')-10;
$now = date('Y');
@endphp
@error('tahun')
{{ $message }}
@enderror
@php
$jumlah_hadir = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', '=', 'Masuk')->count();
$jumlah_izin_telat = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Telat')->count();
$jumlah_izin_pulang_cepat = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Pulang Cepat')->count();
$libur = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Libur')->count();
$timestamp_mulai = strtotime($tanggal_mulai);
$timestamp_akhir = strtotime($tanggal_akhir);
$selisih_timestamp = $timestamp_akhir - $timestamp_mulai;
$jumlah_hari = (floor($selisih_timestamp / (60 * 60 * 24)))+1;
$persentase_kehadiran = (($jumlah_hadir + $jumlah_izin_telat + $jumlah_izin_pulang_cepat + $libur) / $jumlah_hari) * 100;
@endphp
@error('persentase_kehadiran')
{{ $message }}
@enderror