{{--Perangkat Daerah--}} @foreach ($listSkpd as $idxOpd => $opd) @php $organisasi = $opd->organisasi; $tujuan = $organisasi->renstraTujuan; $sasaran = $tujuan->pluck('renstraSasaran')->collapse(); $sasaranIndikator = $sasaran->pluck('renstraSasaranIndikator')->collapse(); $target = $sasaranIndikator->pluck('renstraSasaranIndikatorTarget')->collapse(); $trxIku = $sasaranIndikator->pluck('trxIku')->map(function ($q, $i) use($target) { $trxIku = $q->last(); if (!is_null($trxIku)) { $target = $target->where('renstra_sasaran_indikator_id', $trxIku->rencana_kinerja_id)->first(); $trxRkt = $trxIku->trxRkt; $trxPk = $trxRkt->trxPk->last(); if (!is_null($trxPk)) { $trxRenaksi = $trxPk->trxPkDetail->where('trx_rkt_id', $trxRkt->id)->last()->trxRenaksi; $trxIku->renaksi = $trxRenaksi; $trxIku->capaian = $trxRkt->persentase; $trxIku->has_pk = true; } else { $trxIku->capaian = 0; $trxIku->has_pk = false; } } return $trxIku; }); $targetNotNull = $trxIku->filter(function ($iku){ return !is_null($iku); })->values(); $label1 = $trxIku->where('capaian', '<=', 50)->where('has_pk', true); $label2 = $trxIku->where('capaian', '>', 50)->where('capaian', '<=', 65)->where('has_pk', true); $label3 = $trxIku->where('capaian', '>', 65)->where('capaian', '<=', 75)->where('has_pk', true); $label4 = $trxIku->where('capaian', '>', 75)->where('capaian', '<=', 90)->where('has_pk', true); $label5 = $trxIku->where('capaian', '>', 90)->where('capaian', '<=', 100)->where('has_pk', true); $label6 = $trxIku->where('capaian', '>', 100)->where('has_pk', true) @endphp {!! $idxOpd + 2 !!} @if(\Illuminate\Support\Facades\Auth::user()) {!! strtoupper($opd->nama) !!} @else {!! strtoupper($opd->nama) !!} @endif {{--Triwulan--}} @foreach (['I', 'II', 'III', 'IV'] as $triwulan) @php $renaksi = $trxIku->map(function ($v) use($triwulan) { if(isset($v->renaksi)) { $v->triwulan = $v->renaksi->where('triwulan', $triwulan)->whereNotNull('target_fisik')->last(); if (!is_null($v->triwulan) && !is_null($v->triwulan->realisasi_fisik) && $v->triwulan->target_fisik != 0 && $v->triwulan->realisasi_fisik != 0) { $v->capaian_triwulan = $v->triwulan?->persentase_fisik; } else { $v->capaian_triwulan = 0; } } return $v; }); $targetTriwulan = $renaksi->whereNotNull('triwulan'); $labelTriwulan1 = $targetTriwulan->where('capaian_triwulan', '>=', 0)->where('capaian_triwulan', '<=', 50); $labelTriwulan2 = $targetTriwulan->where('capaian_triwulan', '>', 50)->where('capaian_triwulan', '<=', 65); $labelTriwulan3 = $targetTriwulan->where('capaian_triwulan', '>', 65)->where('capaian_triwulan', '<=', 75); $labelTriwulan4 = $targetTriwulan->where('capaian_triwulan', '>', 75)->where('capaian_triwulan', '<=', 90); $labelTriwulan5 = $targetTriwulan->where('capaian_triwulan', '>', 90)->where('capaian_triwulan', '<=', 100); $labelTriwulan6 = $targetTriwulan->where('capaian_triwulan', '>', 100); if (str_contains($opd->nama, 'Dinas Koperasi')) { $namaOPD = 'DINAS KOPERASI USAHA KECIL DAN MENENGAH, PERINDUSTRIAN DAN TENAGA KERJA'; } else { $namaOPD = strtoupper($opd->nama); } @endphp Triwulan {!! $triwulan !!} {{--Jumlah Target--}} @if ($targetTriwulan?->count() > 0) {!! $targetTriwulan?->count() !!} @endif {{--Target <= 50--}} @if ($labelTriwulan1?->count() > 0) {!! $labelTriwulan1?->count() !!} @endif {{--Target > 50 <= 65--}} @if ($labelTriwulan2?->count() > 0) {!! $labelTriwulan2?->count() !!} @endif {{--Target > 65 <= 75--}} @if ($labelTriwulan3?->count() > 0) {!! $labelTriwulan3?->count() !!} @endif {{--Target > 75 <= 90--}} @if ($labelTriwulan4?->count() > 0) {!! $labelTriwulan4?->count() !!} @endif {{--Target > 90 <= 100--}} @if ($labelTriwulan5?->count() > 0) {!! $labelTriwulan5?->count() !!} @endif {{--Target > 100--}} @if ($labelTriwulan6?->count() > 0) {!! $labelTriwulan6?->count() !!} @endif {{--Jumlah Indikator--}} @if ($target?->count() > 0) {!! $target?->count() !!} @endif @auth @php $rekomendasi = $opd->rekomendasi_pengukuran ->where('triwulan',$triwulan) ->where('jenis',$request['jenis_apbd']); @endphp @if(\Illuminate\Support\Facades\Auth::user()->hasRole('adminKab')) @if($rekomendasi->first()==null) @else @endif @else @php $own_kode_organisasi = \Illuminate\Support\Facades\Auth::user()->kode_organisasi; @endphp @if($opd->kode_organisasi===$own_kode_organisasi) @if($rekomendasi->first()!=null) @else {{ $rekomendasi->first()?->recomend }} @endif @else - @endif @endif @endauth @endforeach {{--Tahunan--}} Tahun {!! $tahun !!} {{--Jumlah Target--}} @if ($targetNotNull->count() > 0) {!! $targetNotNull->count() !!} @endif {{--Target <= 50--}} @if ($label1?->count() > 0) {!! $label1?->count() !!} @endif {{--Target > 50 <= 65--}} @if ($label2?->count() > 0) {!! $label2?->count() !!} @endif {{--Target > 65 <= 75--}} @if ($label3?->count() > 0) {!! $label3?->count() !!} @endif {{--Target > 75 <= 90--}} @if ($label4?->count() > 0) {!! $label4?->count() !!} @endif {{--Target > 90 <=100--}} @if ($label5?->count() > 0) {!! $label5?->count() !!} @endif {{--Target > 100--}} @if ($label6?->count() > 0) {!! $label6?->count() !!} @endif {{--Jumlah Indikator--}} @if ($sasaranIndikator->count() > 0) {!! $sasaranIndikator->count() !!} @endif @endforeach