addVehicle.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. require "connectionDb.php";
  3. if (isset($_POST['saveNumber']) && isset($_POST['number']) ) {
  4. $number = $_POST['number'];
  5. $cid = $_COOKIE['customerId'];
  6. $db->exec("INSERT INTO vehicle (type,created_at,updated_at,customer_id,number) VALUES ('',strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),'$cid','$number');");
  7. echo '<script>window.location.href="customers.php"</script>';
  8. }
  9. ?>
  10. <style type="text/css">
  11. .addVehicleForm {
  12. display: none;
  13. }
  14. form.form-horizontal.vehicleForm.modal-content.animate {
  15. width: 400px;
  16. height: 280px;
  17. margin-left: -15px;
  18. background-color: #dfe3e6;
  19. }
  20. div#addVForm {
  21. width: 400px;
  22. height: 280px;
  23. border-radius: 0.5em;
  24. margin-top: 100px;
  25. }
  26. .vehicleForm span{
  27. color:red;
  28. margin-right: 5px;
  29. }
  30. input[type="submit"].btn.btn-default.saveNumber {
  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. input[type="button"].btn.btn-default.cancel {
  39. background: radial-gradient(#b71515eb, #ef0b0bdb);
  40. color: #fff;
  41. font-family:-webkit-pictograph;
  42. font-size:18px;
  43. width: 73px;
  44. }
  45. .col-sm-offset-2.col-sm-10.Vsave {
  46. margin-top: 75px;
  47. margin-left: 120px;
  48. }
  49. .form-group.vrow1 label{
  50. height:20px;
  51. margin-left: 100px;
  52. margin-top:20px;
  53. margin-bottom:30px;
  54. color: #610e14;
  55. font-family:-webkit-pictograph;
  56. font-size: 20px;
  57. }
  58. .form-group.vrow2{
  59. margin-left: 50px;
  60. }
  61. .form-group.vrow2 label{
  62. color: #610e14;font-family:-webkit-pictograph;
  63. }
  64. </style>
  65. <div class="container addVehicleForm modal" id="addVForm">
  66. <form class="form-horizontal vehicleForm modal-content animate" action="" method="post">
  67. <span onclick="document.getElementById('addVForm').style.display='none'" class="close" title="Close PopUp">&times;</span>
  68. <div class="form-group vrow1">
  69. <label style="">New Vehicle</label>
  70. </div>
  71. <div class="form-group vrow2">
  72. <label class="control-label col-sm-2"> Number: </label>
  73. <div class="col-sm-10">
  74. <input type="text" name="number" required="true">
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <div class="col-sm-offset-2 col-sm-10 Vsave">
  79. <input type="submit" class="btn btn-default saveNumber" name="saveNumber" value="Save">
  80. <input type="button" class="btn btn-default cancel" value="Cancel" onclick="document.getElementById('addVForm').style.display = 'none';">
  81. </div>
  82. </div>
  83. </form>
  84. </div>