function deleteCheck(){

  console.log(user.uid + " will be deleted. Are you sure?");
  confirmModal.style.display = "block";

  deleteConfirm.onclick = function () {
    console.log("Confirmed to delete user " + user.uid);
    firebase.database().ref("users/").child(user.uid).remove();
    confirmModal.style.display = "none";

    btnDelete.innerHTML = "Please Wait...";
    btnUpdate.onclick = function(){};//forces the update button to do nothing
    btnDelete.onclick = function(){};//forces the delete button to do nothing
    window.location.href = "index.html";
  };

  deleteDeny.onclick = function () {
    console.log("Denied to delete user " + user.uid);
    confirmModal.style.display = "none";
  };

  //close on close
  confirmSpan.onclick = function () {
    console.log("Closed window, user " + user.uid + " not deleted");
    confirmModal.style.display = "none";
  };

  //close on click
  window.onclick = function (event) {
    if (event.target == confirmModal) {
      console.log("Clicked outside window, user " + user.uid + " not deleted");
      confirmModal.style.display = "none";
    }
  }
}
//user account. If so, the user will be removed from the database. If not, the window will close with no further action.
user account. If so, the user will be removed from the database. If not, the window will close with no further action.
user account . If so the user will be removed from the database . If not the window will close with no further action .
function deleteCheck(){
  console.log(user.uid + " will be deleted. Are you sure?");
  confirmModal.style.display = "block";
  deleteConfirm.onclick = function () {
    console.log("Confirmed to delete user " + user.uid);
    firebase.database().ref("users/").child(user.uid).remove();
    confirmModal.style.display = "none";
    btnDelete.innerHTML = "Please Wait...";
    btnUpdate.onclick = function(){};
    btnDelete.onclick = function(){};
    window.location.href = "index.html";
  };
  deleteDeny.onclick = function () {
    console.log("Denied to delete user " + user.uid);
    confirmModal.style.display = "none";
  };
  confirmSpan.onclick = function () {
    console.log("Closed window, user " + user.uid + " not deleted");
    confirmModal.style.display = "none";
  };
  window.onclick = function (event) {
    if (event.target == confirmModal) {
      console.log("Clicked outside window, user " + user.uid + " not deleted");
      confirmModal.style.display = "none";
    }
  }
}
function deleteCheck ( ) { console . log ( user . uid + " will be deleted. Are you sure?" ) ; confirmModal . style . display = "block" ; deleteConfirm . onclick = function ( ) { console . log ( "Confirmed to delete user " + user . uid ) ; firebase . database ( ) . ref ( "users/" ) . child ( user . uid ) . remove ( ) ; confirmModal . style . display = "none" ; btnDelete . innerHTML = "Please Wait..." ; btnUpdate . onclick = function ( ) { } ; btnDelete . onclick = function ( ) { } ; window . location . href = "index.html" ; } ; deleteDeny . onclick = function ( ) { console . log ( "Denied to delete user " + user . uid ) ; confirmModal . style . display = "none" ; } ; confirmSpan . onclick = function ( ) { console . log ( "Closed window, user " + user . uid + " not deleted" ) ; confirmModal . style . display = "none" ; } ; window . onclick = function ( event ) { if ( event . target == confirmModal ) { console . log ( "Clicked outside window, user " + user . uid + " not deleted" ) ; confirmModal . style . display = "none" ; } } }
user account.
user account .
//forces the update button to do nothing //forces the delete button to do nothing //close on close //close on click