Advertisement
Guest User

Untitled

a guest
Sep 19th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. <div class="container">
  2. <!-- Modal update -->
  3. <div class="modal fade" id="myModals<?php echo $row->id ;?>" role="dialog">
  4. <div class="modal-dialog">
  5.  
  6. <!-- Modal content-->
  7. <div class="modal-content">
  8. <div class="modal-header">
  9. <button type="button" class="close" data-dismiss="modal">&times;</button>
  10. <h4 class="modal-title">Edit Data</h4>
  11. </div>
  12.  
  13. <div class="modal-body">
  14. <form>
  15. <div class="form-group">
  16. <label for="user">Username:</label>
  17. <input type="user" class="form-control" id="users<?php echo $row->id ;?>" value="<?php echo $row->username ;?>">
  18. </div>
  19. <div class="form-group">
  20. <label for="password">Password:</label>
  21. <input type="password" class="form-control" id="passwords<?php echo $row->id ;?>" value="<?php echo $row->password ;?>">
  22. </div>
  23. <button onclick='update("<?= $row->id ?>")' type="submit" class="btn btn-default">Update</button>
  24. </form>
  25. </div>
  26.  
  27. <div class="modal-footer">
  28. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  29. </div>
  30. </div>
  31.  
  32. </div>
  33. </div>
  34.  
  35. </div>
  36.  
  37. function update(id){
  38. var users = $("#users"+id).val();
  39. var passwords = $("#passwords"+id).val();
  40.  
  41. $.ajax({
  42. dataType:'html',
  43. url:"update.php",
  44. type:"POST",
  45. data:"users="+users+"&passwords="+passwords+"&id="+id,
  46. }).done(function(data){
  47. load();
  48. $('back-drop').remove();
  49. });
  50.  
  51. $('myModals'+id).modal('hide');
  52.  
  53. $('#myModals'+id).modal('hide');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement