ultimatepos/Modules/ManagementTools/Resources/views/daily_reports/analytics.blade.php

81 lines
4.2 KiB
PHP

@extends('layouts.app')
@section('title', __('managementtools::lang.report_analytics'))
@section('content')
@include('managementtools::layouts.nav')
@php $reportUtil = app(\Modules\ManagementTools\Utils\DailyReportUtil::class); @endphp
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1><i class="fas fa-chart-bar" style="color:#2563eb;margin-left:8px;"></i> @lang('managementtools::lang.report_analytics')</h1>
</div>
<div class="mt-card">
<div class="mt-card-body">
{!! Form::open(['url' => action([\Modules\ManagementTools\Http\Controllers\DailyReportController::class, 'analytics']), 'method' => 'get', 'class' => 'form-inline', 'style' => 'margin-bottom:20px;']) !!}
<div class="form-group" style="margin-left:8px;">
{!! Form::label('start_date', __('managementtools::lang.start_date').':') !!}
{!! Form::text('start_date', $start_date, ['class' => 'form-control mt-datepicker', 'id' => 'mt_start_date', 'readonly', 'autocomplete' => 'off']) !!}
</div>
<div class="form-group" style="margin-left:8px;">
{!! Form::label('end_date', __('managementtools::lang.end_date').':') !!}
{!! Form::text('end_date', $end_date, ['class' => 'form-control mt-datepicker', 'id' => 'mt_end_date', 'readonly', 'autocomplete' => 'off']) !!}
</div>
<div class="form-group" style="margin-left:8px;">
{!! Form::label('user_id', __('managementtools::lang.user').':') !!}
{!! Form::select('user_id', $users, $user_id, ['class' => 'form-control select2', 'style' => 'width:220px', 'placeholder' => __('managementtools::lang.please_select')]) !!}
</div>
<button type="submit" class="btn btn-primary" style="margin-right:8px;">@lang('managementtools::lang.filters')</button>
{!! Form::close() !!}
@if($start_date && $end_date && $user_id)
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>@lang('managementtools::lang.report_body')</th>
<th>@lang('managementtools::lang.repeat_count')</th>
<th>@lang('managementtools::lang.slot_time')</th>
<th>@lang('managementtools::lang.manager_score')</th>
<th>@lang('managementtools::lang.user_status')</th>
<th>@lang('managementtools::lang.added_on')</th>
</tr>
</thead>
<tbody>
@forelse($grouped as $report)
<tr>
<td>{{ $report->body }}</td>
<td>{{ $report->body_count }}</td>
<td>{{ $mtUtil->formatDateTime($report->first_slot) }} {{ $mtUtil->formatDateTime($report->last_slot) }}</td>
<td>{{ $reportUtil->scoreLabel($report->score) }}</td>
<td>{{ $reportUtil->userStatusLabel($report->user_status) }}</td>
<td>{{ $mtUtil->formatDateTime($report->created_at) }}</td>
</tr>
@empty
<tr><td colspan="6" class="text-center">@lang('managementtools::lang.no_data')</td></tr>
@endforelse
</tbody>
</table>
</div>
@else
<div class="mt-coming-soon">
<p>@lang('managementtools::lang.select_filters_hint')</p>
</div>
@endif
</div>
</div>
</section>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function() {
if (typeof MtDate !== 'undefined') {
MtDate.initDatepicker('#mt_start_date, #mt_end_date');
}
});
</script>
@endsection