This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
printListKerusakan.php
62 lines (62 loc) · 1.93 KB
/
printListKerusakan.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
56
57
58
59
60
61
62
<html>
<head>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
</head>
<body onLoad="window.print();">
<?php
include_once 'php_action/db_connect.php';
?>
<style type="text/css">
body {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
}
.style1{
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
}
</style>
<h1 align="center">LAPORAN DATA KERUSAKAN</h1>
<div class="container">
<table class="table table-bordered" id="DataTables" width="100%" cellspacing="0">
<thead>
<tr>
<th style="width:5px">No</th>
<th>No Kerusakan</th>
<th>No Inventaris</th>
<th>Tanggal Kerusakan</th>
<th>Seri Barang</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$fetchBarang = mysqli_query($connect, "SELECT kerusakan.no_kerusakan, barang.no_inventaris, kerusakan.tgl_kerusakan, barang.seri_barang, kerusakan.status, kerusakan.keterangan, kerusakan.tgl_perbaikan, kerusakan.harga_perbaikan
FROM kerusakan INNER JOIN barang ON kerusakan.no_inventaris = barang.no_inventaris");
if ($fetchBarang->num_rows > 0) {
$no = 1;
while ($rowKerusakan = $fetchBarang->fetch_array()) {
?>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $rowKerusakan[0]; ?></td>
<td><?php echo $rowKerusakan[1]; ?></td>
<td><?php echo date('d F Y', strtotime($rowKerusakan[2]));?></td>
<td><?php echo $rowKerusakan[3]; ?></td>
<td><?php
if ($rowKerusakan[4] == 1) {
echo "<span class='badge badge-success'>Aktif</span>";
}
else {
echo "<span class='badge badge-danger'>Tidak Aktif</span>";
} ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</body>
</html>