Upload New File

parent 6570180f
<?php
include('function.php');
// menampilkan data
$query = "SELECT t_tiketsdia.id ,t_tiketsdia.kode_tiket, destinasi.nama_destinasi, pt_trans.nama_transp, t_tiketsdia.harga
FROM pt_trans INNER JOIN (destinasi INNER JOIN t_tiketsdia ON destinasi.id_destinasi = t_tiketsdia.t_destinasi) ON pt_trans.id_transp = t_tiketsdia.t_kendaraan;
";
$data = mysqli_query($koneksi,$query);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<style type="text/css">
body{
font-family: sans-serif;
}
table{
margin: 20px auto;
border-collapse: collapse;
}
table th,
table td{
border: 1px solid #3c3c3c;
padding: 3px 8px;
}
</style>
<?php
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Data_Tiket.xls");
?>
<center>
<h1>Daftar Tiket<br/> Travel OK</h1>
</center>
<table border="1">
<tr>
<th scope="col">Kode Tiket</th>
<th scope="col">Tujuan Destinasi</th>
<th scope="col">Kendaraan</th>
<th scope="col">Harga</th>
</tr>
<?php
while($tiket = mysqli_fetch_array($data)) { ?>
<tr>
<td align="center"><?= $tiket['kode_tiket'] ?></td>
<td align="center"><?= $tiket['nama_destinasi'] ?></td>
<td align="center"><?= $tiket['nama_transp'] ?></td>
<td>Rp. <?= $tiket['harga'] ?></td>
</tr>
<?php } ?>
</table>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment