I need to generate a report in Excel with Cabecera, that is, add who did it, the department, the time I downloaded the excel from the page. etc ... etc ... I already generate the report, but I have no idea how to add the other.
This is the file that is downloaded
header('Content-Type:text/csv; charset=latin1');
header('Content-Disposition: attachment; filename="Reporte Marcaje.xls"');
$conn=new PDO('mssql:host=192.168.20.219; dbname=Intranet', 'adam', 'adam219');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$confech=$conn->query("SELECT * FROM marcaje");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document</title>
</head>
<body>
<table class="table" id="ocultarFecha">
<tr>
<td class="nombreNegrita">Fecha Entrada</td>
<td class="nombreNegrita">Hora Entrada</td>
<td class="nombreNegrita">Cédula</td>
<td class="nombreNegrita">Nombre</td>
<td class="nombreNegrita">Cargo</td>
<td class="nombreNegrita">Departamento</td>
<td class="nombreNegrita">Fecha de Revista</td>
<td class="nombreNegrita">Hora de Revista</td>
<td class="nombreNegrita">Encargado</td>
<td class="nombreNegrita">Cargo</td>
<td class="nombreNegrita">Departamento</td>
<td class="nombreNegrita">Sucursal</td>
</tr>
<?php
while($row=$confech->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><?php echo $row['fechEntrada']; ?></td>
<td><?php echo $row['horaEntrada']; ?></td>
<td><?php echo $row['cedula']; ?></td>
<td><?php echo $row['nombre']; ?></td>
<td><?php echo $row['cargo']; ?></td>
<td><?php echo $row['departamento']; ?></td>
<td><?php echo $row['fechRevista']; ?></td>
<td><?php echo $row['horaRevista']; ?></td>
<td><?php echo $row['usuario_sesion']; ?></td>
<td><?php echo $row['cargo_sesion']; ?></td>
<td><?php echo $row['departamento_sesion']; ?></td>
<td><?php echo $row['sucursal_sesion']; ?></td>
</tr>
<?php } ?>
</table>
</body>
</html>
Even, I tried to do it with the PHPExcel library and I do not get anything.