ultimatepos/Modules/ManagementTools/Resources/views/skills/report.blade.php

114 lines
5.0 KiB
PHP

@extends('layouts.app')
@section('title', __('managementtools::lang.skills_report'))
@section('content')
@include('managementtools::layouts.nav')
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1><i class="fas fa-chart-pie" style="color:#2563eb;margin-left:8px;"></i> @lang('managementtools::lang.skills_report')</h1>
<a href="{{ action([\Modules\ManagementTools\Http\Controllers\SkillController::class, 'index']) }}" class="btn btn-default">
<i class="fa fa-list"></i> @lang('managementtools::lang.skills')
</a>
</div>
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="mt-card">
<div class="mt-card-body text-center">
<h3 style="margin:0;font-size:28px;color:#2563eb;">{{ $summary['total_employees'] }}</h3>
<p class="text-muted">@lang('managementtools::lang.total_employees')</p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="mt-card">
<div class="mt-card-body text-center">
<h3 style="margin:0;font-size:28px;color:#16a34a;">{{ $summary['employees_with_skills'] }}</h3>
<p class="text-muted">@lang('managementtools::lang.employees_with_skills')</p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="mt-card">
<div class="mt-card-body text-center">
<h3 style="margin:0;font-size:28px;color:#ea580c;">{{ $summary['employees_without_skills'] }}</h3>
<p class="text-muted">@lang('managementtools::lang.employees_without_skills')</p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="mt-card">
<div class="mt-card-body text-center">
<h3 style="margin:0;font-size:28px;color:#64748b;">{{ $rows->count() }}</h3>
<p class="text-muted">@lang('managementtools::lang.total_skills_defined')</p>
</div>
</div>
</div>
</div>
<div class="mt-card">
<div class="mt-card-header">
<h3 class="mt-card-title">@lang('managementtools::lang.skills_by_employee_count')</h3>
</div>
<div class="mt-card-body">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="mt_skills_report_table">
<thead>
<tr>
<th>@lang('managementtools::lang.title')</th>
<th>@lang('managementtools::lang.employee_count')</th>
<th>@lang('managementtools::lang.employees')</th>
</tr>
</thead>
<tbody>
@forelse($rows as $row)
<tr>
<td><strong>{{ $row->skill->title }}</strong></td>
<td class="text-center">
<span class="label {{ $row->employee_count > 0 ? 'label-success' : 'label-default' }}">
{{ $row->employee_count }}
</span>
</td>
<td>
@if($row->employees->isEmpty())
<span class="text-muted"></span>
@else
@foreach($row->employees as $emp)
<a href="{{ action([\App\Http\Controllers\ManageUserController::class, 'show'], [$emp->id]) }}" class="label label-info" style="margin:2px;display:inline-block;">
{{ trim($emp->first_name . ' ' . ($emp->last_name ?? '')) }}
@if($emp->skill_level > 1)
({{ $emp->skill_level }})
@endif
</a>
@endforeach
@endif
</td>
</tr>
@empty
<tr>
<td colspan="3" class="text-center">@lang('managementtools::lang.no_skills_defined')</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</section>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function() {
$('#mt_skills_report_table').DataTable({
paging: true,
searching: true,
order: [[1, 'desc']],
language: typeof datatable_lang !== 'undefined' ? datatable_lang : {}
});
});
</script>
@endsection