-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalternatif-ubah.php
69 lines (61 loc) · 1.67 KB
/
alternatif-ubah.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
<?php
include_once 'header.php';
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: missing ID.');
include_once 'includes/alternatif.inc.php';
$eks = new Alternatif($db);
$eks->id = $id;
$eks->readOne();
if($_POST){
$eks->kd = $_POST['kd'];
$eks->kt = $_POST['kt'];
if($eks->update()){
echo "<script>location.href='alternatif.php'</script>";
} else{
?>
<script type="text/javascript">
window.onload=function(){
showStickyErrorToast();
};
</script>
<?php
}
}
?>
<!-- Main content -->
<div class="main-content" style="margin-top: 20px;">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-2"></div>
<div class="col-xs-12 col-sm-12 col-md-8">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-6 text-left">
<h3>Ubah Alternatif</h3>
</div>
<div class="col-md-6 text-right">
<h3>
<button type="button" onclick="location.href='alternatif.php'" class="btn btn-success">Kembali</button>
</h3>
</div>
</div>
<form method="post">
<div class="form-group">
<label for="kd">Kode Alternatif</label>
<input type="text" class="form-control" id="kd" name="kd" value="<?php echo $eks->kd; ?>">
</div>
<div class="form-group">
<label for="kt">Nama Alternatif</label>
<input type="text" class="form-control" id="kt" name="kt" value="<?php echo $eks->kt; ?>">
</div>
<button type="submit" class="btn btn-primary">Ubah</button>
</form>
</div></div></div>
<div class="col-xs-12 col-sm-12 col-md-2">
</div>
</div>
</section>
</div>
</div>
<?php
include_once 'footer.php';
?>