mivita/resources/views/user/team/_points_detail.blade.php
2022-07-29 18:18:05 +02:00

110 lines
4.5 KiB
PHP

@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<h4 class="font-weight-bold py-2 mb-2">
{{ __('navigation.my_team') }}
</h4>
<div class="card">
<h5 class="card-header">
{{__('Points')}}
</h5>
<div class="card-body">
{!! Form::open(['url' => route('user_team_points'), 'class' => 'form-horizontal', 'id'=>'form_filter_user_points']) !!}
<div class="form-row align-items-center px-0 pb-2 pt-0">
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<select class="custom-select on_change_select_filter" name="team_user_points_filter_month">
@foreach($filter_months as $key=>$value)
<option value="{{$key}}" @if(session('team_user_points_filter_month') == $key) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<select class="custom-select on_change_select_filter" name="team_user_points_filter_year">
@foreach($filter_years as $key=>$value)
<option value="{{$value}}" @if(session('team_user_points_filter_year') == $value) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
</div>
{!! Form::close() !!}
<hr class="container-m-nx border-light mt-0">
<div class="card">
<div class="card-datatable table-responsive">
<table class="table table-striped table-bordered" id="datatable-user-points">
<thead>
<tr>
<th>{{__('Datum') }}</th>
<th>{{__('Points')}}</th>
<th>{{__('Umsatz netto')}}</th>
<th>{{__('Art')}}</th>
<th>{{__('Bestellung')}}</th>
<th>{{__('Info') }}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
var oTable = $('#datatable-user-points').DataTable({
"processing": true,
"serverSide": true,
"stateSave": true,
"searching": false,
ajax: {
url: '{!! route('user_team_datatable_points') !!}',
data: function(d) {
d.team_user_points_filter_month = $('select[name=team_user_points_filter_month]').val();
d.team_user_points_filter_year = $('select[name=team_user_points_filter_year]').val();
}
},
"order": [[0, "desc" ]],
"columns": [
{ data: 'date', name: 'date' },
{ data: 'points', name: 'points' },
{ data: 'total_net', name: 'total_net' },
{ data: 'status', name: 'status', searchable: false },
{ data: 'order', name: 'order', orderable: false },
{ data: 'message', name: 'message', searchable: false },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
},
"drawCallback": function( settings ) {
alert( 'DataTables has redrawn the table' );
}
});
$('select.on_change_select_filter').on('change', function(){
oTable.draw();
});
$('input.on_keyup_input_filter').on('keyup', function(){
oTable.draw();
});
});
</script>
@endsection