<?php
    require 'spaceship/krypton.php';

	$anggota = mysqli_real_escape_string($krypton, $_REQUEST['namaakun']);
	$pass = mysqli_real_escape_string($krypton, $_REQUEST['passbaru']);
	$password = md5($pass);
	$role = mysqli_real_escape_string($krypton, $_REQUEST['peran']);
	$today = date("Y-m-d H:i:s");

	$addanggota = "INSERT INTO superman(name, password, peran, dibuat) VALUES('$anggota', '$password', '$role', '$today')";
	$qadd = mysqli_query($krypton, $addanggota);
	if($qadd) {
    echo '
    <script>
    alert("Anggota Berhasil ditambah!!");
    window.location.href = "tambahanggota.php";
    </script>
    ';
} else {
    echo '
    <script>
    alert("Anggota Berhasil ditambah!!");
    window.location.href = "tambahanggota.php";
    </script>
    ';
}

?>