<?php
    include "koneksi.php";
    $id_hadiah = $_POST['id_hadiah'];
    $nama_hadiah = $_POST['nama_hadiah'];
    $background_hadiah = $_POST['background_hadiah'];
    $border_hadiah = $_POST['border_hadiah'];
    $text_hadiah = $_POST['text_hadiah'];
    $persen_hadiah = $_POST['persen_hadiah'];
    $status_hadiah = $_POST['status_hadiah'];
    $proses = mysqli_query($koneksi, "UPDATE hadiah SET nama_hadiah = '$nama_hadiah', background_hadiah = '$background_hadiah', border_hadiah = '$border_hadiah', text_hadiah = '$text_hadiah', persen_hadiah = '$persen_hadiah', status_hadiah = '$status_hadiah' WHERE id_hadiah = '$id_hadiah'");
    if ($proses) {
        header("location: index.php?page=hadiah&notif=berhasil_ubah_data");
    } else {
        echo "Proses Gagal<br>Error : ".$proses."<br>".mysqli_error($koneksi);
    }
?>