@extends('layouts.app')
@section('titulo','Reportes')
@section('contenido')
<h4><i class="fa fa-chart-line"></i> Reportes</h4>
<div class="row g-3">
  <div class="col-md-6">
    <div class="card h-100">
      <div class="card-header"><strong><i class="fa fa-file-excel"></i> Exportar órdenes</strong></div>
      <form method="GET" action="{{ route('reportes.ordenes.excel') }}" class="card-body">
        <div class="row g-2">
          <div class="col-md-6"><label class="form-label small">Clase</label>
            <select name="clase" class="form-select"><option value="">Todas</option>
              <option value="preventivo">Preventivo</option><option value="correctivo">Correctivo</option>
            </select></div>
          <div class="col-md-6"><label class="form-label small">Área</label>
            <select name="area_id" class="form-select"><option value="">Todas</option>
              @foreach($areas as $a)<option value="{{ $a->id }}">{{ $a->nombre }}</option>@endforeach
            </select></div>
          <div class="col-md-6"><label class="form-label small">Desde</label>
            <input type="date" name="desde" class="form-control"></div>
          <div class="col-md-6"><label class="form-label small">Hasta</label>
            <input type="date" name="hasta" class="form-control"></div>
        </div>
        <div class="mt-3 d-flex gap-2">
          <button class="btn btn-success"><i class="fa fa-file-excel"></i> Excel</button>
          <button formaction="{{ route('reportes.ordenes.pdf') }}" class="btn btn-danger"><i class="fa fa-file-pdf"></i> PDF</button>
        </div>
      </form>
    </div>
  </div>
  <div class="col-md-6">
    <div class="card h-100">
      <div class="card-header"><strong>Cumplimiento por área</strong></div>
      <form method="GET" action="{{ route('reportes.cumplimiento') }}" class="card-body">
        <div class="row g-2">
          <div class="col-md-6"><label class="form-label small">Desde</label>
            <input type="date" name="desde" class="form-control"></div>
          <div class="col-md-6"><label class="form-label small">Hasta</label>
            <input type="date" name="hasta" class="form-control"></div>
        </div>
        <button class="btn btn-primario mt-3"><i class="fa fa-chart-bar"></i> Ver</button>
      </form>
    </div>
  </div>
</div>
@endsection
