<?php include("../cn.php");
$id = $_REQUEST["car"];
?>
<div class="col-md-6 col-sm-12 col-xs-12 form-group" id="pickup">
    <select class="form-control select" name="pickup" id="source">
        <option value="">-- Pick-Up --</option>
         <?php $sql = mysqli_query($connect,"select routes.* from routes where routes.Car = '$id' group by PickUp");
             while($data = mysqli_fetch_assoc($sql)){
                $sql_in = mysqli_query($connect, "select * from emirates where Id = '".$data['PickUp']."' ");
                $data_in = mysqli_fetch_assoc($sql_in);
             ?>
             <option value="<?php echo $data["PickUp"]?>"
             ><?php echo $data_in["Title"]?></option>
             <?php }?>
    </select>
</div>
<div class="col-md-6 col-sm-12 col-xs-12 form-group" id="dropoff">
    <select class="form-control select" name="destination" id="destination">
        <option value="">-- Drop-Off --</option>
        <?php $sql = mysqli_query($connect,"select routes.* from routes where routes.Car = '$id' group by Destination");
             while($data = mysqli_fetch_assoc($sql)){
                $sql_in = mysqli_query($connect, "select * from emirates where Id = '".$data['Destination']."' ");
                $data_in = mysqli_fetch_assoc($sql_in);
             ?>
             <option value="<?php echo $data["Destination"]?>"
             ><?php echo $data_in["Title"]?></option>
              <?php }?>
    </select>
</div>