-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexAdmin.php
199 lines (176 loc) · 6.91 KB
/
indexAdmin.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
<?php
include "function.php";
if (isset($_SESSION['role'])) {
if ($_SESSION['role'] == 1) {
header("location: test.php");
}
} else {
header("location:index.php");
}
$queryPasien = mysqli_query($koneksi, "SELECT * FROM user WHERE role = '1'");
$jumlahPasien = mysqli_query($koneksi, "SELECT COUNT('id_user') as jml_pasien FROM user WHERE role='1'");
$pasien = mysqli_fetch_assoc($jumlahPasien);
$jumlahPenyakit = mysqli_query($koneksi, "SELECT COUNT('id_penyakit') as jml_penyakit FROM penyakit");
$penyakit = mysqli_fetch_assoc($jumlahPenyakit);
$jumlahGejala = mysqli_query($koneksi, "SELECT COUNT('id_gejala') as jml_gejala FROM gejala");
$gejala = mysqli_fetch_assoc($jumlahGejala);
$jumlahSolusi = mysqli_query($koneksi, "SELECT COUNT('id_solusi') as jml_solusi FROM solusi");
$solusi = mysqli_fetch_assoc($jumlahSolusi);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dashboard Admin</title>
<link rel="stylesheet" href="styles.css">
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"/>
<link
href="https://fonts.googleapis.com/css?family=Poppins:300,400,700&display=swap"
rel="stylesheet"/>
</head>
<body >
<div class="kiri">
<section class="logo">
<img src="gambar/logo.png" alt="logo" height="70px" />
</section>
<div class="sidebar-heading">
<h5 class="font-weight-bold text-white text-uppercase teks">Data User</h5>
</div>
<section class="isi">
<a class="nav-link" href="indexAdmin.php">
<span>Data Pasien</span></a>
</section>
<section class="isi">
<a class="nav-link" href="indexPakar.php">
<span>Data Pakar</span></a>
</section>
<div class="sidebar-heading">
<h5 class="font-weight-bold text-white text-uppercase teks">Gejala & Penyakit</h5>
</div>
<section class="isi">
<a class="nav-link" href="indexPenyakit.php">
<span>Data Penyakit</span>
</a>
</section>
<section class="isi">
<a class="nav-link" href="indexGejala.php">
<span>Data Gejala</span>
</a>
</section>
<div class="sidebar-heading">
<h5 class="font-weight-bold text-white text-uppercase teks">Solusi</h5>
</div>
<section class="isi">
<a class="nav-link" href="indexSolusi.php">
<span>Data Solusi</span>
</a>
</section>
<section class="isi">
<a class="nav-link" href="logout.php">
<span>Logout</span>
</a>
</section>
</div>
<div class="kanan">
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Data Pasien</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?= $pasien['jml_pasien']; ?></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">Data Penyakit</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?= $penyakit['jml_penyakit']; ?></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">Data Gejala</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?= $gejala['jml_gejala']; ?></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">Data Solusi</div>
<div class="h5 mb-0 font-weight-bold text-gray-800"><?= $solusi['jml_solusi']; ?></div>
</div>
</div>
</div>
</div>
</div>
<!-- DataTales Example -->
<div class="card shadow ml-3 mb-12">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Tabel Data Pasien</h6>
</div>
<div class="card-body">
<form method="post" encytpe="multipart/form-data">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<?php if($_SESSION['role'] == 1) {
echo'<th>Aksi</th>';
}?>
<th>Aksi</th>
<th>Nama</th>
<th>Email</th>
<th>Alamat</th>
<th>Tgl Lahir</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<?php while ($data = mysqli_fetch_assoc($queryPasien)) { ?>
<tr>
<td>
<a class="badge badge-pill badge-primary" href="ubahPasien.php?id_user=<?php echo $data["id_user"]; ?>">edit</a> |
<a href="function.php?act=hapusPasien&id_user=<?= $data["id_user"]; ?>" onclick="return confirm('Yakin ingin menghapus data?');" class="badge badge-pill badge-danger">hapus</a>
</td>
<td><?= $data['nama']; ?></td>
<td><?= $data['email']; ?></td>
<td><?= $data['alamat']; ?></td>
<td><?= $data['tgl_lahir']; ?></td>
<td><?= $data['nama']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</body>
</html>