-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaporan.php
173 lines (160 loc) · 6.89 KB
/
laporan.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
include 'database.php';
session_start();
if (@$_SESSION['username'] == '') {
echo "<script>
alert('Silahkan Login Dahulu...')
window.location='logindirektur.php';
</script>";
}
function fetch_data(){
$output = '';
include 'database.php';
$result = mysqli_query($conn, "SELECT * FROM tb_barang ORDER BY id DESC");
$no= 1;
while($res = mysqli_fetch_array($result))
{
$output.='
<tr>
<th scope="row">'.$no++.'</th>
<td>'.$res['kode_barang'].'</td>
<td>'.$res['nama_barang'].'</td>
<td><'.$res['jenis_barang'].'</td>
<td>'.number_format($res['pemasukan']).'</td>
<td>'.number_format($res['pengeluaran']).'</td>
</tr>
<?php
}
?>
';
}
return $output;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Laporan</title>
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/ruang-admin.min.css" rel="stylesheet">
</head>
<body id="page-top">
<div id="wrapper">
<!-- Sidebar -->
<ul class="navbar-nav sidebar sidebar-light accordion" id="accordionSidebar">
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
<div class="sidebar-brand-icon">
</div>
<div class="sidebar-brand-text mx-3">DIREKTUR</div>
</a>
<hr class="sidebar-divider my-0">
<li class="nav-item active">
<a class="nav-link" href="home.php">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Home</span></a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="datametal.php">
<i class="fas fa-fw fa-chart-area"></i>
<span>Data Metal</span>
</a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="pemasukan.php">
<i class="fas fa-fw fa-chalkboard"></i>
<span>Pemasukan</span>
</a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="pengeluaran.php">
<i class="fas fa-fw fa-chalkboard-teacher"></i>
<span>Pengeluaran</span>
</a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="stockbarang.php">
<i class="fas fa-fw fa-store"></i>
<span>Stok Barang</span>
</a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="laporan.php">
<i class="fas fa-fw fa-chart-pie"></i>
<span>Laporan</span>
</a>
</li>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="logout.php">
<i class="fas fa-fw fa-closed-captioning"></i>
<span>Logout</span>
</a>
</li>
</ul>
<!-- Sidebar -->
<div id="content-wrapper" class="d-flex flex-column">
<div id="content">
<!-- TopBar -->
<nav class="navbar navbar-expand navbar-light bg-navbar topbar mb-4 static-top">
<button id="sidebarToggleTop" class="btn btn-link rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<ul>
<li>
<h3 style="color: aliceblue; margin-left: 5rem; margin-top: 1rem;">SISTEM INFORMASI
INVENTORY BARANG METAL</h3>
</li>
</ul>
</nav>
<!-- Topbar -->
<div class="user" style="text-align:center; justify-content:center; margin:2rem">
<div class="text-center">
<div class="pdf">
<a class='btn btn-primary' href="printpdf.php" target='_BLANK'>Print Pdf</a>
</div>
<div class="componenCard"
style="margin: 1rem; justify-content: center; display: flex; flex-wrap: wrap;">
<h5>Laporan</h5>
<table class="table">
<thead>
<tr>
<th scope="col">NO</th>
<th scope="col">Kode Barang</th>
<th scope="col">Nama Barang</th>
<th scope="col">Jenis Brang</th>
<th scope="col">Pemasukan</th>
<th scope="col">Pengeluaran</th>
</tr>
</thead>
<tbody>
<?php
echo fetch_data();
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Scroll to top -->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="js/ruang-admin.min.js"></script>
<script src="vendor/chart.js/Chart.min.js"></script>
<script src="js/demo/chart-area-demo.js"></script>
</body>
</html>