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

	$id = $_POST['id'];
    $number = $_POST['number'];
	
	$sql ="UPDATE vehicle SET number='$number' WHERE id='$id'";
    
    $db->exec($sql);

    echo '<script>window.location.href="customers.php"</script>';

	}
 ?>
<style type="text/css">
 	.editVehicleForm {
 		display: none;
 	}
</style>
<div class="container editVehicleForm" id="editVForm">
<form class="form-horizontal" action="" method="post">
	<input type="text" name="id" id="vehicle_id" hidden="hidden">
    <div class="form-group">
     <label class="control-label col-sm-2"> Number </label>
    <div class="col-sm-10"> 
      
		<input type="text" name="number" id="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('editVForm').style.display = 'none';">
		</div>
	</div>
	</form>
</div>