<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.min.css">
<link href="https://cdn.jsdelivr.net/npm/fastbootstrap@2.2.0/dist/css/fastbootstrap.min.css" rel="stylesheet" integrity="sha256-V6lu+OdYNKTKTsVFBuQsyIlDiRWiOmtC8VQ8Lzdm2i4=" crossorigin="anonymous">
<style>
.alto {
height: 100px;
}
.ancho {
width: 105px;
min-width: 50px;
max-width: 50px;
}
</style>
</head>
<body class="container">
<ul>
<li>Informe de Mantenimiento</li>
<li>Periodo: {{ data.desde|date('d/m/Y') }} - {{ data.hasta|date('d/m/Y') }}</li>
</ul>
<table id="example" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Estado</th>
<th>Fecha Pedido</th>
<th>Fecha Realizacion</th>
<th>Fecha A Realizar</th>
<th>Sector</th>
<th>Departamento</th>
<th>Detalle</th>
</tr>
</thead>
<tbody>
{% for pedido_reparacion in pedido_reparacions %}
{% set color = 'black' %}
{% if pedido_reparacion.realizada is defined %}
{% if pedido_reparacion.realizada %}
{% set color = 'green' %}
{% else %}
{% if pedido_reparacion.diagramado %}
{% set color = 'red' %}
{% endif %}
{% endif %}
{% else %}
{% if pedido_reparacion.diagramado %}
{% set color = 'red' %}
{% endif %}
{% endif %}
<tr>
<td style="color: {{ color }}">
{{ pedido_reparacion.realizada is defined ? pedido_reparacion.realizada ? 'Realizado' : 'Pendiente Realizar' : 'Pendiente Diagramar' }}
</td>
<td style="color: {{ color }}">{{ pedido_reparacion.fechaPedido|date('d/m/Y') }}</td>
<td style="color: {{ color }}">
{{ pedido_reparacion.realizada is defined ? pedido_reparacion.realizada ? pedido_reparacion.fecha|date('d/m/Y') : '' : '' }}</td>
<td style="color: {{ color }}">
{{pedido_reparacion.realizada is defined ? not pedido_reparacion.realizada ? pedido_reparacion.fechaDiagrama|date('d/m/Y') : '' : '' }}</td>
<td style="color: {{ color }}">{{ pedido_reparacion.sector}}</td>
<td style="color: {{ color }}">
{{ pedido_reparacion.departamento }}
</td>
<td style="color: {{ color }}">{{ pedido_reparacion.detalle }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
</body>
</html>