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

$id = $_GET['id'];
$q = mysqli_query($koneksi,"SELECT * FROM tb_jackpot WHERE id='$id'");
$d = mysqli_fetch_array($q);
?>

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-6">
            <div class="card">
                <div class="card-body">

                    <h4>Edit Jackpot</h4>

                    <form method="POST" action="?page=proses_edit_jackpot" enctype="multipart/form-data">
                        <input type="hidden" name="id" value="<?= $d['id']; ?>">

                        <div class="form-group">
                            <label>Game Name</label>
                            <input type="text" name="game_name" value="<?= $d['game_name']; ?>" class="form-control">
                        </div>

                        <div class="form-group">
                            <label>Provider</label>
                            <input type="text" name="provider" value="<?= $d['provider']; ?>" class="form-control">
                        </div>

                        <div class="form-group">
                            <label>Image</label><br>
                            <img src="../../uploads/jackpot/<?= $d['image']; ?>" width="120">
                            <input type="file" name="image" class="form-control mt-2">
                        </div>

                        <div class="form-group">
                            <label>Jackpot Amount</label>
                            <input type="number" name="jackpot_amount" value="<?= $d['jackpot_amount']; ?>" class="form-control">
                        </div>

                        <div class="form-group">
                            <label>Player Mask</label>
                            <input type="text" name="player_mask" value="<?= $d['player_mask']; ?>" class="form-control">
                        </div>

                        <button type="submit" name="submit" class="btn btn-success">Update</button>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>

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