<?php
include '../config/koneksi.php';
include '../fuzzy/fuzzy_logic.php';
if(isset($_POST['kirim'])){
$lok=$_POST['lokasi'];
$k=$_POST['kerusakan'];
$w=$_POST['waktu'];
$p=fuzzy_prioritas($k,$w);
$foto=$_FILES['foto']['name'];
move_uploaded_file($_FILES['foto']['tmp_name'],'../uploads/before/'.$foto);
mysqli_query($conn,"INSERT INTO komplain(lokasi,kerusakan,waktu,prioritas,status,foto_before,tanggal)
VALUES('$lok','$k','$w','$p','Pending','$foto',NOW())");
}
?>
<form method="post" enctype="multipart/form-data">
<input name="lokasi" placeholder="Lokasi">
<input name="kerusakan" placeholder="Kerusakan">
<input name="waktu" placeholder="Waktu">
<input type="file" name="foto" accept="image/*" capture="camera">
<button name="kirim">Kirim</button>
</form>
