-
Notifications
You must be signed in to change notification settings - Fork 0
/
nilai kriteria.php
230 lines (229 loc) · 7.23 KB
/
nilai kriteria.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<?php
require __DIR__ . '/php/connect.php';
require __DIR__ . '/php/cek_login.php';
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Styles -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="css/app.css" rel="stylesheet">
<link href="css/toni.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<script>
$(document).ready(function($){
var str1 = $("#krit1").text();
$("#str1").html(str1);
var str2 = $("#krit2").text();
$("#str2").html(str2);
var str3 = $("#krit3").text();
$("#str3").html(str3);
var str4 = $("#krit4").text();
$("#str4").html(str4);
});
</script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<!-- Collapsed Hamburger -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse" aria-expanded="false">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Branding Image -->
<a class="navbar-brand" href="{{ url('/">
</a>
</div>
<div class="collapse navbar-collapse" id="app-navbar-collapse">
<!-- Left Side Of Navbar -->
<ul class="nav navbar-nav navbar-right nav-tabs-justified">
<li>
<a href="home.php">Home</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Data
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="datamakanan.php">Data Makanan</a>
</li>
<li>
<a href="data kriteria.php">Data Kriteria</a>
</li>
<li>
<a href="data subkriteria.php">Data Subkriteria</a>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Nilai
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="nilai kriteria.php">Nilai Kriteria</a>
</li>
<li>
<a href="nilai subkriteria.php">Nilai Subkriteria</a>
</li>
<li>
<a href="nilai makanan.php">Nilai Makanan</a>
</li>
</ul>
</li>
<li>
<a href="hasilakhir.php">Hasil Akhir</a>
</li>
<li>
<a href="php/logout.php">
Logout
</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h3>Nilai Kriteria</h3>
<span class="hrdivider"></span>
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline" action="php/kriteria nilai.php" method="POST">
<select name="variabel" id="variabel" class="form-control">
<?php
$sql = 'SELECT * FROM kriteria';
$query = mysqli_query($con, $sql);
while ($row = mysqli_fetch_array($query))
{
echo "<option value=" . $row['id'] . ">" . $row['nama'] . "</option>";
}
?>
</select>
<select name="skala" id="skala" class="form-control">
<option value="1">1 - Kedua elemen sama pentingnya</option>
<option value="2">2 - Nilai-nilai antara dua nilai pertimbangan-pertimbangan yang berdekatan</option>
<option value="3">3 - Elemen yang satu sedikit lebih penting daripada yang lainnya</option>
<option value="4">4 - Nilai-nilai antara dua nilai pertimbangan-pertimbangan yang berdekatan</option>
<option value="5">5 - Elemen yang satu lebih penting daripada yang lainnya</option>
<option value="6">6 - Nilai-nilai antara dua nilai pertimbangan-pertimbangan yang berdekatan</option>
<option value="7">7 - Satu elemen yang jelas lebih mutlak penting daripada elemen lainnya</option>
<option value="8">8 - Nilai-nilai antara dua nilai pertimbangan-pertimbangan yang berdekatan</option>
<option value="9">9 - Satu elemen mutlak penting daripada elemen lainnya</option>
</select>
<select name="variabel2" id="variabel2" class="form-control">
<?php
$sql = 'SELECT * FROM kriteria';
$query = mysqli_query($con, $sql);
while ($row = mysqli_fetch_array($query))
{
echo "<option value=" . $row['id'] . ">" . $row['nama'] . "</option>";
}
?>
</select>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<table class="table table-hover table-bordered table-responsive table-nilai">
<thead>
<tr>
<th>Kode</th>
<?php
$sql = 'SELECT * FROM kriteria';
$query = mysqli_query($con, $sql);
while ($row = mysqli_fetch_array($query))
{
echo "<th id=krit" . $row['id'] . ">" . $row['nama'] . "</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
$sql = 'SELECT * FROM nilaikrit WHERE id = 1';
$query = mysqli_query($con, $sql);
$row = mysqli_fetch_array($query)
?>
<tr>
<td id="str1" class="bold"></td>
<td id="c01_c01">
1
</td>
<td id="lem_pro">
<?php echo $row['lem_pro']; ?>
</td>
<td id="kar_pro">
<?php echo $row['kar_pro']; ?>
</td>
<td id="ser_pro">
<?php echo $row['ser_pro']; ?>
</td>
</tr>
<tr>
<td id="str2" class="bold"></td>
<td id="c01_c02">
<?php echo number_format(1/$row['lem_pro'], 2, '.', ''); ?>
</td>
<td id="c02_c02">
1
</td>
<td id="kar_lem">
<?php echo $row['kar_lem']; ?>
</td>
<td id="ser_lem">
<?php echo $row['ser_lem']; ?>
</td>
</tr>
<tr>
<td id="str3" class="bold"></td>
<td id="c01_c03">
<?php echo number_format(1/$row['kar_pro'], 2, '.', ''); ?>
</td>
<td id="c02_c03">
<?php echo number_format(1/$row['kar_lem'], 2, '.', ''); ?>
</td>
<td id="c03_c03">
1
</td>
<td id="ser_kar">
<?php echo $row['ser_kar']; ?>
</td>
</tr>
<tr>
<td id="str4" class="bold"></td>
<td id="c01_c04">
<?php echo number_format(1/$row['ser_pro'], 2, '.', ''); ?>
</td>
<td id="c02_c04">
<?php echo number_format(1/$row['ser_lem'], 2, '.', ''); ?>
</td>
<td id="c03_c04">
<?php echo number_format(1/$row['ser_kar'], 2, '.', ''); ?>
</td>
<td id="c04_c04">
1
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>