-
Notifications
You must be signed in to change notification settings - Fork 9
/
ranking-new.php
91 lines (85 loc) · 2.61 KB
/
ranking-new.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
<?php
include_once 'header.php';
include_once 'includes/candidate.inc.php';
$pgn1 = new candidate($db);
include_once 'includes/criteria.inc.php';
$pgn2 = new criteria($db);
include_once 'includes/value.inc.php';
$pgn3 = new value($db);
if($_POST){
include_once 'includes/ranking.inc.php';
$eks = new ranking($db);
$eks->ia = $_POST['ia'];
$eks->ik = $_POST['ik'];
$eks->nn = $_POST['nn'];
if($eks->insert()){
?>
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Berhasil Tambah Data!</strong> Tambah lagi atau <a href="ranking.php">lihat semua data</a>.
</div>
<?php
}
else{
?>
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Gagal Tambah Data!</strong> Terjadi kesalahan, coba sekali lagi.
</div>
<?php
}
}
?>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8">
<div class="page-header">
<h5>Tambah ranking</h5>
</div>
<form method="post">
<div class="form-group">
<label for="ia">candidate</label>
<select class="form-control" id="ia" name="ia">
<?php
$stmt3 = $pgn1->readAll();
while ($row3 = $stmt3->fetch(PDO::FETCH_ASSOC)){
extract($row3);
echo "<option value='{$id_candidate}'>{$nama_candidate}</option>";
}
?>
</select>
</div>
<div class="form-group">
<label for="ik">criteria</label>
<select class="form-control" id="ik" name="ik">
<?php
$stmt2 = $pgn2->readAll();
while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){
extract($row2);
echo "<option value='{$id_kriteria}'>{$nama_kriteria}</option>";
}
?>
</select>
</div>
<div class="form-group">
<label for="nn">value</label>
<select class="form-control" id="nn" name="nn">
<?php
$stmt4 = $pgn3->readAll();
while ($row4 = $stmt4->fetch(PDO::FETCH_ASSOC)){
extract($row4);
echo "<option value='{$jum_nilai}'>{$ket_nilai}</option>";
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary">Simpan</button>
<button type="button" onclick="location.href='ranking.php'" class="btn btn-success">Kembali</button>
</form>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<?php include_once 'sidebar.php'; ?>
</div>
</div>
<?php
include_once 'footer.php';
?>