first commit

This commit is contained in:
Saufi
2026-06-24 20:32:14 +08:00
commit 10fb30ad69
201 changed files with 21356 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
@extends('layouts.app')
@section('title', 'Papan Pemuka Perunding')
@section('heading', 'Papan Pemuka')
@section('page-title', 'Papan Pemuka Perunding')
@section('subtitle', $consultant?->nama_perunding)
@section('actions')
<a href="{{ route('submissions.create') }}" class="btn btn-success"><i class="bi bi-plus-lg me-1"></i> Mula Serahan Baharu</a>
@endsection
@section('content')
@unless ($consultant)
<div class="alert alert-warning">Akaun anda belum dipautkan kepada profil perunding. Sila hubungi JPP.</div>
@else
<div class="row g-3 mb-4">
@foreach ([
['Pusat Data Ditugaskan', $dataCentres->count(), 'hdd-rack', 'primary'],
['Serahan Tertunggak', $pendingCount, 'hourglass-split', 'warning'],
['Permohonan Pembetulan', $correctionCount, 'pencil-square', 'danger'],
['Jumlah Serahan', $submissions->count(), 'file-earmark-text', 'info'],
] as [$label, $value, $icon, $color])
<div class="col-6 col-xl-3">
<div class="card stat-card h-100"><div class="card-body">
<div class="d-flex justify-content-between align-items-start">
<div><div class="text-muted small">{{ $label }}</div><div class="stat-value text-{{ $color }}">{{ $value }}</div></div>
<i class="bi bi-{{ $icon }} fs-3 text-{{ $color }} opacity-50"></i>
</div>
</div></div>
</div>
@endforeach
</div>
@if ($activeCycle)
<div class="alert alert-info d-flex align-items-center">
<i class="bi bi-info-circle me-2"></i>
<div>Kitaran aktif: <strong>Pembaharuan {{ $activeCycle->renewal_year }} / Pelaporan {{ $activeCycle->reporting_year }}</strong>.
Tarikh tutup serahan: <strong>{{ $activeCycle->cut_off_date?->format('d/m/Y') }}</strong>
@if ($activeCycle->isOverdue()) <span class="badge bg-danger ms-1">Lampau Tempoh</span> @endif
</div>
</div>
@endif
<div class="card">
<div class="card-header bg-white fw-semibold">Serahan Saya</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0 align-middle">
<thead><tr><th class="ps-3">Pusat Data</th><th>Kitaran</th><th>Status</th><th>Dikemaskini</th><th></th></tr></thead>
<tbody>
@forelse ($submissions as $s)
<tr>
<td class="ps-3">{{ $s->dataCentre->nama_pusat_data }}</td>
<td>Pembaharuan {{ $s->reportingCycle->renewal_year }} <span class="text-muted">/ Pelaporan {{ $s->reportingCycle->reporting_year }}</span></td>
<td><span class="badge bg-{{ $s->statusBadgeClass() }}">{{ $s->statusLabel() }}</span></td>
<td class="text-muted small">{{ $s->updated_at->format('d/m/Y H:i') }}</td>
<td class="text-end pe-3">
@if ($s->isEditableByConsultant())
<a href="{{ route('submissions.edit', $s) }}" class="btn btn-sm btn-outline-primary">Isi</a>
@endif
<a href="{{ route('submissions.show', $s) }}" class="btn btn-sm btn-outline-secondary">Lihat</a>
</td>
</tr>
@empty
<tr><td colspan="5" class="text-center text-muted py-3">Tiada serahan lagi.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
@endunless
@endsection

View File

@@ -0,0 +1,96 @@
@extends('layouts.app')
@section('title', 'Papan Pemuka JPP')
@section('heading', 'Papan Pemuka')
@section('page-title', 'Papan Pemuka JPP')
@section('subtitle', $activeCycle ? "Kitaran aktif: Pembaharuan {$activeCycle->renewal_year} / Pelaporan {$activeCycle->reporting_year}" : 'Tiada kitaran aktif')
@section('content')
<div class="row g-3 mb-4">
@foreach ([
['Pusat Data Aktif', $totalDataCentres, 'hdd-rack', 'primary'],
['Perunding Aktif', $activeConsultants, 'people', 'info'],
['Telah Serah (kitaran aktif)', $submittedCount, 'check2-circle', 'success'],
['Belum Serah', $notSubmittedCount, 'hourglass-split', 'warning'],
['Lampau Tempoh', $overdueCount, 'exclamation-octagon', 'danger'],
] as [$label, $value, $icon, $color])
<div class="col-6 col-md-4 col-xl">
<div class="card stat-card h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-start">
<div>
<div class="text-muted small">{{ $label }}</div>
<div class="stat-value text-{{ $color }}">{{ number_format($value) }}</div>
</div>
<i class="bi bi-{{ $icon }} fs-3 text-{{ $color }} opacity-50"></i>
</div>
</div>
</div>
</div>
@endforeach
</div>
<div class="row g-3">
<div class="col-lg-5">
<div class="card h-100">
<div class="card-header bg-white fw-semibold">Pecahan Status Serahan (Kitaran Aktif)</div>
<div class="card-body">
@forelse (\App\Models\Submission::STATUSES as $key => $label)
@php($count = $statusBreakdown[$key] ?? 0)
<div class="d-flex justify-content-between align-items-center py-1">
<span><span class="badge bg-{{ (new \App\Models\Submission(['status'=>$key]))->statusBadgeClass() }}">{{ $label }}</span></span>
<strong>{{ $count }}</strong>
</div>
@empty
<p class="text-muted mb-0">Tiada data.</p>
@endforelse
</div>
</div>
</div>
<div class="col-lg-7">
<div class="card h-100">
<div class="card-header bg-white fw-semibold">Pusat Data Tertinggi Mengikut Anggaran Karbon (A)</div>
<div class="card-body p-0">
<table class="table table-sm mb-0">
<thead><tr><th class="ps-3">Pusat Data</th><th class="text-end pe-3">Jumlah A (tCO2e)</th></tr></thead>
<tbody>
@forelse ($topDataCentres as $row)
<tr><td class="ps-3">{{ $row->nama_pusat_data }}</td><td class="text-end pe-3">{{ number_format($row->jumlah, 2) }}</td></tr>
@empty
<tr><td colspan="2" class="text-center text-muted py-3">Tiada data karbon lagi.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-header bg-white fw-semibold">Jumlah Anggaran Karbon (A, B, C, D, E) Mengikut Tahun Pelaporan</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table mb-0">
<thead><tr><th class="ps-3">Tahun Pelaporan</th><th>A Pelepasan</th><th>B Pengurangan</th><th>C Baki</th><th>D Bersih</th><th>E % Pengurangan</th></tr></thead>
<tbody>
@forelse ($carbonByYear as $year => $tokens)
@php($map = $tokens->keyBy('result_token'))
<tr>
<td class="ps-3 fw-semibold">{{ $year }}</td>
<td>{{ number_format($map['A']->jumlah ?? 0, 2) }}</td>
<td>{{ number_format($map['B']->jumlah ?? 0, 2) }}</td>
<td>{{ number_format($map['C']->jumlah ?? 0, 2) }}</td>
<td>{{ number_format($map['D']->jumlah ?? 0, 2) }}</td>
<td>{{ number_format($map['E']->jumlah ?? 0, 2) }}%</td>
</tr>
@empty
<tr><td colspan="6" class="text-center text-muted py-3">Tiada data karbon lagi.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection