177 lines
9.9 KiB
PHP
177 lines
9.9 KiB
PHP
@extends('layouts.layout-2')
|
|
|
|
@section('content')
|
|
<div class="card">
|
|
<h5 class="card-header">
|
|
{{ __('team.level_reports_title') }}
|
|
<span class="badge badge-info ml-2">{{ $promotions->count() }}</span>
|
|
</h5>
|
|
|
|
<div class="card-body p-0">
|
|
@if(isset($error))
|
|
<div class="alert alert-danger m-4">
|
|
<i class="fas fa-exclamation-triangle"></i> {{ $error }}
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Filter Form -->
|
|
<form method="GET" action="{{ route('user_team_level_reports') }}" class="form-horizontal" id="form_filter_level_reports">
|
|
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
|
<div class="col-6 col-sm-6 col-md-2 col-lg-2 mb-1">
|
|
<label class="small text-muted d-block">{{ __('team.level_reports_month') }}</label>
|
|
<select class="custom-select" name="month" required>
|
|
@foreach($availableMonths as $key => $value)
|
|
<option value="{{ $key }}" @if(isset($filters['month']) && $filters['month'] == $key) selected @elseif(!isset($filters['month']) && $key == date('m')) selected @endif>{{ $value }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-6 col-sm-6 col-md-2 col-lg-2 mb-1">
|
|
<label class="small text-muted d-block">{{ __('team.level_reports_year') }}</label>
|
|
<select class="custom-select" name="year" required>
|
|
@foreach($availableYears as $year)
|
|
<option value="{{ $year }}" @if(isset($filters['year']) && $filters['year'] == $year) selected @elseif(!isset($filters['year']) && $year == date('Y')) selected @endif>{{ $year }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-6 col-sm-6 col-md-3 col-lg-3 mb-1">
|
|
<div class="custom-control custom-checkbox mt-4">
|
|
<input type="checkbox" class="custom-control-input" id="not_updated" name="not_updated" value="1" @if(isset($filters['only_not_updated']) && $filters['only_not_updated']) checked @endif>
|
|
<label class="custom-control-label" for="not_updated">{{ __('team.level_reports_filter_not_updated') }}</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-6 col-sm-6 col-md-3 col-lg-3 mb-1">
|
|
<div class="mt-4">
|
|
<button type="submit" class="btn btn-primary mr-2">{{ __('team.level_reports_filter_button') }}</button>
|
|
<a href="{{ route('user_team_level_reports_export', request()->query()) }}" class="btn btn-success">{{ __('team.level_reports_csv_export') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
@if($promotions->count() > 0)
|
|
<!-- Statistiken -->
|
|
<div class="px-4 pb-3">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div class="card bg-primary text-white">
|
|
<div class="card-body">
|
|
<h4 class="card-title">{{ $statistics['total_count'] }}</h4>
|
|
<p class="card-text">{{ __('team.level_reports_total_promotions') }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-9">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h6 class="card-subtitle mb-2 text-muted">{{ __('team.level_reports_by_level') }}</h6>
|
|
@foreach($statistics['level_stats'] as $level => $count)
|
|
<span class="badge badge-secondary mr-1">{{ $level }}: {{ $count }}</span>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabelle -->
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover mb-0">
|
|
<thead class="thead-light">
|
|
<tr>
|
|
<th>{{ __('team.level_reports_table_date') }}</th>
|
|
<th>{{ __('team.level_reports_table_user') }}</th>
|
|
<th>{{ __('team.level_reports_table_from_level') }}</th>
|
|
<th>{{ __('team.level_reports_table_to_level') }}</th>
|
|
<th>{{ __('team.level_reports_table_current_level') }}</th>
|
|
<th>{{ __('team.level_reports_table_kp_quali') }}</th>
|
|
<th>{{ __('team.level_reports_table_user_kp') }}</th>
|
|
<th>{{ __('team.level_reports_table_pp_quali') }}</th>
|
|
<th>{{ __('team.level_reports_table_user_pp') }}</th>
|
|
<th>{{ __('team.level_reports_table_update') }}</th>
|
|
<th>{{ __('team.level_reports_table_active') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($promotions as $promotion)
|
|
<tr class="@if($promotion['level_updated'] === 'Nein' || $promotion['level_updated'] === __('team.no')) table-warning @endif">
|
|
<td>{{ $promotion['date'] }}</td>
|
|
<td>
|
|
<strong>{{ $promotion['first_name'] }} {{ $promotion['last_name'] }}</strong><br>
|
|
<small class="text-muted">
|
|
{{ __('team.ID') }}: {{ $promotion['user_id'] }}<br>
|
|
{{ $promotion['email'] }}
|
|
</small>
|
|
</td>
|
|
<td>
|
|
<span class="badge badge-secondary">
|
|
{{ $promotion['from_level_name'] }}
|
|
</span>
|
|
<br><small>{{ __('team.ID') }}: {{ $promotion['from_level_id'] }}</small>
|
|
</td>
|
|
<td>
|
|
<span class="badge badge-success">
|
|
{{ $promotion['to_level_name'] }}
|
|
</span>
|
|
<br><small>{{ __('team.ID') }}: {{ $promotion['to_level_id'] }}</small>
|
|
</td>
|
|
<td>
|
|
<span class="badge badge-info">
|
|
{{ $promotion['current_user_level_name'] }}
|
|
</span>
|
|
<br><small>{{ __('team.ID') }}: {{ $promotion['current_user_level_id'] ?? __('team.not_available') }}</small>
|
|
</td>
|
|
<td><span class="badge badge-outline-info">{{ number_format($promotion['to_level_qual_kp'], 0, ',', '.') }}</span></td>
|
|
<td><span class="badge badge-outline-success">{{ number_format($promotion['sales_volume_points_sum'], 0, ',', '.') }}</span></td>
|
|
<td><span class="badge badge-outline-info">{{ number_format($promotion['to_level_qual_pp'], 0, ',', '.') }}</span></td>
|
|
<td><span class="badge badge-outline-success">{{ number_format($promotion['payline_points_qual_kp'], 0, ',', '.') }}</span></td>
|
|
<td>
|
|
@if($promotion['level_updated'] === 'Ja' || $promotion['level_updated'] === __('team.yes'))
|
|
<span class="badge badge-success">{{ __('team.yes') }}</span>
|
|
@else
|
|
<span class="badge badge-warning">{{ __('team.no') }}</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($promotion['active_account'] === 'Ja' || $promotion['active_account'] === __('team.yes'))
|
|
<span class="badge badge-success">{{ __('team.yes') }}</span>
|
|
@else
|
|
<span class="badge badge-danger">{{ __('team.no') }}</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
@if(!empty($statistics['period_stats']))
|
|
<!-- Periode Statistiken -->
|
|
<div class="px-4 py-3 border-top">
|
|
<h6 class="text-muted mb-2">{{ __('team.level_reports_by_period') }}</h6>
|
|
@foreach($statistics['period_stats'] as $period => $count)
|
|
<span class="badge badge-outline-default mr-1">{{ $period }}: {{ $count }}</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
@else
|
|
<div class="px-4 py-5 text-center">
|
|
<h5 class="text-muted">{{ __('team.level_reports_no_data') }}</h5>
|
|
<p class="text-muted">{{ __('team.level_reports_no_data_description') }}</p>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Auto-submit Form bei Änderung der Filter
|
|
const selects = document.querySelectorAll('#form_filter_level_reports select, #form_filter_level_reports input[type="checkbox"]');
|
|
selects.forEach(function(select) {
|
|
select.addEventListener('change', function() {
|
|
document.getElementById('form_filter_level_reports').submit();
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|
|
|