-
Notifications
You must be signed in to change notification settings - Fork 1
/
alternatif_edit.php
199 lines (172 loc) · 8.8 KB
/
alternatif_edit.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
<?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 class="active-menu" 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 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">Edit Alternatif</h1>
</div>
</div>
<!-- <div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Form Tambah Alternatif
</div>
<div class="panel-body">
<form action="alternatif_tambah.php" method="post" name="form1">
<fieldset>
<div class="form-group">
<label for="">Id</label>
<input type="text" class="form-control" name="id_hp" placeholder="Id" />
</div>
<div class="form-group">
<label for="">Merek Smartphone</label>
<input type="text" class="form-control" name="merk_hp" placeholder="Merek Smartphone" />
</div>
<div class="form-group">
<label for="">Tahun Keluaran</label>
<input type="text" class="form-control" name="thn_hp" placeholder="Tahun Keluaran" />
</div>
</fieldset>
<input type="submit" name="input" value="Submit" class="btn btn-primary btn-sm">
</form>
</div>
</div>
</div> -->
<?php
// Check If form submitted, insert form data into users table.
if(isset($_POST['update'])) {
$ids = $_POST['idhp'];
$merek = $_POST['merk_hp'];
$thn = $_POST['thn_hp'];
// include database connection file
include_once("koneksi.php");
// Insert user data into table
$result = mysql_query("UPDATE alternatifhp SET merk_hp='$merek', thn_hp='$thn' WHERE idhp=$ids");
// Show message when user added
echo "<script type=text/javascript>
window.location.href='http://localhost/sawhp/alternatif.php';
</script>";
}?>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Form Edit Alternatif
</div>
<div class="panel-body">
<?php
$result = mysql_query("SELECT * FROM alternatifhp WHERE idhp='$_GET[idhp]'") or die (mysql_error());
$data = mysql_fetch_array($result);
?>
<form action="alternatif_edit.php" method="post" name="form1">
<table width="25%" border="0">
<div class="form-group">
<label>Id</label>
<input type="text" class="form-control" name="idhp" value="<?php echo $data['idhp'];?>" placeholder="Id" />
</div>
<div class="form-group">
<label>Merek Smartphone</label>
<input type="text" class="form-control" name="merk_hp" value="<?php echo $data['merk_hp'];?>" placeholder="Merek Smartphone" />
</div>
<div class="form-group">
<label>Tahun Keluaran</label>
<input type="text" class="form-control" name="thn_hp" value="<?php echo $data['thn_hp'];?>" placeholder="Tahun Keluaran" />
</div>
<!-- <tr>
<td>Id</td>
<td><input type="text" name="id_hp"></td>
</tr> -->
<!-- <tr>
<td>Merek Smartphone</td>
<td><input type="text" name="merk_hp"></td>
</tr>
<tr>
<td>Tahun Keluaran</td>
<td><input type="text" name="thn_hp"></td>
</tr> -->
<tr>
<td></td>
<td><input type="submit" name="update" value="Update" class="btn btn-primary btn-sm"></td>
<td><a href="alternatif.php" value="Cancel" class="btn btn-danger btn-sm">Cancel</a></td>
</tr>
</table>
</form>
</div>
<!-- /. PAGE INNER -->
</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>