script.js 580 B

123456789101112131415161718192021222324
  1. function deleteUser(user){
  2. if (confirm('Are you sure?')) {
  3. var posting = $.post("delete.php", { user: user}, function(data) {
  4. $( ".result" ).html( data );
  5. if (data=="success") {
  6. $( ".result" ).html("<p>User <em>"+user+"</em> deleted.</p>");
  7. $(".result").show( "fast" );
  8. $('.id-' + user).remove();
  9. } else {
  10. $( ".result" ).html("<p>An error occured.</p>");
  11. }
  12. } );
  13. }
  14. }
  15. function setUserField(user, email, name) {
  16. $(".userfield").val(user);
  17. $(".emailfield").val(email);
  18. $(".namefield").val(name);
  19. $(".passwordfield").focus();
  20. }