first commit
This commit is contained in:
51
resources/views/reporting_cycles/_form.blade.php
Normal file
51
resources/views/reporting_cycles/_form.blade.php
Normal file
@@ -0,0 +1,51 @@
|
||||
@csrf
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Tahun Pembaharuan <span class="text-danger">*</span></label>
|
||||
<input type="number" name="renewal_year" id="renewalYear" value="{{ old('renewal_year', $cycle->renewal_year) }}" class="form-control @error('renewal_year') is-invalid @enderror" required>
|
||||
@error('renewal_year')<div class="invalid-feedback">{{ $message }}</div>@enderror
|
||||
<div class="form-text">Tahun pelaporan (auto): <strong id="reportingYearPreview">{{ $cycle->renewal_year ? $cycle->renewal_year - 2 : '—' }}</strong></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Tarikh Tutup Serahan</label>
|
||||
<input type="date" name="cut_off_date" value="{{ old('cut_off_date', $cycle->cut_off_date?->toDateString()) }}" class="form-control">
|
||||
<div class="form-text">Kosongkan untuk guna tetapan lalai JPP.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Tempoh Lesen (tahun) <span class="text-danger">*</span></label>
|
||||
<input type="number" name="licence_period_year" value="{{ old('licence_period_year', $cycle->licence_period_year ?? 1) }}" class="form-control" required min="1">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Templat Senarai Semak</label>
|
||||
<select name="checklist_template_id" class="form-select">
|
||||
<option value="">— Guna templat aktif —</option>
|
||||
@foreach ($templates as $t)
|
||||
<option value="{{ $t->id }}" @selected(old('checklist_template_id', $cycle->checklist_template_id)==$t->id)>{{ $t->name }} (v{{ $t->version }}) {{ $t->is_active ? '★' : '' }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Status Kitaran</label>
|
||||
<select name="status" class="form-select">
|
||||
<option value="aktif" @selected(old('status', $cycle->status ?? 'aktif')==='aktif')>Aktif</option>
|
||||
<option value="tutup" @selected(old('status', $cycle->status)==='tutup')>Tutup</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Catatan</label>
|
||||
<textarea name="catatan" rows="2" class="form-control">{{ old('catatan', $cycle->catatan) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="btn btn-success"><i class="bi bi-save me-1"></i> Simpan</button>
|
||||
<a href="{{ route('reporting-cycles.index') }}" class="btn btn-link">Batal</a>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.getElementById('renewalYear')?.addEventListener('input', function () {
|
||||
const v = parseInt(this.value, 10);
|
||||
document.getElementById('reportingYearPreview').textContent = isNaN(v) ? '—' : (v - 2);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
9
resources/views/reporting_cycles/create.blade.php
Normal file
9
resources/views/reporting_cycles/create.blade.php
Normal file
@@ -0,0 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Cipta Kitaran')
|
||||
@section('heading', 'Kitaran Pelaporan')
|
||||
@section('page-title', 'Cipta Kitaran Pelaporan')
|
||||
@section('content')
|
||||
<div class="card"><div class="card-body">
|
||||
<form method="POST" action="{{ route('reporting-cycles.store') }}">@include('reporting_cycles._form')</form>
|
||||
</div></div>
|
||||
@endsection
|
||||
14
resources/views/reporting_cycles/edit.blade.php
Normal file
14
resources/views/reporting_cycles/edit.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Kemaskini Kitaran')
|
||||
@section('heading', 'Kitaran Pelaporan')
|
||||
@section('page-title', 'Kemaskini Kitaran Pelaporan')
|
||||
@section('content')
|
||||
<div class="card"><div class="card-body">
|
||||
<form method="POST" action="{{ route('reporting-cycles.update', $cycle) }}">@method('PUT')@include('reporting_cycles._form')</form>
|
||||
</div></div>
|
||||
|
||||
<form method="POST" action="{{ route('reporting-cycles.destroy', $cycle) }}" class="mt-3" data-confirm="Padam kitaran ini?">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-outline-danger btn-sm"><i class="bi bi-trash me-1"></i> Padam Kitaran</button>
|
||||
</form>
|
||||
@endsection
|
||||
40
resources/views/reporting_cycles/index.blade.php
Normal file
40
resources/views/reporting_cycles/index.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Kitaran Pelaporan')
|
||||
@section('heading', 'Kitaran Pelaporan')
|
||||
@section('page-title', 'Kitaran Pelaporan / Pembaharuan Lesen')
|
||||
|
||||
@section('actions')
|
||||
<a href="{{ route('reporting-cycles.create') }}" class="btn btn-success"><i class="bi bi-plus-lg me-1"></i> Cipta Kitaran</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="alert alert-light border small">
|
||||
<i class="bi bi-info-circle me-1"></i> Peraturan: <strong>Tahun pelaporan = Tahun pembaharuan − 2</strong>. Contoh: pembaharuan 2028 ⇒ pelaporan 2026 (data Jan–Dis 2026). Pembaharuan lesen dibuat pada/sebelum tarikh tutup (lalai 1 Disember).
|
||||
</div>
|
||||
<div class="card"><div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead><tr><th class="ps-3">Tahun Pembaharuan</th><th>Tahun Pelaporan</th><th>Tempoh Pelaporan</th><th>Tarikh Tutup</th><th>Tempoh Lesen</th><th>Serahan</th><th>Status</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($cycles as $c)
|
||||
<tr>
|
||||
<td class="ps-3 fw-semibold">{{ $c->renewal_year }}</td>
|
||||
<td>{{ $c->reporting_year }}</td>
|
||||
<td class="small">{{ $c->period_start?->format('d/m/Y') }} – {{ $c->period_end?->format('d/m/Y') }}</td>
|
||||
<td>{{ $c->cut_off_date?->format('d/m/Y') }} @if($c->isOverdue())<span class="badge bg-danger">Lampau</span>@endif</td>
|
||||
<td>{{ $c->licence_period_year }} tahun</td>
|
||||
<td><span class="badge bg-light text-dark">{{ $c->submissions_count }}</span></td>
|
||||
<td><span class="badge bg-{{ $c->status==='aktif'?'success':'secondary' }}">{{ $c->status==='aktif'?'Aktif':'Tutup' }}</span></td>
|
||||
<td class="text-end pe-3">
|
||||
<a href="{{ route('reporting-cycles.edit', $c) }}" class="btn btn-sm btn-outline-secondary"><i class="bi bi-pencil"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="8" class="text-center text-muted py-3">Tiada kitaran lagi.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="mt-2">{{ $cycles->links() }}</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user