$sheet->setCellValue('A' . $row_cnt, $docAccess->getType()); $sheet->duplicateStyleArray($style_thead_subcategory, 'A' . $row_cnt . ':' . numToLetter($theads_cnt) . $row_cnt); $sheet->mergeCells('A' . $row_cnt . ':' . numToLetter($theads_cnt) . $row_cnt); $current_type = $docAccess->getTypeId(); $row_cnt++; } // Ligne accès $sheet->setCellValue('A' . $row_cnt, $docAccess->getName()); // Name $sheet->setCellValue('B' . $row_cnt, $docAccess->getDocumentName()); // Document Name $sheet->setCellValue('C' . $row_cnt, $docAccess->reference); // Reference $sheet->setCellValue('D' . $row_cnt, $docAccess->getFileSize()); // Size $sheet->duplicateStyleArray($style_access_line, 'A' . $row_cnt . ':' . numToLetter($theads_cnt) . $row_cnt); // Enregistrer les indexs de lignes utilisés $sheet_indexes[$sheet_cnt - 1][] = $row_cnt; $i++; $row_cnt++; } $stmt = NULL; unset($stmt); /* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */ /* ------------------------------ Vidéos ------------------------------ */ /* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */ // $query = " // SELECT a.*,m.id_media,m.basename,m.dirname,m.srcname,c.nom categorie, c.id_categorie, p.id_avion, p.nom avion // FROM medias_acces a
$sheet->getColumnDimension('A')->setAutoSize(true); $sheet->getColumnDimension('B')->setAutoSize(true); $sheet->getColumnDimension('C')->setAutoSize(true); $sheet->getColumnDimension('D')->setAutoSize(true); // $sheet->getColumnDimension('A')->setWidth(36); // $sheet->getColumnDimension('B')->setWidth(60); // $sheet->getColumnDimension('C')->setWidth(10); // $sheet->getColumnDimension('D')->setWidth(10); // DATE $sheet->setCellValue('A1', 'Generated : ' . date('D,M dS Y')); $sheet->setCellValue('A2', 'From : ' . $date_from->format('D,M dS Y')); $sheet->setCellValue('A3', 'To : ' . $date_to->format('D,M dS Y')); // TITRE FEUILLE $sheet->setTitle('falcon'); $sheet->setCellValue('A' . $title_line, 'Aucune entrée trouvée'); $sheet->duplicateStyleArray($style_titre, 'A' . $title_line . ':' . numToLetter($theads_cnt) . $title_line); $sheet->mergeCells('A' . $title_line . ':' . numToLetter($theads_cnt) . $title_line); // EN TETES foreach ($theads as $i => $val) { $sheet->setCellValue(numToLetter($i + 1) . $thead_line, $val); } $sheet->duplicateStyleArray($style_thead, 'A' . $thead_line . ':' . numToLetter($theads_cnt) . $thead_line); } $workbook->setActiveSheetIndex(0); $writer = new PHPExcel_Writer_Excel2007($workbook); $writer->setOffice2003Compatibility(true); header('Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition:inline;filename=falcon_export_statistics_from_' . $date_from->format('Y-m-d') . '_to_' . $date_to->format('Y-m-d') . '.xlsx'); // header('Content-type: application/vnd.ms-excel'); $writer->save('php://output'); }