Delete.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. require "connectionDb.php";
  3. if (isset($_POST['delete']) && !empty($_POST['deleteid']) ){
  4. $id = $_POST['deleteid'];
  5. $del = "DELETE FROM customer WHERE id='$id'";
  6. $db->exec($del);
  7. echo '<script>window.location.href="customers.php"</script>';
  8. }
  9. ?>
  10. <style type="text/css">
  11. .deleteForm {
  12. display: none;
  13. }
  14. .deleteCForm span{
  15. color:red;
  16. margin-right: 5px;
  17. }
  18. form.deleteCForm.modal-content.animate {
  19. width: 400px;
  20. height: 280px;
  21. margin-left: -15px;
  22. background-color: #dfe3e6;
  23. }
  24. div#deleteForm {
  25. width: 400px;
  26. height: 280px;
  27. border-radius: 0.5em;
  28. margin-top: 100px;
  29. }
  30. .form-group.deleterow label{
  31. height:20px;
  32. margin-left: 80px;
  33. margin-top: 52px;
  34. margin-bottom: 30px;
  35. color: #610e14;
  36. font-size: 20px;
  37. }
  38. input.btn.btn-default.deleteCustomer {
  39. background: radial-gradient(#0da3bb, #04161fc2);
  40. color: #610e14;
  41. font-family:-webkit-pictograph;
  42. font-size: 18px;
  43. margin-right: 20px;
  44. width: 70px;
  45. }
  46. #deleteid{
  47. margin-left:100px;
  48. }
  49. </style>
  50. <div class="container deleteForm modal" id="deleteForm">
  51. <form action="" method="post" class="modal-content animate deleteCForm">
  52. <span onclick="document.getElementById('deleteForm').style.display='none'" class="close" title="Close PopUp">&times;</span>
  53. <div class="form-group deleterow">
  54. <label>Are you sure want to delete?</label>
  55. </div>
  56. <input type="number" name="deleteid" id="deleteid">
  57. <!-- <input type="submit" name="delete" value="OK" class="btn btn-danger"> -->
  58. <div class="form-group">
  59. <div class="col-sm-offset-2 col-sm-10 Vsave">
  60. <input type="submit" name="delete" value="OK" class="btn btn-default deleteCustomer">
  61. <input type="button" class="btn btn-default cancel" value="Cancel" onclick="document.getElementById('deleteForm').style.display = 'none';">
  62. </div>
  63. </div>
  64. </form>
  65. </div>