-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
40 lines (35 loc) · 1.1 KB
/
controller.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
<?php
include('./koneksi.php');
$nama = $_POST['nama'];
$keselarasan = $_POST['keselarasan'];
$lamawaktu = $_POST['lamawaktu'];
$tingkatposisi = $_POST['tingkatposisi'];
$pendapatan = $_POST['pendapatan'];
$hasil = "";
if ($tingkatposisi == "Lebih Tinggi") {
$hasil = "Cukup Berkompeten";
}else if($tingkatposisi == "Lebih Rendah") {
if($pendapatan == "Diatas UMR") {
$hasil = "Cukup Berkompeten";
}else if($pendapatan == "UMR") {
$hasil = "Cukup Berkompeten";
}else{
$hasil = "Kurang Berkompeten";
}
}else{
if($lamawaktu == "Cepat") {
$hasil = "Berkompeten";
}else if($lamawaktu == "Cukup Lama") {
$hasil = "Cukup Berkompeten";
}else{
$hasil = "Cukup Berkompeten";
}
}
$sql = "INSERT INTO tabelprediksi (nama, keselarasan, lamawaktu, tingkatposisi, pendapatan, hasil) VALUES ('$nama','$keselarasan','$lamawaktu','$tingkatposisi','$pendapatan','$hasil')";
if ($conn->query($sql) === TRUE) {
echo "
<script type='text/javascript'>location.href = 'data.php';</script>
";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}