<?php 
require '../assets/config-data.php';

$nama = mysqli_real_escape_string($data, $_REQUEST['namauser']);
$touser = mysqli_real_escape_string($data, $_REQUEST['touser']);
$hadiah = mysqli_real_escape_string($data, $_REQUEST['hadiahuser']);
$game = mysqli_real_escape_string($data, $_REQUEST['gameuser']);


$rowid = mysqli_real_escape_string($data, $_GET['row']);

$updatestatus = "UPDATE peserta_to SET nama_user = '$nama', to_user = '$touser', hadiah_user = '$hadiah', game_user = '$game', tanggal_to = '$today' WHERE id = '$rowid'";
$bindstats = mysqli_query($data, $updatestatus);

if($bindstats) {
    echo '
    <script>
        alert("Turnamen Successfully Change!!");
        window.location.href = "../dashboard.php?hal=turnamen";
    </script>
    ';

} else {

    echo '
    <script>
        alert("ERROR on Change!!");
        window.location.href = "../dashboard.php?hal=turnamen";
    </script>
    ';

}

?>