Ich Ich, gros commit
This commit is contained in:
93
resources/views/pilot/index.blade.php
Executable file
93
resources/views/pilot/index.blade.php
Executable 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
|
Reference in New Issue
Block a user