<?php
require_once("../dbconfig.php");
if(!empty($_POST["keyword"])) {
$query ="select employees.id,employees.phone,employees.first_name,vehicle_make.make,vehicles.color,vehicles.reg
from vehicles
left join employees on vehicles.driver_id=employees.id
left join vehicle_make on vehicles.make=vehicle_make.id
WHERE employees.first_name LIKE '". $_POST["keyword"] . "%' ORDER BY first_name LIMIT 0,6";


$result = $con->query($query);
$rowcount=mysqli_num_rows($result);
//echo $rowcount;
if($rowcount>0) {
?>
<ul  class="list-group" id="passenger_name-list">
<?php
foreach($result as $customer) {
?>
<li class="list-group-item list-group-item-action" style="cursor: pointer; width:420px;font-family:Montserrat; font-size:12px; font-weight:bold; color:#FBF2F2; padding:10px; background-color:#05629E;" onClick="selectDriver('<?php echo $customer["id"].'-'.$customer["first_name"]; ?>');"><?php echo $customer["first_name"]." ".$customer["reg"]." ".$customer["phone"]." ".$customer["make"]." ".$customer["color"]; ?></li>

<?php } ?>
<script>
 $('#new_driver').hide();
 
 

</script>

<?php }

echo '</ul>';

 } ?>
