rows = app(KeseluruhanController::class)->getRekapRows($tahun, $jenisPegawai, $unit); } public function array(): array { return $this->rows; } public function headings(): array { return [ 'No.', 'Nama', 'NIP', 'Jenis Pegawai', 'Unit Kerja', 'Jumlah P1', 'Jumlah P2', 'Jumlah THR', 'Jumlah R13', 'Jumlah Publikasi', 'Total', ]; } public function map($row): array { static $no = 0; $no++; return [ $no, $row['nama'], $row['nip'], $row['jenis_pegawai'] === 'dosen' ? 'Dosen' : ($row['jenis_pegawai'] === 'tendik' ? 'Tendik' : '-'), $row['nama_unit'], $row['jumlah_p1'], $row['jumlah_p2'], $row['jumlah_thr'], $row['jumlah_r13'], $row['jumlah_publikasi'], $row['total'], ]; } public function columnFormats(): array { $accountingFormat = '_("Rp"\ * #,##0.00_);_("Rp"\ * \-#,##0.00_);_("Rp"\ * "-"??_);_(@_)'; return [ 'C' => '@', 'F' => $accountingFormat, 'G' => $accountingFormat, 'H' => $accountingFormat, 'I' => $accountingFormat, 'J' => $accountingFormat, 'K' => $accountingFormat, ]; } public function styles(Worksheet $sheet) { return [ 1 => [ 'font' => ['bold' => true, 'color' => ['rgb' => 'FFFFFF']], 'fill' => [ 'fillType' => Fill::FILL_SOLID, 'startColor' => ['rgb' => '4472C4'], ], 'alignment' => [ 'horizontal' => Alignment::HORIZONTAL_CENTER, 'vertical' => Alignment::VERTICAL_CENTER, ], ], ]; } }