73 lines
2.3 KiB
PHP
Executable File
73 lines
2.3 KiB
PHP
Executable File
@extends('layouts.loggedform')
|
|
@section('card')
|
|
@component('components.card')
|
|
@slot('title')
|
|
@lang('Ajouter un pilote')
|
|
@endslot
|
|
<form method="POST" action="{{url('pilot')}}">
|
|
{{ csrf_field() }}
|
|
@include('partials.form-group', [
|
|
'title' => __('Prénom du pilote'),
|
|
'type' => 'text',
|
|
'name' => 'name',
|
|
'required' => true,
|
|
])
|
|
@include('partials.form-group', [
|
|
'title' => __('Nom du pilote'),
|
|
'type' => 'text',
|
|
'name' => 'first_name',
|
|
'required' => true,
|
|
])
|
|
@include('partials.form-group', [
|
|
'title' => __('Temp de référence'),
|
|
'type' => 'text',
|
|
'name' => 'ref_time',
|
|
'required' => true,
|
|
])
|
|
<div class="form-group">
|
|
<label for="first_name">Nom du pilote</label>
|
|
<select id="kart_id" class="form-control" name="kart_id" >
|
|
</select>
|
|
|
|
</div>
|
|
@component('components.button')
|
|
@lang('Envoyer')
|
|
@endcomponent
|
|
</form>
|
|
@endcomponent
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(() => {
|
|
|
|
$.ajaxSetup({
|
|
headers: {
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
}
|
|
});
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '/getkartsalldata',
|
|
data: {},
|
|
success: function (data) {
|
|
$( "#kart_id" ).html("");
|
|
$.each(data.data, function(k, v) {
|
|
|
|
if( $( "#kart_id" ).val() == v.id){
|
|
$('#kart_id').append($('<option>', {
|
|
value: v.id,
|
|
selected:true,
|
|
text: v.name
|
|
}));
|
|
}else{
|
|
$('#kart_id').append($('<option>', {
|
|
value: v.id,
|
|
text: v.name
|
|
}));
|
|
}
|
|
});
|
|
}
|
|
});
|
|
})
|
|
</script>
|
|
@endsection |