2018-02-25 05:38:25 +08:00
|
|
|
@section('scripts')
|
2018-03-13 09:14:55 +08:00
|
|
|
<script>
|
|
|
|
const select_id = "select#aircraft_select";
|
|
|
|
const destContainer = $('#fares_container');
|
2018-02-25 05:38:25 +08:00
|
|
|
|
2018-03-13 09:14:55 +08:00
|
|
|
$(select_id).change((e) => {
|
2018-02-25 05:38:25 +08:00
|
|
|
|
2018-03-13 09:14:55 +08:00
|
|
|
const aircraft_id = $(select_id + ' option:selected').val();
|
|
|
|
const url = '{{ url('/pireps/fares') }}?aircraft_id=' + aircraft_id;
|
|
|
|
console.log('aircraft select change: ', aircraft_id);
|
|
|
|
|
|
|
|
axios.get(url).then(response => {
|
|
|
|
console.log('returned new fares', response);
|
|
|
|
destContainer.html(response.data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endsection
|