netgescon-day0/resources/views/gescon_import/index.blade.php

82 lines
3.0 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container py-3">
<h1 class="h4 mb-3">Import Gescon Dashboard</h1>
@if(session('status'))<div class="alert alert-success">{{ session('status') }}</div>@endif
@if(session('error'))<div class="alert alert-danger">{{ session('error') }}</div>@endif
<div class="card mb-4">
<div class="card-header">Avvia Import</div>
<div class="card-body">
<form method="post" action="{{ route('gescon.import.run') }}" class="row g-2">
@csrf
<div class="col-md-2">
<label class="form-label">Stabile</label>
<input type="text" name="stabile" value="{{ old('stabile') }}" class="form-control" placeholder="0021"/>
</div>
<div class="col-md-2">
<label class="form-label">Anno</label>
<input type="text" name="anno" value="{{ old('anno') }}" class="form-control" placeholder="2024"/>
</div>
<div class="col-md-2">
<label class="form-label">Limit</label>
<input type="number" name="limit" value="{{ old('limit', 200) }}" class="form-control"/>
</div>
<div class="col-md-3">
<label class="form-label">Solo Step</label>
<select name="solo" class="form-select">
<option value="">tutto</option>
@foreach(['unita','soggetti','diritti','millesimi','voci','operazioni','rate','incassi','giroconti','straord','addebiti','detrazioni'] as $s)
<option value="{{ $s }}">{{ $s }}</option>
@endforeach
</select>
</div>
<div class="col-md-2 form-check mt-4 ms-2">
<input class="form-check-input" type="checkbox" name="dry_run" value="1" id="dryrun">
<label class="form-check-label" for="dryrun">Dry run</label>
</div>
<div class="col-12">
<button class="btn btn-primary">Esegui Import</button>
</div>
</form>
@if(!empty($output))
<details class="mt-3">
<summary>Output comando</summary>
<pre class="bg-light p-2 small">{{ $output }}</pre>
</details>
@endif
</div>
</div>
<div class="card">
<div class="card-header">Viste QA</div>
<div class="card-body p-0">
<table class="table mb-0">
<thead>
<tr>
<th>Vista</th>
<th>Records</th>
<th>Azioni</th>
</tr>
</thead>
<tbody>
@foreach($viewsStatus as $v)
<tr>
<td>{{ $v['label'] }} <code class="text-muted">{{ $v['view'] }}</code></td>
<td>{{ $v['exists'] ? number_format($v['count']) : '—' }}</td>
<td>
@if($v['exists'] && $v['count']>0)
<a class="btn btn-sm btn-outline-secondary" href="{{ route('gescon.import.view', $v['view']) }}">Apri</a>
@else
<span class="text-muted">Non disponibile</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection