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

$psd = mysqli_real_escape_string($data, $_REQUEST['updpass']);
$gid = mysqli_real_escape_string($data, $_GET['row']);

$newpass = password_hash($psd, PASSWORD_DEFAULT);
$updatestatus = "UPDATE lomba_credential SET password = '$newpass' WHERE id = '$gid'";
$bindstats = mysqli_query($data, $updatestatus);

if($bindstats) {
    echo '
    <script>
        alert("Password Admin Successfully Changed!!");
        window.location.href = "../dashboard.php?hal=tambahadmin";
    </script>
    ';

} else {

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

}

?>