85 lines
3.0 KiB
PHP
85 lines
3.0 KiB
PHP
@extends('layouts.master')
|
|
|
|
@section('title')
|
|
GPC Output
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="card shadow-sm">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0 font-weight-bold">GPC Output</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
@if ($errors->has('error'))
|
|
<div class="alert alert-danger">
|
|
{{ $errors->first('error') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('success'))
|
|
<div class="alert alert-success">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
<form id="gpcForm" method="GET">
|
|
<div class="row">
|
|
<div class="col-md-2 pr-1">
|
|
<x-inventory-year-select :selected-year="$inventoryYear" />
|
|
</div>
|
|
<div class="col-lg-4 d-flex align-items-end align-items-center pt-1 pr-1">
|
|
<div class="form-group mt-2 mb-0 mr-2">
|
|
<button type="submit" class="btn btn-info">Tampilkan</button>
|
|
</div>
|
|
<div class="form-group mt-2 mb-0">
|
|
<a href="{{ route('gpcOutput.export', [
|
|
'inventoryYear' => $inventoryYear,
|
|
]) }}"
|
|
class="btn btn-info">Ekspor Excel</a>
|
|
</div>
|
|
</div>
|
|
<!-- Align the "Catatan" button to the right -->
|
|
<div class="col-lg-6 d-flex justify-content-end align-items-center pt-1">
|
|
<div class="form-group mt-2 mb-0">
|
|
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#catatanModal">
|
|
Catatan
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<br />
|
|
|
|
@if ($gpcOutputs->isNotEmpty())
|
|
@include('reports.gpc-output.table')
|
|
@endif
|
|
@include('reports.gcom-crf.note')
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#inventoryYear').select2({
|
|
placeholder: 'Pilih Tahun'
|
|
});
|
|
$('#gpcForm').on('submit', function(event) {
|
|
event.preventDefault();
|
|
const actionUrl = updateFormAction();
|
|
window.location.href = actionUrl;
|
|
});
|
|
});
|
|
|
|
function updateFormAction() {
|
|
const inventoryYear = $('#inventoryYear').val();
|
|
const activityYear = $('#activityYear').val() || '';
|
|
|
|
let actionUrl = `{{ url('reports/gpc_output') }}/${inventoryYear}`;
|
|
if (activityYear) actionUrl += `/${activityYear}`;
|
|
|
|
return actionUrl;
|
|
}
|
|
</script>
|
|
@endsection
|