deleteVehicle.php 1.7 KB

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