Ich Ich, gros commit

This commit is contained in:
bglacial
2018-10-08 22:31:58 +02:00
parent ecded0947f
commit b11b2befd7
49 changed files with 37276 additions and 11977 deletions

View File

@ -0,0 +1,73 @@
@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

View File

@ -0,0 +1,93 @@
@extends('layouts.loggedform')
@section('card')
@component('components.card')
@slot('title')
@lang('Liste des pilotes - ') <a href="{{route("pilot.create")}}"><i class="far fa-plus-square"></i></a>
@endslot
<table class="table table-bordered" id="pilots-table">
<thead>
<tr>
<th></th>
<th>kart_name</th>
<th>Name</th>
<th>first_name</th>
<th>ref_time</th>
</tr>
</thead>
</table>
<script type="text/javascript">
var tablePilots = '';
window.deletePilot = function (id) {
$.ajax({
url: '/pilot/' + id,
type: 'DELETE', // user.destroy
success: function (result) {
console.log('OK');
}
});
}
window.reloadData = function (id, name) {
document.cookie = "active_kartid=" + id;
document.cookie = "active_kartname=" + name;
if (name != null)
$('#btnChoiceKartTitle').html(name);
$.ajax({
url: '/getpilotsBykart',
data: {id: id},
success: function (data) {
$("#kartid").val(id);
if (tablePilots != '')
tablePilots.destroy();
tablePilots = $('#pilots-table').DataTable({
data: data.data,
columns: [
{
data: 'id',
render:
function (data, type, row, meta) {
return '<a onclick="deletePilot(' + data + ');tablePilots.row( $(this).parents(\'tr\') ).remove().draw();"><i class="far fa-trash-alt"></i></a>';
}
},
{
data: 'kart_name'
}
,
{
data: 'name'
}
,
{
data: 'first_name'
}
,
{
data: 'ref_time',
render:
function (data, type, row, meta) {
return moment.utc(data*1000).format('mm:ss');
}
}
]
})
;
}
});
}
$(() => {
reloadData(getCookie('active_kartid'), getCookie('active_kartname'));
})
</script>
@endcomponent
@endsection

View File

@ -0,0 +1,9 @@
@extends('layouts.form')
@section('card')
@component('components.card')
@slot('title')
@lang('Ajouter une team')
@endslot
@endcomponent
@endsection