-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
280 lines (264 loc) · 13.7 KB
/
index.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?php
require_once "+koneksi.php";
session_start();
if(@$_SESSION['level_adm']) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<!-- <link rel="stylesheet" href="assets/bootstrap-4.1.3/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="assets/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/dist/css/Adminlte.min.css">
<!-- font awesome -->
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
<!-- data tables -->
<link rel="stylesheet" href="assets/DataTables/datatables.min.css">
<!-- sweet alert -->
<link rel="stylesheet" href="assets/sweetalert2/sweetalert2.min.css">
<!-- <link rel="stylesheet" href="assets/sweetalert2/animate.css"> -->
<!-- style css saya -->
<link rel="stylesheet" href="assets/myCSS/StyleKP.css">
<!-- Font -->
<!-- <link href="https://fonts.googleapis.com/css?family=Neucha" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Mukta" rel="stylesheet"> -->
<link href="assets/Fonts/Mukta.css" rel="stylesheet">
<!-- <link href="https://fonts.googleapis.com/css?family=Titillium+Web" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Share+Tech" rel="stylesheet"> -->
<title>Amanah Husada</title>
</head>
<body>
<div class="body">
<div class="main-body">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./">Apotek Amanah Husada</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown <?php if(@$_GET['page']=='obat' || @$_GET['page']=='pegawai' || @$_GET['page']=='supplier' || @$_GET['page']=='tambahdataobat' || @$_GET['page']=='obat_kadaluarsa' || @$_GET['page']=='riwayat_databrg') {echo "active";} ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">MASTER <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="<?php if(@$_GET['page']=='obat' || @$_GET['page']=='tambahdataobat' || @$_GET['page']=='riwayat_databrg') {echo"active";} ?>"><a href="?page=obat">Data Barang</a></li>
<li class="<?php if(@$_GET['page']=='pegawai') {echo"active";} ?>"><a href="?page=pegawai">Data Pegawai</a></li>
<li class="<?php if(@$_GET['page']=='supplier') {echo"active";} ?>"><a href="?page=supplier">Data Supplier</a></li>
<li role="separator" class="divider"></li>
<li class="<?php if(@$_GET['page']=='obat_kadaluarsa') {echo"active";} ?>"><a href="?page=obat_kadaluarsa">Data Obat Kadaluarsa</a></li>
</ul>
</li>
<!-- Transaksi -->
<li class="dropdown <?php if(@$_GET['page']=='penjualan' || @$_GET['page']=='pemesanan' || @$_GET['page']=='pembelian' || @$_GET['page']=='transaksi_penjualan' || @$_GET['page']=='transaksi_pemesanan' || @$_GET['page']=='tambahdata_pembelian') {echo "active";} ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">TRANSAKSI <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="<?php if(@$_GET['page']=='penjualan' || @$_GET['page']=='transaksi_penjualan') {echo"active";} ?>">
<a href="?page=transaksi_penjualan">
Penjualan
</a>
</li>
<?php if($_SESSION['level_adm'] == 'manager' || $_SESSION['level_adm'] == 'apoteker') { ?>
<li class="<?php if(@$_GET['page']=='pembelian' || @$_GET['page']=='tambahdata_pembelian') {echo"active";} ?>">
<a href="?page=tambahdata_pembelian">
Pembelian
</a>
</li>
<li class="<?php if(@$_GET['page']=='pemesanan' || @$_GET['page']=='transaksi_pemesanan') {echo"active";} ?>">
<a href="?page=transaksi_pemesanan">
Pemesanan
</a>
</li>
<?php } ?>
<li role="separator" class="divider"></li>
<li class="<?php if(@$_GET['page']=='laporan_transaksi') {echo"active";} ?>">
<a href="?page=laporan_transaksi">
Laporan Transaksi
</a>
</li>
</ul>
</li>
<!-- Transaksi -->
<!-- Retur -->
<li class="dropdown <?php if(@$_GET['page']=='retur_penjualan' || @$_GET['page']=='transaksi_retur_penjualan' || @$_GET['page']=='retur' || @$_GET['page']=='transaksi_retur' || @$_GET['page']=='laporan_retur') {echo "active";} ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">RETUR <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="<?php if(@$_GET['page']=='retur_penjualan' || @$_GET['page']=='transaksi_retur_penjualan') {echo"active";} ?>"><a href="?page=transaksi_retur_penjualan">Retur Penjualan</a></li>
<?php if($_SESSION['level_adm'] == 'manager' || $_SESSION['level_adm'] == 'apoteker') { ?>
<li class="<?php if(@$_GET['page']=='retur' || @$_GET['page']=='transaksi_retur') {echo"active";} ?>"><a href="?page=transaksi_retur">Retur Pembelian</a></li>
<?php } ?>
<li role="separator" class="divider"></li>
<li class="<?php if(@$_GET['page']=='laporan_retur') {echo"active";} ?>"><a href="?page=laporan_retur">Laporan Retur</a></li>
</ul>
</li>
<!-- Retur -->
<li class="<?php if(@$_GET['page']=='data_kas') {echo"active";} ?>">
<a href="?page=data_kas">KAS </a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="waktu">
<a>
<span>
<?php echo date('d / M / Y'); ?> -
</span>
<span id="jam">
</span>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo @$_SESSION['nama_adm']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="" id="tombol_profil" data-toggle="modal" data-target="#profil" data-id="<?php echo @$_SESSION['id_pgw']; ?>">Profil</a></li>
<li role="separator" class="divider"></li>
<li><a href="?page=logout&level=<?php echo @$_SESSION['level_adm'] ?>">Log Out</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- jquery 3 -->
<script src="assets/Jquery/jquery-3.3.1.min.js"></script>
<!-- sweet alert -->
<script src="assets/sweetalert2/sweetalert2.min.js"></script>
<!-- auto format money -->
<script src="assets/Auto-Format-Currency-With-jQuery/simple.money.format.js"></script>
<!-- input mask robin -->
<script src="assets/InputMask/jquery.inputmask.js"></script>
<script src="assets/InputMask/jquery.inputmask.extensions.js"></script>
<script src="assets/InputMask/inputmask.numeric.extensions.js"></script>
<!-- <div class=""> -->
<div class="container">
<?php
if(@$_GET['page']=='') {
include 'inc/home.php';
}else if(@$_GET['page']=='obat') {
include 'inc/data_obat.php';
}else if(@$_GET['page']=='tambahdataobat') {
include 'inc/tambah_dataobat.php';
}else if(@$_GET['page']=='pegawai') {
include 'inc/pegawai.php';
}else if(@$_GET['page']=='supplier') {
include 'inc/supplier.php';
}else if(@$_GET['page']=='penjualan') {
include 'inc/data_penjualan.php';
}else if(@$_GET['page']=='transaksi_penjualan') {
include 'inc/penjualan.php';
}else if(@$_GET['page']=='pemesanan') {
include 'inc/data_pemesanan.php';
}else if(@$_GET['page']=='transaksi_pemesanan') {
include 'inc/tambah_datapemesanan.php';
}else if(@$_GET['page']=='pembelian') {
include 'inc/pembelian_obat.php';
}else if(@$_GET['page']=='retur') {
include 'inc/data_retur.php';
}else if(@$_GET['page']=='transaksi_retur') {
include 'inc/tambah_dataretur.php';
}else if(@$_GET['page']=='tambahdata_pembelian') {
include 'inc/tambahdata_pembelian2.php';
}else if(@$_GET['page']=='obat_kadaluarsa') {
include 'inc/dataobat_exp3.php';
}else if(@$_GET['page'] == 'logout') {
include "inc/logout.php";
} else if(@$_GET['page'] == 'laporan_transaksi') {
include "inc/laporan_transaksi.php";
} else if(@$_GET['page'] == 'laporan_retur') {
include "inc/laporan_retur.php";
} else if(@$_GET['page'] == 'transaksi_retur_penjualan') {
include "inc/transaksi_retur_penjualan.php";
} else if(@$_GET['page'] == 'retur_penjualan') {
include "inc/data_returpenjualan.php";
} else if(@$_GET['page'] == 'data_kas') {
include "inc/data_kas.php";
} else if(@$_GET['page'] == 'riwayat_databrg') {
include "inc/riwayat_databrg.php";
}
?>
</div>
<div class="modal fade" id="profil">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">Profil Pegawai</h4>
</div>
<div class="modal_body modal_profil" id="modal_profil" style="padding: 10px;">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="pull-right">
<b>Version</b> 1.0
</div>
<strong>Copyright © 2018-2019 Apotek Amanah Husada.</strong> All rights
reserved.
</div>
<!-- </div> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<!-- <script src="assets/bootstrap-4.1.3/js/bootstrap.min.js"></script> -->
<script src="assets/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/DataTables/datatables.min.js"></script>
<script>
$(document).ready(function() {
$('#example1').DataTable({
"pageLength": 50
});
$('#example2').DataTable();
$('#example3').DataTable({
searching: false,
paging: false
});
});
$("#tombol_profil").click(function() {
var id = $(this).data('id');
$.ajax({
url: "inc/detail_transaksi.php?page=profil_pegawai",
type: "POST",
data: "id="+id,
success: function(data) {
$("#modal_profil").html(data);
}
})
});
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
// add a zero in front of numbers<10
m = checkTime(m);
s = checkTime(s);
document.getElementById('jam').innerHTML = h + ":" + m + ":" + s;
t = setTimeout(function() {
startTime()
}, 500);
}
startTime();
</script>
</body>
</html>
<?php
} else {
echo "<script>window.location='login.php';</script>";
} ?>