-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.php
99 lines (97 loc) · 3.46 KB
/
export.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
// Import koneksi ke database
require 'function.php';
require 'cek.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stock Barang</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
<style>
body {
background-color: #f8f9fa;
}
.container {
margin-top: 20px;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2, h4 {
color: #343a40;
}
table {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h2 class="text-center">Stock Bahan</h2>
<h4 class="text-center">(Inventory)</h4>
<div class="data-tables datatable-dark">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="mauexport" width="100%" cellspacing="0">
<thead class="thead-dark">
<tr>
<th>No</th>
<th>Nama Barang</th>
<th>Deskripsi</th>
<th>Stock</th>
</tr>
</thead>
<tbody>
<?php
$result = mysqli_query($conn, "SELECT * FROM stock");
$i = 1;
while($row = mysqli_fetch_assoc($result)) {
$idbarang = $row['idbarang'];
$namabarang = $row['namabarang'];
$deskripsi = $row['deskripsi'];
$stock = $row['stock'];
?>
<tr>
<td><?=$i++;?></td>
<td><?=$namabarang;?></td>
<td><?=$deskripsi;?></td>
<td><?=$stock;?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#mauexport').DataTable({
dom: 'Bfrtip',
buttons: [
'csv', 'excel', 'pdf', 'print'
],
"pagingType": "full_numbers"
});
});
</script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.flash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.print.min.js"></script>
</body>
</html>