editVehicle.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. require "connectionDb.php";
  3. if (isset($_POST['saveNumber']) && isset($_POST['id']) && isset($_POST['number'])) {
  4. $id = $_POST['id'];
  5. $number = $_POST['number'];
  6. $sql ="UPDATE vehicle SET number='$number' WHERE id='$id'";
  7. $db->exec($sql);
  8. echo '<script>window.location.href="customers.php"</script>';
  9. }
  10. ?>
  11. <style type="text/css">
  12. .editVehicleForm {
  13. display: none;
  14. }
  15. .editVehicleForm span{
  16. color:red;
  17. margin-right: 5px;
  18. }
  19. form.form-horizontal.editVehicle.modal-content.animate {
  20. width: 400px;
  21. height: 280px;
  22. margin-left: -15px;
  23. background-color: #dfe3e6;
  24. }
  25. div#editVForm {
  26. width: 400px;
  27. height: 280px;
  28. border-radius: 0.5em;
  29. margin-top: 100px;
  30. }
  31. .form-group.Veditrow1{
  32. margin-left: 50px;
  33. }
  34. .form-group.Veditrow1 input[type='text']{
  35. border:1px solid grey;
  36. border-radius: 0.5em;
  37. height: 35px;
  38. width: 150px;
  39. font-size: 14px;
  40. font-weight: bold;
  41. color: #337ab7;
  42. text-align:center;
  43. margin-left: 15px;
  44. }
  45. .form-group.Veditrow1 label{
  46. color: #610e14;
  47. font-family:-webkit-pictograph;
  48. font-size: 15px;
  49. }
  50. input.btn.btn-default.editVSave {
  51. background: radial-gradient(#0da3bb, #04161fc2);
  52. color: #610e14;
  53. font-family:-webkit-pictograph;
  54. font-size: 18px;
  55. margin-right: 20px;
  56. width: 70px;
  57. }
  58. input.btn.btn-default.editVCancel {
  59. background: radial-gradient(#b71515eb, #ef0b0bdb);
  60. color: #fff;
  61. font-family:-webkit-pictograph;
  62. font-size:18px;
  63. width: 78px;
  64. }
  65. .form-group.editVBtn {
  66. margin-left: 30px;
  67. margin-top: 50px;
  68. }
  69. </style>
  70. <div class="container editVehicleForm modal" id="editVForm">
  71. <form class="form-horizontal modal-content animate editVehicle" action="" method="post">
  72. <span onclick="document.getElementById('editVForm').style.display='none'" class="close" title="Close PopUp">&times;</span>
  73. <div class="form-group row1">
  74. <label>Edit Vehicle</label>
  75. </div>
  76. <input type="text" name="id" id="vehicle_id" hidden="hidden">
  77. <div class="form-group Veditrow1">
  78. <label class="control-label col-sm-3">Number: </label>
  79. <div class="col-sm-9">
  80. <input type="text" name="number" id="number">
  81. </div>
  82. </div>
  83. <div class="form-group editVBtn">
  84. <div class="col-sm-offset-2 col-sm-10">
  85. <input type="submit" name="saveNumber" class="btn btn-default editVSave" value="Save">
  86. <input type="button" value="Cancel" class="btn btn-default editVCancel" onclick="document.getElementById('editVForm').style.display = 'none';">
  87. </div>
  88. </div>
  89. </form>
  90. </div>