-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexSolusi.php
194 lines (165 loc) · 8.36 KB
/
indexSolusi.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
include "function.php";
if (isset($_SESSION['role'])) {
if ($_SESSION['role'] == 1) {
header("location: test.php");
}
} else {
header("location:index.php");
}
$querySolusi = mysqli_query($koneksi, "SELECT id_solusi, penyakit,deskripsi, solusi FROM solusi INNER JOIN penyakit ON solusi.id_penyakit = penyakit.id_penyakit");
$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('solusi') as jml_solusi FROM solusi");
$solusi = mysqli_fetch_assoc($jumlahSolusi);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="icon/icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dashboard Admin</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
</head>
<body>
<div class="kiri">
<section class="logo">
<h3>AyamSehat.</h3>
</section>
<div class="sidebar-heading">
<h5 class="font-weight-bold text-white text-uppercase teks">Data Users</h5>
</div>
<section class="isi">
<a class="nav-link" href="indexAdmin.php">
<span>Data Users</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 Users</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 mb-12 w-100">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Tabel Data Solusi</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 class="d-flex">
<th class="col-1 text-center">Id Solusi</th>
<th class="col-2">Penyakit</th>
<th class="col-3">Deskripsi</th>
<th class="col-4">Solusi</th>
<th class="col-2 text-center">Aksi</th>
</tr>
</thead>
<tbody>
<?php while ($data = mysqli_fetch_assoc($querySolusi)) { ?>
<tr class="d-flex">
<td class="col-1 text-center"><?= $data['id_solusi']; ?></td>
<td class="col-2"><?= $data['penyakit']; ?></td>
<td class="col-3"><?= $data['deskripsi']; ?></td>
<td class="col-4"><?= $data['solusi']; ?></td>
<td class="col-2 text-center">
<a class="btn btn-primary p-1" href="ubahSolusi.php?id_solusi=<?php echo $data["id_solusi"]; ?>">edit</a>
<a href="function.php?act=hapusSolusi&id_solusi=<?= $data['id_solusi']; ?>" onclick="return confirm('Yakin ingin menghapus data?');" class="btn btn-danger p-1">hapus</a>
</td>
</tr>
<?php } ?>
</tbody>
<a href="tambahSolusi.php" class="btn btn-primary my-2 px-2">Tambah Data Solusi</a>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>