Download Blangko Kartu Keluarga Kosong Excel (macOS EXTENDED)

// ------------------------------- // 3. Table Header: Anggota Keluarga // ------------------------------- $row = 8; $headers = [ 'NO', 'NIK', 'NAMA LENGKAP', 'JENIS KELAMIN', 'TEMPAT LAHIR', 'TANGGAL LAHIR', 'HUBUNGAN KELUARGA', 'KETERANGAN' ]; $col = 'A'; foreach ($headers as $header) $sheet->setCellValue($col . $row, $header); $sheet->getStyle($col . $row)->getFont()->setBold(true); $sheet->getStyle($col . $row)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $sheet->getStyle($col . $row)->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('FFD9E1F2'); $col++;

// ------------------------------- // 1. Header: KARTU KELUARGA // ------------------------------- $sheet->mergeCells('A1:H1'); $sheet->setCellValue('A1', 'KARTU KELUARGA'); $sheet->getStyle('A1')->getFont()->setBold(true)->setSize(16); $sheet->getStyle('A1')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);

// Create new Spreadsheet $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); Download Blangko Kartu Keluarga Kosong Excel

// ------------------------------- // 6. Output File // ------------------------------- $filename = 'Blangko_KK_Kosong_' . date('Ymd') . '.xlsx'; header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="' . $filename . '"'); header('Cache-Control: max-age=0');

$row++; $sheet->setCellValue("A$row", 'RT/RW:'); $sheet->setCellValue("B$row", '____ / ____'); $sheet->setCellValue("D$row", 'Kel/Desa:'); $sheet->setCellValue("E$row", ' '); $sheet->setCellValue("G$row", 'Kecamatan:'); $sheet->setCellValue("H$row", ' '); // ------------------------------- // 3

wb.save("Blangko_KK_Kosong.xlsx") <button onclick="downloadKK()">📥 Download Blangko KK Kosong (Excel)</button> <script> function downloadKK() window.location.href = 'download_kk_blank.php';

// ------------------------------- // 4. Empty Rows (for 10 family members) // ------------------------------- for ($i = 1; $i <= 10; $i++) $dataRow = $row + $i; $sheet->setCellValue("A$dataRow", $i); for ($colIdx = 'B'; $colIdx <= 'H'; $colIdx++) $sheet->setCellValue($colIdx . $dataRow, ''); '(Nama jelas & stempel)')

$row++; $sheet->setCellValue("A$row", 'Alamat:'); $sheet->setCellValue("B$row", '_________________________'); $sheet->mergeCells("B$row:H$row");

// ------------------------------- // 2. Kepala Keluarga Info // ------------------------------- $row = 4; $sheet->setCellValue("A$row", 'Nama Kepala Keluarga:'); $sheet->setCellValue("B$row", '_________________________'); $sheet->mergeCells("B$row:H$row"); $sheet->getStyle("A$row")->getFont()->setBold(true);

// Set title $sheet->setTitle('Blangko KK');

// ------------------------------- // 5. Footer (Tanda Tangan & Info) // ------------------------------- $footerRow = $row + 12; $sheet->setCellValue("G$footerRow", 'Kepala Desa/Lurah,'); $footerRow++; $sheet->setCellValue("G$footerRow", '_________________________'); $footerRow++; $sheet->setCellValue("G$footerRow", '(Nama jelas & stempel)');