@php $settings = App\Models\settings::first(); $logo_path = storage_path('app/public/' . $settings->logo); if (file_exists($logo_path)) { $logo_mime = mime_content_type($logo_path); $logo_data = base64_encode(file_get_contents($logo_path)); } else { $logo_mime = null; $logo_data = null; } @endphp
@if($logo_data) @endif

{{ $settings->name }}

{{ $settings->alamat }}
{{ $settings->email }} - {{ $settings->phone }}
Export Rekap
@foreach ($data as $d) @php $tanggal_mulai = request()->input('mulai'); $tanggal_akhir = request()->input('akhir'); $cuti = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Cuti')->count(); $izin_masuk = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Masuk')->count(); $izin_telat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Telat')->count(); $izin_pulang_cepat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Pulang Cepat')->count(); $masuk = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Masuk')->count(); $total_hadir = $masuk + $izin_telat + $izin_pulang_cepat; $libur = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Libur')->count(); $mulai = new \DateTime($tanggal_mulai); $akhir = new \DateTime($tanggal_akhir); $interval = $mulai->diff($akhir); $total_alfa = $interval->days + 1 - $masuk - $cuti - $izin_masuk - $libur; $total_telat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->sum('telat'); $jam = floor($total_telat / (60 * 60)); $menit = $total_telat - ( $jam * (60 * 60) ); $menit2 = floor($menit / 60); $jumlah_telat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('telat', '>', 0)->count(); $total_pulang_cepat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->sum('pulang_cepat'); $jam_cepat = floor($total_pulang_cepat / (60 * 60)); $menit_cepat = $total_pulang_cepat - ( $jam_cepat * (60 * 60) ); $menit_cepat2 = floor($menit_cepat / 60); $jumlah_pulang_cepat = $d->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('pulang_cepat', '>', 0)->count(); $total_lembur = $d->Lembur->where('status', 'Approved')->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->sum('total_lembur'); $jam_lembur = floor($total_lembur / (60 * 60)); $menit_lembur = $total_lembur - ( $jam_lembur * (60 * 60) ); $menit_lembur2 = floor($menit_lembur / 60); $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 = (($total_hadir + $libur) / $jumlah_hari) * 100; @endphp @endforeach
Nama Pegawai Cuti Izin Masuk Izin Telat Izin Pulang Cepat Hadir Alfa Libur Total Telat Total Pulang Cepat Total Lembur Persentase Kehadiran
{{ $d->name }} {{ $cuti }} x {{ $izin_masuk }} x {{ $izin_telat }} x {{ $izin_pulang_cepat }} x {{ $total_hadir }} x {{ $total_alfa }} x {{ $libur }} x

{{ $jam . " Jam " . $menit2 . " Menit" }}

{{ $jumlah_telat . " x" }}

{{ $jam_cepat . " Jam " . $menit_cepat2 . " Menit" }}

{{ $jumlah_pulang_cepat . " x" }}

{{ $jam_lembur." Jam ".$menit_lembur2." Menit" }} {{ $persentase_kehadiran }} x