<?php 
  require "connectionDb.php";
    if (isset($_POST['saveNumber']) && isset($_POST['number']) ) {
   
     $number = $_POST['number'];
     $cid = $_COOKIE['customerId'];

    $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');");

    echo '<script>window.location.href="customers.php"</script>';
    }
 ?>
<style type="text/css">
 	.addVehicleForm {
 		display: none;
 	}
</style>
<div class="container addVehicleForm" id="addVForm">
<form class="form-horizontal" action="" method="post">
    <div class="form-group">
     <label class="control-label col-sm-2"> Number </label>
    <div class="col-sm-10"> 
		<input type="text" name="number">
    </div>
   </div>

    <div class="form-group">
    	<div class="col-sm-offset-2 col-sm-10"> 
		<input type="submit" name="saveNumber" value="Save">
		<input type="button" value="Cancel" onclick="document.getElementById('addVForm').style.display = 'none';">
		</div>
	</div>
	</form>
</div>