@extends('template')
@section('content')
<div class="page-info">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Apps</a></li>
<li class="breadcrumb-item active" aria-current="page">Iuran</li>
</ol>
</nav>
</div>
@include('message')
<div class="main-wrapper">
<div class="card">
<div class="card-body">
<form action="{{ route('dues.filter') }}" method="post" id="myForm">
@csrf
<div class="form-group row">
<label for="begin" class="col-sm-2 col-form-label text-center">Filter By Year
:</label>
<div class="col-sm-6">
<select name="year" class="form-control" id="year">
@foreach (range(date('Y'), date('Y') - 10, -1) as $yearOption)
<option value="{{ $yearOption }}">{{ $yearOption }}</option>
@endforeach
</select>
</div>
<div class="col-sm-2 text-center">
<button type="submit" class="btn btn-secondary rounded-pill"><i
class="material-icons">filter_alt</i> Filter</button>
</div>
<div class="col-sm-2 text-center">
<a href="{{ route('dues.index') }}" class="btn btn-warning rounded-pill"><i
class="material-icons">refresh</i> Reset</a></a>
</div>
</div>
</form>
@if (!empty($year))
<p class="btn btn-info rounded-pill" style="width:100%">You display data for the year
{{ $year }}
</p>
@else
<p class="btn btn-info rounded-pill" style="width:100%">You display data for the
year (year)
</p>
@endif
<div class="table-responsive">
<table class="table table-hover table-sm table-bordered" id="zero-conf">
<thead class="thead-dark">
<tr>
<th style="width: 8%" class="text-center">#</th>
<th>Member</th>
<th>Jan</th>
<th>Feb</th>
<th>Mar</th>
<th>Apr</th>
<th>May</th>
<th>June</th>
<th>July</th>
<th>Aug</th>
<th>Sept</th>
<th>Oct</th>
<th>Nov</th>
<th>Des</th>
<th>Total</th>
</tr>
</thead>
<tbody>
@php
$no = 1;
@endphp
@if ($report)
@foreach ($report as $item)
<tr>
<td class="text-center">{{ $no++ }}</td>
<td>{{ @$item->name }}</td>
@for ($i = 1; $i <= 12; $i++)
<td>
@php
$transaction = App\Models\Transaction::where('member_id', @$item->id)
->whereMonth('date', $i)
->first();
@endphp
@if ($transaction)
✓
@else
-
@endif
</td>
@endfor
<td>Rp.
{{ number_format(app('App\Http\Controllers\DuesController')->calculateTotalAmountByMember(@$item->id, $year), 0, ',', '.') }}
</td>
</tr>
@endforeach
<tr>
<td>Total:</td>
@for ($i = 1; $i <= 13; $i++)
<td></td>
@endfor
<td>Rp. {{ number_format($sumAmount, 0, ',', '.') }}</td>
</tr>
@else
<tr>
<td colspan="15" class="text-center">No data available.</td>
</tr>
@endif
</tbody>
</table>
</div>
{{-- @if ($report != '')
<form action="{{ route('printr') }}" method="post" class="mt-2">
@csrf
<input type="hidden" name="year" value="{{ $year }}">
<div class="text-center">
<button type="submit" class="btn btn-primary rounded-pill"><i class="material-icons">print</i>
Print</button>
</div>
</form>
@endif --}}
{{-- @if ($report != '')
<div class="text-center mb-2">
<a href="{{ route('dues.export') }}" class="btn btn-success rounded-pill">
<i class="material-icons">cloud_download</i> Excel
</a>
</div>
@endif --}}
@if ($report)
<div class="text-center mb-2">
<a href="{{ route('dues.export', ['year' => $year]) }}" class="btn btn-success rounded-pill">
<i class="material-icons">cloud_download</i> Unduh Excel
</a>
{{-- <a href="{{ route('dues.view') }}" class="btn btn-success rounded-pill">
<i class="material-icons">cloud_download</i> Unduh TES
</a> --}}
</div>
@endif
</div>
</div>
</div>
<script>
document.getElementById('resetBtn').addEventListener('click', function() {
document.getElementById('myForm').reset();
});
</script>
@endsection
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]