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

if (isset($_POST['upload'])) {

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

    $img = $_FILES['image']['name'];
    $tmp = $_FILES['image']['tmp_name'];
    move_uploaded_file($tmp, "../../uploads/jackpot/".$img);

    $query = mysqli_query($koneksi, "
        INSERT INTO tb_jackpot 
        VALUES (NULL,'$game_name','$provider','$img','$jackpot','$player_mask',NOW())
    ");

    if ($query) {
        echo "<script>alert('Jackpot berhasil ditambahkan');window.location='?page=jackpot'</script>";
    }
}
}else{
    echo "<script>window.location='?page=dashboard'</script>";
}
?>