<?php

include '../config/koneksi.php';

header(
"Content-type: application/vnd-ms-excel"
);

header(
"Content-Disposition: attachment; filename=data_berkas.xls"
);

?>

<table border="1">

<tr>

<th>No</th>
<th>Nomor Surat</th>
<th>Nama Berkas</th>
<th>Asal Kantor</th>
<th>Status</th>

</tr>

<?php

$no = 1;

$data = mysqli_query(
$conn,
"SELECT * FROM berkas"
);

while($d = mysqli_fetch_assoc($data)){

?>

<tr>

<td><?= $no++; ?></td>

<td><?= $d['nomor_surat']; ?></td>

<td><?= $d['nama_berkas']; ?></td>

<td><?= $d['asal_kantor']; ?></td>

<td><?= $d['status']; ?></td>

</tr>

<?php } ?>

</table>