-
Notifications
You must be signed in to change notification settings - Fork 4
/
data_simulasi.php
209 lines (174 loc) · 6.35 KB
/
data_simulasi.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" type="image/x-icon" href="img/nbc.png" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- font awsome -->
<link rel="stylesheet" href="css/fontawesome.css" />
<link rel="stylesheet" href="css/brands.css" />
<link rel="stylesheet" href="css/solid.css" />
<link rel="stylesheet" href="css/gaya.css">
<!-- google font -->
<link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/datatables.css">
<title>DATA SIMULASI</title>
</head>
<body>
<nav class="navbar navbar-expand-lg fixed-top navbar-light bg-light static-top">
<div class="container">
<a class="navbar-brand" href="index.php">
<img src="img/nbc.png" alt="" width=50 height=50>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">Naive Bayes</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="data_simulasi.php">Data Latih <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container" style='margin-top:90px'>
<div class="row">
<div class="col-12 mt-5">
<h2 class="tebal">List Data Latih</h2><br>
<p class="desc">Berikut ini adalah data latih yang saya gunakan dalam membuat simulasi kemungkinan diterimanya calon pendaftar PT.KAI menggunakan metode naive bayes. Data ini dikumpulkan melalui metode wawancara dan melakukan riset kepada narasumber.</p><br>
<table id="dataLatih" class="display pt-3 mb-3">
<thead>
<tr>
<th>No</th>
<th>Umur</th>
<th>Berat Badan</th>
<th>Pendidikan</th>
<th>Tinggi Badan</th>
<th>Status Kesehatan</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$data = 'data.json';
$json = file_get_contents($data);
$hasil = json_decode($json,true);
$no = 1;
foreach ($hasil as $hasil) {
if($hasil['status'] == 1){
$stt = "diterima";
}else{
$stt = "ditolak";
}
if($hasil['tinggi'] == "ideal"){
$tinggi = "normal";
}else if($hasil['tinggi'] == "kt"){
$tinggi = "kurang tinggi";
}else if($hasil['tinggi'] == "st"){
$tinggi = "sangat tinggi";
}
if($hasil['kesehatan'] == "sehat"){
$sehat = "sehat";
}else if($hasil['kesehatan'] == "tidak_sehat"){
$sehat = "tidak sehat";
}
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $hasil['umur']; ?></td>
<td><?php echo $hasil['berat_badan']; ?></td>
<td><?php echo $hasil['pendidikan']; ?></td>
<td><?php echo $tinggi ?></td>
<td><?php echo $sehat; ?></td>
<td><?php
if($stt == "diterima"){
echo "<span class='badge badge-success' style='padding:10px'>diterima</span>";
}else{
echo "<span class='badge badge-danger' style='padding:10px'>ditolak</span>";
}
?></td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Footer -->
<footer class="page-footer font-small abu1 mt-5">
<!-- Footer Elements -->
<div class="container">
<!-- Grid row-->
<div class="row">
<!-- Grid column -->
<div class="col-md-12 py-5">
<div class="mb-5 d-flex justify-content-center">
<!--Instagram-->
<a class="icn" href="https://www.instagram.com/rbayuokt/" target="_blank">
<i class="fab fa-instagram fa-lg white-text mr-md-5 mr-3 fa-2x"> </i>
</a>
<!-- Github -->
<a class="icn" href="https://github.com/rbayuokt" target="_blank">
<i class="fab fa-github fa-lg white-text mr-md-5 mr-3 fa-2x"> </i>
</a>
<!--Linkedin -->
<a class="icn" href="https://www.linkedin.com/in/rizky-bayu-oktavian" target="_blank">
<i class="fab fa-linkedin-in fa-lg white-text mr-md-5 mr-3 fa-2x"> </i>
</a>
<!--Pinterest-->
<a class="icn" href="https://dribbble.com/rbayuokt_" target="_blank">
<i class="fab fa-dribbble fa-lg white-text fa-2x"> </i>
</a>
</div>
<div class="text-center">
Made with <i class="fa fa-heart" style="color:#dc3545"></i> in Cimahi
</div>
</div>
<!-- Grid column -->
</div>
<!-- Grid row-->
</div>
<!-- Footer Elements -->
<!-- Copyright -->
<div class="footer-copyright text-center py-3 abu2">© <?php echo date('Y'); ?> Copyright
<a href="https://github.com/rbayuokt">rbayuokt</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery.js"></script>
<script src="jspopper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/datatables.js"></script>
<!-- validasi -->
<script>
$(document).ready(function(){
$('.toggle').click(function(){
$('ul').toggleClass('active');
});
});
</script>
<script>
$(document).ready(function() {
$('#dataLatih').dataTable({
"pageLength" : 50
});
});
</script>
</body>
</html>