-
Notifications
You must be signed in to change notification settings - Fork 1
/
normalisasi_tambah.php
234 lines (213 loc) · 11.2 KB
/
normalisasi_tambah.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
231
232
233
234
<?php
include "koneksi.php";
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sistem Pendukung Keputusan SAW</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">SMARTPHONE CHOICER
</a>
</div>
<div class="notifications-wrapper">
</div>
</nav>
<!-- /. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li>
<div class="user-img-div">
<img src="assets/img/adam.jpg" class="img-circle" />
</div>
</li>
<li>
<a href="#"> <strong> Muhammad Adam </strong></a>
</li>
<li>
<a href="index.php"><i class="fa fa-dashboard "></i>Dashboard</a>
</li>
<li>
<a href="alternatif.php"><i class="fa fa-venus "></i>Alternatif</a>
</li>
<li>
<a href="kriteria.php"><i class="fa fa-bolt "></i>Kriteria</a>
</li>
<li>
<a href="subkriteria.php"><i class="fa fa-code "></i>Sub Kriteria</a>
</li>
<li>
<a class="active-menu" href="normalisasi.php"><i class="fa fa-dashcube "></i>Normalisasi</a>
</li>
<li>
<a href="perhitungan.php"><i class="fa fa-dashcube "></i>Perhitungan</a>
</li>
<li>
<a href="kesimpulan.php"><i class="fa fa-dashcube "></i>Kesimpulan</a>
</li>
</ul>
</div>
</nav>
<div id="page-wrapper" class="page-wrapper-cls">
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h1 class="page-head-line">Tambah Normalisasi</h1>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Form Tambah Normalisasi
</div>
<div class="panel-body">
<form action="normalisasi_tambah.php" method="post" name="form1">
<table width="25%" border="0">
<div class="form-group">
<label>Merek Smartphone (*masukkan id hp)</label>
<div>
<input type="text" name="idhp" required class="form-control">
</div>
</div>
<div class="form-group">
<label>Harga</label>
<div>
<select name="harga" class="form-control">
<option>Pilih Harga...</option>
<?php
$query = "SELECT * FROM subkriteria WHERE id_kriteria='1' ORDER BY id_sub asc";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil)){
echo "<option value='".$data['nilai']."'>".$data['nama_sub']."</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>RAM</label>
<div>
<select name="ram" class="form-control">
<option>Pilih RAM...</option>
<?php
$query = "SELECT * FROM subkriteria WHERE id_kriteria='2' ORDER BY id_sub asc";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil)){
echo "<option value='".$data['nilai']."'>".$data['nama_sub']."</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>ROM</label>
<div>
<select name="memory" class="form-control">
<option>Pilih ROM...</option>
<?php
$query = "SELECT * FROM subkriteria WHERE id_kriteria='3' ORDER BY id_sub asc";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil)){
echo "<option value='".$data['nilai']."'>".$data['nama_sub']."</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Camera</label>
<div>
<select name="camera" class="form-control">
<option>Pilih Camera...</option>
<?php
$query = "SELECT * FROM subkriteria WHERE id_kriteria='4' ORDER BY id_sub asc";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil)){
echo "<option value='".$data['nilai']."'>".$data['nama_sub']."</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Resolusi</label>
<div>
<select name="layar" class="form-control">
<option>Pilih Resolusi...</option>
<?php
$query = "SELECT * FROM subkriteria WHERE id_kriteria='6' ORDER BY id_sub asc";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil)){
echo "<option value='".$data['nilai']."'>".$data['nama_sub']."</option>";
}
?>
</select>
</div>
</div>
<tr>
<td><input type="submit" name="Submit" value="Add" class="btn btn-primary btn-sm"></td>
<td><input type="button" name="kembali" value="Kembali" onclick="javascript:history.back()" class="btn btn-sm"></td>
</tr>
</table>
</form>
<script type="text/javascript">
$(document).ready(function(){
var ac_config = {
source: "alternatif_cari.php";
select: function(event, ui){
$("#merk_hp").val(ui.item.merk_hp);
$("#idhp").val(ui.item.idhp);
},
minLength:1
};
$("#merk_hp").autocomplete(ac_config);
});
</script>
</div>
<?php
// Check If form submitted, insert form data into users table.
if(isset($_POST['Submit'])) {
$id = $_POST['idhp'];
$harga = $_POST['harga'];
$ram = $_POST['ram'];
$rom = $_POST['memory'];
$camera = $_POST['camera'];
$layar = $_POST['layar'];
// include database connection file
include_once("koneksi.php");
// Insert user data into table
$result = mysql_query("INSERT INTO normal VALUES('','$id','$harga','$ram','$rom','$camera','$layar')") or die(mysql_error());
// Show message when user added
echo "Data added successfully. <a href='normalisasi.php'>View Data</a>";
}
?>
<!-- /. PAGE INNER -->
</div>
</div>
</div>
</div>
</div>
<footer>
© 2018 Poltekpos | By : <a href="#" target="_blank">Muhammad Adam Nahdlotul Halimi</a>
</footer>
<script src="assets/js/jquery-1.11.1.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/custom.js"></script>
</body>
</html>