-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabasispengetahuan.php
163 lines (151 loc) · 6.67 KB
/
abasispengetahuan.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
<?php
include "session.php";
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.84.0">
<title>Dasbor Admin | Kumaphone</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.0/examples/dashboard/">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Bootstrap core CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<style>
body {
font-family: 'Inter', sans-serif !important;
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="dashboard.css" rel="stylesheet">
</head>
<body>
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#"><b>Kumaphone Admin</b></a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<h5 class="text-white">Selamat siang, ...</h5>
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" href="index.html"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-door-open" viewBox="0 0 16 16">
<path d="M8.5 10c-.276 0-.5-.448-.5-1s.224-1 .5-1 .5.448.5 1-.224 1-.5 1z"/>
<path d="M10.828.122A.5.5 0 0 1 11 .5V1h.5A1.5 1.5 0 0 1 13 2.5V15h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V1.5a.5.5 0 0 1 .43-.495l7-1a.5.5 0 0 1 .398.117zM11.5 2H11v13h1V2.5a.5.5 0 0 0-.5-.5zM4 1.934V15h6V1.077l-6 .857z"/>
</svg> Kembali ke halaman utama</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="homeadmin.php">
<span data-feather="home"></span>
Beranda
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="daftarkerusakan.php"">
<span data-feather="smartphone"></span>
Kerusakan
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="gejala.php">
<span data-feather="list"></span>
Ciri Kerusakan
</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="basispengetahuan.php">
<span data-feather="database"></span>
Basis Pengetahuan
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Basis Pengetahuan</h1>
</div> <form id="form1" name="form1" method="post" action="abasispengetahuan.php">
<label for="sel1">Jenis smartphone</label>
<select class="form-control" name="hp" onChange='this.form.submit();'>
<option>Pilih</option>
<option>Android</option>
</select>
</form>
<br><form id="form1" name="form1" method="post">
<label for="sel1">Daftar Kerusakan</label>
<select class="form-control" name="kerusakan">
<option>Pilih</option>
<?php
$tampil="select * from kerusakan where jenishp= \"".$_POST['hp']."\"";
$query1= mysqli_query($konek_db,$tampil);
while($hasil=mysqli_fetch_array($query1)){
echo "<option value='".$hasil['namakerusakan']."'>".$hasil['idkerusakan']." ".$hasil['namakerusakan']."</option>";
}
?>
</select>
<br/>
<form id="form2" name="form2" method="post" action="diagnosa.php">
<div class="card">
<div class="card-header">Ciri Kerusakan</div>
<div class="card-body">
<?php
if(isset($_POST['hp']))
if($_POST['hp']!="jenishp"){
$tampil="select * from gejala where jenishp= \"".$_POST['hp']."\"";
$query= mysqli_query($konek_db,$tampil);
while($hasil=mysqli_fetch_array($query)){
echo "<input type='checkbox' value='".$hasil['gejala']."' name='gejala[]' /> ".$hasil['gejala']."<br>";
}
}
?>
<br>
</div>
</div>
<br><button type="submit" name ="submit" class="btn btn-primary">Simpan</button>
<?php
if(isset($_POST['submit'])){
$kerusakan= $_POST['kerusakan'];
$gejala = $_POST['gejala'];
$jumlah_dipilih = count($gejala);
for($x=0;$x<$jumlah_dipilih;$x++){
$hasil= mysqli_query($konek_db, "INSERT INTO basispengetahuan (namakerusakan, gejala) values('$kerusakan','$gejala[$x]')");
if($hasil){
echo '<script language="javascript">';
echo 'alert("Data Berhasil disimpan")';
echo '</script>';
}
}
}
?>
</form>
<br>
<br>
</form>
</div>
</div>
</div>
<script src="bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script><script src="dashboard.js"></script>
</body>
</html>