<?php
if ($c['level'] == "superadmin") {

$id = $_POST['id'];
$game_name = $_POST['game_name'];
$provider = $_POST['provider'];
$jackpot = $_POST['jackpot_amount'];
$player_mask = $_POST['player_mask'];

if ($_FILES['image']['name'] == "") {
    mysqli_query($koneksi,"
        UPDATE tb_jackpot SET
        game_name='$game_name',
        provider='$provider',
        jackpot_amount='$jackpot',
        player_mask='$player_mask'
        WHERE id='$id'
    ");
} else {
    $img = $_FILES['image']['name'];
    $tmp = $_FILES['image']['tmp_name'];
    move_uploaded_file($tmp,"../../uploads/jackpot/".$img);

    mysqli_query($koneksi,"
        UPDATE tb_jackpot SET
        game_name='$game_name',
        provider='$provider',
        image='$img',
        jackpot_amount='$jackpot',
        player_mask='$player_mask'
        WHERE id='$id'
    ");
}

echo "<script>alert('Jackpot berhasil diupdate');window.location='?page=jackpot'</script>";

}else{
    echo "<script>window.location='?page=dashboard'</script>";
}
?>