addVehicle.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.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. input[type="submit"].btn.btn-default {
  27. background: radial-gradient(#0da3bb, #04161fc2);
  28. color: #610e14;
  29. font-family:-webkit-pictograph;
  30. font-size: 18px;
  31. margin-right: -84px;
  32. width: 70px;
  33. }
  34. input[type="button"].btn.btn-default {
  35. background: radial-gradient(#b71515eb, #ef0b0bdb);
  36. color: #fff;
  37. font-family:-webkit-pictograph;
  38. font-size:18px;
  39. width: 73px;
  40. }
  41. .col-sm-offset-2.col-sm-10 {
  42. margin-top: 95px;
  43. margin-left: 30px;
  44. }*/
  45. </style>
  46. <div class="container addVehicleForm" id="addVForm">
  47. <form class="form-horizontal" action="" method="post">
  48. <!-- <span onclick="document.getElementById('addVForm').style.display='none'" class="close" title="Close PopUp" style="color:red;margin-right: 5px;">&times;</span> -->
  49. <div class="form-group" style="width: height:20px;margin-left: 150px;margin-top:20px;margin-bottom:30px;">
  50. <label style="color: #610e14;font-family:-webkit-pictograph;font-size: 20px;">New Vehicle</label>
  51. </div>
  52. <div class="form-group" style="margin-left: 50px;">
  53. <label class="control-label col-sm-2" style="color: #610e14;font-family:-webkit-pictograph;"> Number </label>
  54. <div class="col-sm-10">
  55. <input type="text" name="number">
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <div class="col-sm-offset-2 col-sm-10">
  60. <input type="submit" class="btn btn-default" name="saveNumber" value="Save">
  61. <input type="button" class="btn btn-default cancel" value="Cancel" onclick="document.getElementById('addVForm').style.display = 'none';">
  62. </div>
  63. </div>
  64. </form>
  65. </div>