Rapport-Laravel/resources/views/titanshcpgatheringreport/list.blade.php

89 lines
4.1 KiB
PHP

@extends('layouts.vertical', ['page_title' => $title ?? 'Titans HCP Gathering Report'])
@section('content')
<div class="container-fluid">
<div class="row align-items-center mb-3">
<div class="col-md-6 p-2">
<h4 class="page-title">{{ $title }}</h4>
</div>
<div class="col-md-6 p-2 text-end">
@if (isset($buttons))
@foreach ($buttons as $button)
<a href="{{ $button['link'] }}" class="btn btn-dark waves-effect waves-light me-2">
{{ $button['title'] }}
</a>
@endforeach
@endif
</div>
</div>
@if (session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
@if (session()->has('error'))
<div class="alert alert-danger">
{{ session()->get('error') }}
</div>
@endif
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h5 class="mb-3">Import History</h5>
<div class="table-responsive">
<table class="table table-sm table-bordered mb-0">
<thead>
<tr>
<th>ID</th>
<th>File</th>
<th>Report Month</th>
<th>Status</th>
<th>Total</th>
<th>Inserted</th>
<th>Replaced</th>
<th>Skipped</th>
<th>Errors</th>
<th>Uploaded</th>
<th>Processed</th>
</tr>
</thead>
<tbody>
@forelse ($imports as $import)
<tr>
<td>{{ $import->id }}</td>
<td>{{ $import->file_name }}</td>
<td>{{ $import->report_month }}</td>
<td>{{ $import->status }}</td>
<td>{{ $import->total_rows ?? '-' }}</td>
<td>{{ $import->inserted_count }}</td>
<td>{{ $import->replaced_count }}</td>
<td>{{ $import->skipped_count }}</td>
<td>{{ $import->error_count }}</td>
<td>{{ $import->created_at }}</td>
<td>{{ $import->processed_at ?? '-' }}</td>
</tr>
@if (!empty($import->error_log))
<tr>
<td colspan="11" class="text-danger small">
{{ Str::limit($import->error_log, 500) }}
</td>
</tr>
@endif
@empty
<tr>
<td colspan="11" class="text-center text-muted">No imports yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection