-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexportkeluar.php
116 lines (104 loc) · 6.23 KB
/
exportkeluar.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
require 'function.php';
require 'cek.php';
?>
<html>
<title>Laporan Barang Keluar</title>
<div class="container py-5">
<a href="keluar.php" class="btn btn-primary">< Back</a>
<header class="text-center">
<h1 class="display-4">Laporan Barang Keluar</h1>
<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>
</header>
<body>
<div class="container">
<h2>Record Barang Keluar</h2>
<div class="row">
<form method="post" class="form-inline">
<input type="date" name="tgl_mulai" class="form-control ml-3">
<input type="date" name="tgl_selesai" class="form-control ml-3">
<button type="submit" name="filter_tgl" class="btn btn-info ml-3"> Filter </button>
</form>
</div>
<div class="data-tables datatable-dark">
<table class="table table-bordered" id="mauexportkeluar" width="100%" cellspacing="0">
<thead>
<tr>
<th>Tanggal</th>
<th>Nama Barang</th>
<th>Penerima</th>
<th>Qty</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
if(isset($_POST['filter_tgl'])){
$mulai = $_POST['tgl_mulai'];
$selesai = $_POST['tgl_selesai'];
if($mulai!=null || $selesai!=null){
$ambilsemuadatastock = mysqli_query($conn, "select * from keluar k, stock s where s.idbarang = k.idbarang and tanggal BETWEEN '$mulai' and DATE_ADD('$selesai',INTERVAL 1 DAY) order by idkeluar DESC");
} else {
$ambilsemuadatastock = mysqli_query($conn, "select * from keluar k, stock s where s.idbarang = k.idbarang");
}
}else {
$ambilsemuadatastock = mysqli_query($conn, "select * from keluar k, stock s where s.idbarang = k.idbarang");
}
while($data = mysqli_fetch_array($ambilsemuadatastock)){
$idk = $data['idkeluar'];
$idb = $data['idbarang'];
$tanggal = $data['tanggal'];
$namabarang = $data['namabarang'];
$qty = $data['qty'];
$penerima = $data['penerima'];
?>
<tr>
<td><?=$tanggal;?></td>
<td><?=$namabarang;?></td>
<td><?=$penerima;?></td>
<td><?=$qty;?></td>
<td>
<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#edit<?=$idk;?>">
Edit
</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete<?=$idk;?>">
Delete
</button>
</td>
</tr>
<?php
};
?>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#mauexportkeluar').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy','csv','excel', 'print'
]
} );
} );
</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>