72 lines
3.8 KiB
PHP
72 lines
3.8 KiB
PHP
@extends('admin.layout.main')
|
|
@section('content')
|
|
<main id="main" class="main">
|
|
<div class="pagetitle">
|
|
<h1>Data Sensor untuk {{ $deviceName }}</h1>
|
|
<nav>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Halaman Utama</a></li>
|
|
<li class="breadcrumb-item active">{{ $deviceName }}</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<section class="section profile">
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card">
|
|
<div class="card-body pt-3">
|
|
<h1 class="card-title pb-0 fs-4">Filter Data Sensor</h1>
|
|
<form method="GET" action="{{ route('admin.pages.dataprint', ['deviceName' => $deviceName]) }}">
|
|
@csrf
|
|
<label for="start_date" class="card-title">Mulai:</label>
|
|
<input type="datetime-local" id="start_date" name="start_date"
|
|
value="{{ $start_date ?? now()->format('Y-m-d\TH:i') }}" required>
|
|
<label for="end_date" class="card-title">Sampai:</label>
|
|
<input type="datetime-local" id="end_date" name="end_date"
|
|
value="{{ $end_date ?? now()->addDay()->format('Y-m-d\TH:i') }}" required>
|
|
<input type="hidden" name="device_name" value="{{ $deviceName }}">
|
|
<button type="submit" class="btn btn-primary w-30">Tampilkan</button>
|
|
</form>
|
|
|
|
<form method="GET" action="{{ route('exportdata') }}">
|
|
@csrf
|
|
<input type="hidden" name="start_date" value="{{ $start_date ?? '' }}">
|
|
<input type="hidden" name="end_date" value="{{ $end_date ?? '' }}">
|
|
<input type="hidden" name="device_name" value="{{ $deviceName ?? '' }}">
|
|
<button type="submit" class="btn btn-success">Download Excel</button>
|
|
</form>
|
|
|
|
@if (!empty($groupedSensors) && $groupedSensors->isNotEmpty())
|
|
@foreach ($groupedSensors as $device => $sensorGroup)
|
|
<h3>Device: {{ $device }}</h3>
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Waktu Interval</th>
|
|
<th>Jarak Terakhir</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($sensorGroup as $index => $sensor)
|
|
<tr>
|
|
<td>{{ $index + 1 }}</td>
|
|
<td>{{ \Carbon\Carbon::parse($sensor->interval_time)->format('Y-m-d H:i') }}</td>
|
|
<td>{{ number_format($sensor->max_distance, 2) }} m</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@endforeach
|
|
@else
|
|
<p class="mt-3">Tidak ada data untuk rentang waktu tersebut.</p>
|
|
@endif
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
@endsection
|