-
Notifications
You must be signed in to change notification settings - Fork 4
/
laporan-lembur-excel.php
55 lines (53 loc) · 1.58 KB
/
laporan-lembur-excel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
include "koneksi.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Export data lembur</title>
</head>
<body>
<?php
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Data Lembur.xls");
?>
<table class="table table-striped" id="table-1">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>Tanggal</th>
<th>Jam Mulai</th>
<th>Jam Selesai</th>
<th>Aktivitas</th>
<th>Approval Unit</th>
<th>Approval Cabang</th>
<th>Approval Final</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
$kueri = $conn->prepare("SELECT * FROM tb_lembur ORDER BY tanggal ASC");
$kueri->execute();
while($tampil = $kueri->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><?php echo $no++;?></td>
<td><?php echo $tampil['nama'];?></td>
<td><?php echo $tampil['tanggal'];?></td>
<td><?php echo $tampil['jam_mulai'];?></td>
<td><?php echo $tampil['jam_selesai'];?></td>
<td><?php echo $tampil['aktivitas'];?></td>
<td><?php if($tampil['approval_unit']){ echo "Sudah di setujui";}?></td>
<td><?php if($tampil['approval_cabang']){ echo "Sudah di setujui";}?></td>
<td><?php if($tampil['approval_final']){ echo "Sudah di setujui";}?></td>
</tr>
<?php } ?>
</tbody>
</table>
</body>
</html>