first commit
This commit is contained in:
69
resources/views/reports/index.blade.php
Normal file
69
resources/views/reports/index.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Laporan & Statistik')
|
||||
@section('heading', 'Laporan')
|
||||
@section('page-title', 'Laporan & Statistik Karbon')
|
||||
|
||||
@section('content')
|
||||
<div class="card mb-3"><div class="card-body">
|
||||
<form class="row g-2">
|
||||
<div class="col-md-4">
|
||||
<select name="cycle" class="form-select">
|
||||
<option value="">Semua kitaran</option>
|
||||
@foreach ($cycles as $c)<option value="{{ $c->id }}" @selected($cycleId==$c->id)>Pembaharuan {{ $c->renewal_year }} / Pelaporan {{ $c->reporting_year }}</option>@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 d-grid"><button class="btn btn-outline-primary">Tapis</button></div>
|
||||
</form>
|
||||
</div></div>
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-lg-6">
|
||||
<div class="card h-100"><div class="card-header bg-white fw-semibold">Trend Jumlah Pelepasan (A) Mengikut Tahun Pelaporan</div>
|
||||
<div class="card-body p-0"><table class="table table-sm mb-0">
|
||||
<thead><tr><th class="ps-3">Tahun</th><th class="text-end pe-3">Jumlah A (tCO2e)</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($trend as $year => $jumlah)
|
||||
<tr><td class="ps-3">{{ $year }}</td><td class="text-end pe-3">{{ number_format($jumlah,2) }}</td></tr>
|
||||
@empty
|
||||
<tr><td colspan="2" class="text-center text-muted py-3">Tiada data.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="card h-100"><div class="card-header bg-white fw-semibold">Pecahan Status Serahan</div>
|
||||
<div class="card-body">
|
||||
@foreach (App\Models\Submission::STATUSES as $k => $v)
|
||||
<div class="d-flex justify-content-between py-1"><span class="badge bg-{{ (new App\Models\Submission(['status'=>$k]))->statusBadgeClass() }}">{{ $v }}</span><strong>{{ $statusBreakdown[$k] ?? 0 }}</strong></div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card"><div class="card-header bg-white fw-semibold">Hasil Karbon Mengikut Pusat Data & Tahun Pelaporan</div>
|
||||
<div class="card-body p-0"><div class="table-responsive">
|
||||
<table class="table table-sm mb-0">
|
||||
<thead><tr><th class="ps-3">Pusat Data</th><th>Tahun</th><th>A</th><th>B</th><th>C</th><th>D</th><th>E (%)</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($rows as $key => $group)
|
||||
@php($map = $group->keyBy('result_token'))
|
||||
@php([$nama, $tahun] = explode('|', $key))
|
||||
<tr>
|
||||
<td class="ps-3">{{ $nama }}</td>
|
||||
<td>{{ $tahun }}</td>
|
||||
<td>{{ number_format(optional($map->get('A'))->value ?? 0, 2) }}</td>
|
||||
<td>{{ number_format(optional($map->get('B'))->value ?? 0, 2) }}</td>
|
||||
<td>{{ number_format(optional($map->get('C'))->value ?? 0, 2) }}</td>
|
||||
<td>{{ number_format(optional($map->get('D'))->value ?? 0, 2) }}</td>
|
||||
<td>{{ number_format(optional($map->get('E'))->value ?? 0, 2) }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="7" class="text-center text-muted py-3">Tiada data karbon.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user