ultimatepos/Modules/Portal/Resources/views/customer/maintenance/index.blade.php

107 lines
6.8 KiB
PHP

@extends('portal::layouts.customer')
@section('title', __('portal::lang.maintenance_hub'))
@section('content')
<section class="portal-page-header">
<h1>@lang('portal::lang.maintenance_hub')</h1>
<p class="text-muted">@lang('portal::lang.maintenance_hub_help')</p>
</section>
<section class="content portal-dashboard">
<div class="portal-stat-grid">
<div class="portal-stat-card portal-stat-card--blue">
<div class="portal-stat-card__icon"><i class="fas fa-project-diagram"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.my_projects')</span>
<strong class="portal-stat-card__value">{{ $stats['projects'] ?? 0 }}</strong>
</div>
</div>
<div class="portal-stat-card portal-stat-card--green">
<div class="portal-stat-card__icon"><i class="fas fa-stream"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.production_lines')</span>
<strong class="portal-stat-card__value">{{ $stats['production_lines'] ?? 0 }}</strong>
</div>
</div>
<div class="portal-stat-card portal-stat-card--orange">
<div class="portal-stat-card__icon"><i class="fas fa-cogs"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.my_equipment')</span>
<strong class="portal-stat-card__value">{{ $stats['equipment'] ?? 0 }}</strong>
</div>
</div>
<div class="portal-stat-card portal-stat-card--blue">
<div class="portal-stat-card__icon"><i class="fas fa-wrench"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.open_work_orders')</span>
<strong class="portal-stat-card__value">{{ $stats['open_work_orders'] ?? 0 }}</strong>
</div>
</div>
<div class="portal-stat-card portal-stat-card--green">
<div class="portal-stat-card__icon"><i class="fas fa-calendar-check"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.upcoming_services')</span>
<strong class="portal-stat-card__value">{{ $stats['upcoming_services'] ?? 0 }}</strong>
</div>
</div>
<div class="portal-stat-card portal-stat-card--orange">
<div class="portal-stat-card__icon"><i class="fas fa-map-marked-alt"></i></div>
<div class="portal-stat-card__body">
<span class="portal-stat-card__label">@lang('portal::lang.active_missions')</span>
<strong class="portal-stat-card__value">{{ $stats['active_missions'] ?? 0 }}</strong>
</div>
</div>
</div>
<div class="portal-hub-links">
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ProjectController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-project-diagram"></i><span>@lang('portal::lang.my_projects')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ProductionLineController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-stream"></i><span>@lang('portal::lang.production_lines')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\EquipmentController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-cogs"></i><span>@lang('portal::lang.my_equipment')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\PreventiveScheduleController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-calendar-alt"></i><span>@lang('portal::lang.periodic_services')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\WorkOrderController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-wrench"></i><span>@lang('portal::lang.work_orders')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\FieldMissionController::class, 'index']) }}" class="portal-hub-link"><i class="fas fa-map-marked-alt"></i><span>@lang('portal::lang.field_missions')</span></a>
<a href="{{ action([\Modules\Portal\Http\Controllers\Customer\ServiceRequestController::class, 'create']) }}" class="portal-hub-link portal-hub-link--accent"><i class="fas fa-headset"></i><span>@lang('portal::lang.new_service_request')</span></a>
</div>
@if($upcomingServices->count())
<div class="box box-primary">
<div class="box-header"><h3 class="box-title">@lang('portal::lang.upcoming_services')</h3></div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped">
<thead><tr><th>@lang('maintenance::lang.title')</th><th>@lang('portal::lang.linked_equipment')</th><th>@lang('portal::lang.due_date')</th><th></th></tr></thead>
<tbody>
@foreach($upcomingServices as $schedule)
<tr>
<td>{{ $schedule->title }}</td>
<td>{{ $schedule->equipment->name ?? ($schedule->productionLine->name ?? $schedule->project->name ?? '-') }}</td>
<td>@if($schedule->next_due_at) @format_datetime($schedule->next_due_at) @else - @endif</td>
<td><a href="{{ action([\Modules\Portal\Http\Controllers\Customer\PreventiveScheduleController::class, 'show'], [$schedule->id]) }}" class="btn btn-xs btn-info">@lang('portal::lang.view_details')</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@if($recentWorkOrders->count())
<div class="box box-primary">
<div class="box-header"><h3 class="box-title">@lang('portal::lang.related_work_orders')</h3></div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped">
<thead><tr><th>@lang('maintenance::lang.wo_number')</th><th>@lang('portal::lang.linked_equipment')</th><th>@lang('portal::lang.status')</th><th></th></tr></thead>
<tbody>
@foreach($recentWorkOrders as $wo)
<tr>
<td>{{ $wo->work_order_number ?? $wo->id }}</td>
<td>{{ $wo->equipment->name ?? '-' }}</td>
<td>{{ $wo->status }}</td>
<td><a href="{{ action([\Modules\Portal\Http\Controllers\Customer\WorkOrderController::class, 'show'], [$wo->id]) }}" class="btn btn-xs btn-info">@lang('portal::lang.view_details')</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</section>
@endsection