-
Notifications
You must be signed in to change notification settings - Fork 2
/
admin.php
194 lines (166 loc) · 6.35 KB
/
admin.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
<?php
ob_start();
//cek session
session_start();
if(empty($_SESSION['admin'])){
$_SESSION['err'] = '<center>Anda harus login terlebih dahulu!</center>';
header("Location: ./");
die();
} else {
?>
-->
<!doctype html>
<html lang="en">
<!-- Include Head START -->
<?php include('include/head.php'); ?>
<!-- Include Head END -->
<!-- Body START -->
<body class="bg">
<!-- Header START -->
<header>
<!-- Include Navigation START -->
<?php include('include/menu.php'); ?>
<!-- Include Navigation END -->
</header>
<!-- Header END -->
<!-- Main START -->
<main>
<!-- container START -->
<div class="container">
<?php
if(isset($_REQUEST['page'])){
$page = $_REQUEST['page'];
switch ($page) {
case 'tsm':
include "transaksi_surat_masuk.php";
break;
case 'ctk':
include "cetak_disposisi.php";
break;
case 'tsk':
include "transaksi_surat_keluar.php";
break;
case 'asm':
include "agenda_surat_masuk.php";
break;
case 'ask':
include "agenda_surat_keluar.php";
break;
case 'ref':
include "referensi.php";
break;
case 'sett':
include "pengaturan.php";
break;
case 'pro':
include "profil.php";
break;
case 'gsm':
include "galeri_sm.php";
break;
case 'gsk':
include "galeri_sk.php";
break;
}
} else {
?>
<!-- Row START -->
<div class="row">
<!-- Include Header Instansi START -->
<?php include('include/header_instansi.php'); ?>
<!-- Include Header Instansi END -->
<!-- Welcome Message START -->
<div class="col s12">
<div class="card">
<div class="card-content">
<h4>Selamat Datang <?php echo $_SESSION['nama']; ?></h4>
<p class="description">Anda login sebagai
<?php
if($_SESSION['admin'] == 1){
echo "<strong>Super Admin</strong>. Anda memiliki akses penuh terhadap sistem.";
} elseif($_SESSION['admin'] == 2){
echo "<strong>Administrator</strong>. Berikut adalah statistik data yang tersimpan dalam sistem.";
} else {
echo "<strong>Petugas Disposisi</strong>. Berikut adalah statistik data yang tersimpan dalam sistem.";
}?></p>
</div>
</div>
</div>
<!-- Welcome Message END -->
<?php
//menghitung jumlah surat masuk
$count1 = mysqli_num_rows(mysqli_query($config, "SELECT * FROM tbl_surat_masuk"));
//menghitung jumlah surat masuk
$count2 = mysqli_num_rows(mysqli_query($config, "SELECT * FROM tbl_surat_keluar"));
//menghitung jumlah surat masuk
$count3 = mysqli_num_rows(mysqli_query($config, "SELECT * FROM tbl_disposisi"));
//menghitung jumlah klasifikasi
$count4 = mysqli_num_rows(mysqli_query($config, "SELECT * FROM tbl_klasifikasi"));
//menghitung jumlah pengguna
$count5 = mysqli_num_rows(mysqli_query($config, "SELECT * FROM tbl_user"));
?>
<!-- Info Statistic START -->
<div class="col s12 m4">
<div class="card cyan">
<div class="card-content">
<span class="card-title white-text"><i class="material-icons md-36">mail</i> Jumlah Surat Masuk</span>
<?php echo '<h5 class="white-text link">'.$count1.' Surat Masuk</h5>'; ?>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card lime darken-1">
<div class="card-content">
<span class="card-title white-text"><i class="material-icons md-36">drafts</i> Jumlah Surat Keluar</span>
<?php echo '<h5 class="white-text link">'.$count2.' Surat Keluar</h5>'; ?>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card yellow darken-3">
<div class="card-content">
<span class="card-title white-text"><i class="material-icons md-36">description</i> Jumlah Disposisi</span>
<?php echo '<h5 class="white-text link">'.$count3.' Disposisi</h5>'; ?>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card deep-orange">
<div class="card-content">
<span class="card-title white-text"><i class="material-icons md-36">class</i> Jumlah Klasifikasi Surat</span>
<?php echo '<h5 class="white-text link">'.$count4.' Klasifikasi Surat</h5>'; ?>
</div>
</div>
</div>
<?php
if($_SESSION['id_user'] == 1 || $_SESSION['admin'] == 2){?>
<div class="col s12 m4">
<div class="card blue accent-2">
<div class="card-content">
<span class="card-title white-text"><i class="material-icons md-36">people</i> Jumlah Pengguna</span>
<?php echo '<h5 class="white-text link">'.$count5.' Pengguna</h5>'; ?>
</div>
</div>
</div>
<!-- Info Statistic START -->
<?php
}
?>
</div>
<!-- Row END -->
<?php
}
?>
</div>
<!-- container END -->
</main>
<!-- Main END -->
<!-- Include Footer START -->
<?php include('include/footer.php'); ?>
<!-- Include Footer END -->
</body>
<!-- Body END -->
</html>
<?php
}
?>