<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<style type="text/css" media="all">
#logo {
max-width:150px;
}
.borda_table {
border: 1px solid black;
}
td, th, tr {
font-size: 8pt;
}
.borda {
border: 1px solid black;
}
/* quebra de página */
table { page-break-inside:auto; }
tr { page-break-inside:avoid; page-break-after:auto; }
thead { display:table-header-group; }
tfoot { display:table-footer-group; }
.titulos {
font-weight: bold;
border: 1px solid black;
background-color: #2469b1 !important;
}
.borda_inferior {
border-bottom: 1px solid black;
}
.alinha {
text-align: right;
}
.text-center {
text-align: center;
}
.borda_esquerda {
border-left: 1px solid black;
border-bottom: 1px solid black;
}
.borda_direita {
border-right: 1px solid black;
border-bottom: 1px solid black;
}
.fonte {
font-family: Arial,Helvetica Neue,Helvetica,sans-serif;
}
.footer {
width: 100%;
text-align: center;
position: fixed;
font-size: 8pt;
bottom: 0px;
}
.pagenum:before {
content: counter(page);
}
tr:nth-child(even){background-color: #cbcffb}
</style>
</head>
<div id="imprima">
<body>
<div class="footer">
Página <span class="pagenum"></span>
</div>
<table class="fonte">
<thead>
<tr>
<th colspan="5">
<b>EMPRESA: </b>{{ $cliente->nome }}<br>
@if(Auth::user()->cliente_id != 0)
<b>EMAIL: </b>{{ $cliente->email }}<br>
@endif
<b>PERÍODO SELECIONADO:</b> de {{ date('d/m/Y', strtotime($dataInicio)) }} até {{ date('d/m/Y', strtotime($dataFim)) }}
</th>
<th colspan="3"></th>
<th class="alinha references">
<img src="{!! public_path("/img/logo-cv.png") !!}" id="logo">
</th>
</tr>
<tr class="titulos">
<th class="text-center borda">Data/Hora Última Com.</th>
<th class="text-center borda">Data/Hora GPS</th>
<th class="text-center borda">Placa</th>
<th class="text-center borda">ID</th>
<th class="text-center borda">Endereço</th>
<th class="text-center borda">Latitude</th>
<th class="text-center borda">Longitude</th>
<th class="text-center borda">Velocidade (km/h)</th>
<th class="text-center borda">Inf. Cliente</th>
</tr>
</thead>
<tbody>
@foreach ($positions as $k => $position)
<tr class="details">
<td class="text-center borda_esquerda">{{ date('d/m/Y H:i', strtotime($position->servertime))}}</td>
<td class="text-center borda_esquerda">{{ date('d/m/Y H:i', strtotime($position->fixtime))}}</td>
<td class="text-center borda_esquerda">{{ $position->placa }}</td>
<td class="text-center borda_esquerda">{{ $device->uniqueid }}</td>
<td class="text-center borda_esquerda">{{ $position->address }}</td>
<td class="text-center borda_esquerda">{{ $position->latitude }}</td>
<td class="text-center borda_esquerda">{{ $position->longitude }}</td>
@if($position->protocol == 'vss' || $position->protocol == 'vss_auto')
@php
$convertSpeed = $position->speed;
@endphp
@else
@php
$convertSpeed = $position->speed * 1.852;
$convertSpeed = number_format($convertSpeed, 1);
@endphp
@endif
<td class="text-center borda_esquerda">{{ $convertSpeed }}</td>
<td class="text-center borda_esquerda borda_direita">{{ $position->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</div>
</html>