Worksheet

main
Ilham Wara Nugroho 2026-01-07 11:20:55 +07:00
parent 89bc6bfc3b
commit 0b6cb5882a
66 changed files with 192 additions and 246 deletions

View File

@ -21,7 +21,7 @@ class WorksheetExport implements FromView, WithStyles
public function view(): View public function view(): View
{ {
return view('reports.worksheet.report', [ return view('modules.reports.worksheet.report', [
'wsData' => $this->wsData, 'wsData' => $this->wsData,
'emisiData' => $this->emisiData, 'emisiData' => $this->emisiData,
'isExport' => true 'isExport' => true

View File

@ -12,6 +12,9 @@ use Illuminate\Support\Facades\Validator;
class WorksheetController extends Controller class WorksheetController extends Controller
{ {
protected $title = 'Laporan Worksheet';
protected $template = 'modules.reports.worksheet';
protected $route = 'modules.laporan.worksheet';
protected $service; protected $service;
public function __construct(WorksheetService $service) public function __construct(WorksheetService $service)
@ -35,7 +38,9 @@ class WorksheetController extends Controller
$emisiData = []; $emisiData = [];
} }
return view('reports.worksheet.index', [ return view($this->template.'.index', [
'title' => $this->title,
'route' => $this->route,
'inventoryYear' => $inventoryYear ?? date('Y'), 'inventoryYear' => $inventoryYear ?? date('Y'),
'activityYear' => $activityYear, 'activityYear' => $activityYear,
'sectorCode' => $sectorCode, 'sectorCode' => $sectorCode,

View File

@ -15,6 +15,9 @@ use Illuminate\Support\Facades\Auth;
class ProdusenCalculateController implements HasMiddleware class ProdusenCalculateController implements HasMiddleware
{ {
protected $title = 'Hitung Data dari Produsen';
protected $template = 'modules.tool.produsen-calculate';
protected $route = 'modules.kalkulasi.hitung-produsen';
protected $service; protected $service;
public function __construct(ProdusenCalculateService $service) public function __construct(ProdusenCalculateService $service)
@ -31,63 +34,14 @@ class ProdusenCalculateController implements HasMiddleware
public function index(Request $request) public function index(Request $request)
{ {
$availableYears = ActivityForm::select('inventory_year')->whereNotNull('agency_id') $data['availableYears'] = ActivityForm::select('inventory_year')->whereNotNull('agency_id')
->distinct()->rowActive()->orderBy('inventory_year', 'desc') ->distinct()->rowActive()->orderBy('inventory_year', 'desc')
->get()->pluck('inventory_year')->toArray(); ->get()->pluck('inventory_year')->toArray();
if ($request->ajax()) { $data['route'] = $this->route;
$query = $this->service->getRawAll(); $data['title'] = $this->title;
$result = datatables()->of($query) return view($this->template.'.index', $data);
->addColumn('duration', function ($row) {
if ($row->finished_time === null || $row->executed_time === null) {
return '';
}
$start = Carbon::parse($row->executed_time);
$end = Carbon::parse($row->finished_time);
// Calculate the difference in seconds
$diffInSeconds = $start->diffInSeconds($end);
// Format the duration as HH:MM:SS
$hours = floor($diffInSeconds / 3600);
$minutes = floor(($diffInSeconds % 3600) / 60);
$seconds = $diffInSeconds % 60;
return sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds);
})
->editColumn('created_at', function ($row) {
return $row->created_at->format('d-m-Y H:i:s')
?? '';
})
->editColumn('executed_time', function ($row) {
if ($row->executed_time === null) {
return '';
}
return $row->executed_time->format('d-m-Y H:i:s');
})
->editColumn('finished_time', function ($row) {
if ($row->finished_time === null) {
return '';
}
return $row->finished_time->format('d-m-Y H:i:s');
})
->addColumn('status', function ($row) {
$status = SigdStatus::from($row->status);
return $status->badge() ?? '';
})
->rawColumns(['status', 'duration'])
->make(true);
return $result;
}
return view('tool.produsen-calculate.index', [
'availableYears' => $availableYears
]);
} }
public function store(Request $request) public function store(Request $request)
@ -108,9 +62,52 @@ class ProdusenCalculateController implements HasMiddleware
$this->service->create($data); $this->service->create($data);
return redirect()->route('produsenCalculate.index')->with('success', 'Proses Hitung Data dari Produsen berhasil ditambahkan.'); return redirect()->route($this->route.'.index')->with('success', 'Proses Hitung Data dari Produsen berhasil ditambahkan.');
} catch (\Exception $e) { } catch (\Exception $e) {
return back()->withErrors(['error' => 'Proses Hitung Data dari Produsen Aktivitas gagal disimpan. Silakan coba lagi. Error: ' . $e->getMessage()]); return back()->withErrors(['error' => 'Proses Hitung Data dari Produsen Aktivitas gagal disimpan. Silakan coba lagi. Error: ' . $e->getMessage()]);
} }
} }
public function grid(Request $request)
{
$_data = [];
$data = $this->service->getRawAll();
foreach ($data->get() as $key => $row) {
$status = SigdStatus::from($row->status);
if ($row->finished_time === null || $row->executed_time === null) {
$duration = '';
}
// Parse the date-time strings into Carbon instances
$start = Carbon::parse($row->executed_time);
$end = Carbon::parse($row->finished_time);
// Calculate the difference in seconds
$diffInSeconds = $start->diffInSeconds($end);
// Format the duration as HH:MM:SS
$hours = floor($diffInSeconds / 3600);
$minutes = floor(($diffInSeconds % 3600) / 60);
$seconds = $diffInSeconds % 60;
$duration = sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds);
$_data[] = [
'no' => $key+1,
'inventory_year' => $row->inventory_year,
'status' => $status->badge() ?? '',
'finished_time' => @$row->finished_time ? date('d-m-Y H:i:s', strtotime(@$row->finished_time)) : '',
'executed_time' => @$row->executed_time ? date('d-m-Y H:i:s', strtotime(@$row->executed_time)) : '',
'created_at' => @$row->created_at ? date('d-m-Y H:i:s', strtotime(@$row->created_at)) : '',
'duration' => $duration,
];
}
return response()->json($_data);
}
} }

View File

@ -19,6 +19,6 @@ class ActivityYearSelect extends Component
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
return view('components.activity-year-select'); return view('modules.components.activity-year-select');
} }
} }

View File

@ -19,6 +19,6 @@ class InventoryYearSelect extends Component
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
return view('components.inventory-year-select'); return view('modules.components.inventory-year-select');
} }
} }

View File

@ -15,7 +15,7 @@
</div> </div>
@section('js') @push('js')
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
$('#inventoryYear').on('change', function() { $('#inventoryYear').on('change', function() {
@ -35,4 +35,4 @@
}); });
}); });
</script> </script>
@endsection @endpush

View File

@ -10,7 +10,7 @@
@endphp @endphp
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;width: 700px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;width: 700px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th class="align-middle" width="50%">Kategori</th> <th class="align-middle" width="50%">Kategori</th>
<th width="120">CO<sub>2</sub><br>(Gg)</th> <th width="120">CO<sub>2</sub><br>(Gg)</th>

View File

@ -42,7 +42,7 @@
@if ($gpcOutput) @if ($gpcOutput)
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="2" class="align-middle" style="width: 300px;">Sectors and Subsectors</th> <th rowspan="2" class="align-middle" style="width: 300px;">Sectors and Subsectors</th>
<th colspan="2">Direct Emissions (tCO2e)</th> <th colspan="2">Direct Emissions (tCO2e)</th>

View File

@ -10,7 +10,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table class="table table-bordered"> <table class="table table-bordered">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th colspan="2" style="width: 35%;">Notation Key</th> <th colspan="2" style="width: 35%;">Notation Key</th>
<th>Deskripsi dan Contoh</th> <th>Deskripsi dan Contoh</th>

View File

@ -4,7 +4,7 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="2" class="align-middle" style="width: 400px;">Sectors and Subsectors</th> <th rowspan="2" class="align-middle" style="width: 400px;">Sectors and Subsectors</th>
<th colspan="2" class="align-middle" style="width: 350px;">Direct Emissions (tCO2e)</th> <th colspan="2" class="align-middle" style="width: 350px;">Direct Emissions (tCO2e)</th>

View File

@ -4,7 +4,7 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>Populasi</th> <th>Populasi</th>

View File

@ -22,18 +22,6 @@
</h5> </h5>
</div> </div>
<div class="card-body"> <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="worksheetForm" method="GET"> <form id="worksheetForm" method="GET">
@csrf @csrf
<div class="row"> <div class="row">
@ -45,64 +33,66 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-2 pr-1"> <div class="col-12 mt-2">
<div class="form-group"> <div class="row">
<label for="category">Sektor:</label> <div class="col-lg-2 pr-1">
<div class="input-group"> <div class="form-group">
<select name="category" id="category" class="form-control"> <label for="category">Sektor:</label>
<option value="">Sektor</option> <div class="input-group">
@foreach ($categories as $category) <select name="category" id="category" class="form-control">
<option value="{{ $category->code }}" <option value="">Sektor</option>
{{ $sectorCode == $category->code ? 'selected' : '' }}> @foreach ($categories as $category)
{{ $category->name }} <option value="{{ $category->code }}"
</option> {{ $sectorCode == $category->code ? 'selected' : '' }}>
@endforeach {{ $category->name }}
</select> </option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-lg-4 pr-1">
<div class="form-group">
<label for="worksheet">Worksheet:</label>
<div class="input-group">
<select name="worksheet" id="worksheet" class="form-control">
<option value="">Pilih Worksheet</option>
@foreach ($worksheets as $worksheet)
<option value="{{ $worksheet->ws_code }}"
{{ $wsCode == $worksheet->ws_code ? 'selected' : '' }}>
{{ $worksheet->ws_code }} - {{ $worksheet->ws_title }}
</option>
@endforeach
</select>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-4 pr-1"> <div class="col-lg-4 d-flex align-items-end align-items-center pt-1 pr-1 gap-2">
<div class="form-group">
<label for="worksheet">Worksheet:</label>
<div class="input-group">
<select name="worksheet" id="worksheet" class="form-control">
<option value="">Pilih Worksheet</option>
@foreach ($worksheets as $worksheet)
<option value="{{ $worksheet->ws_code }}"
{{ $wsCode == $worksheet->ws_code ? 'selected' : '' }}>
{{ $worksheet->ws_code }} - {{ $worksheet->ws_title }}
</option>
@endforeach
</select>
</div>
</div>
</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"> <div class="form-group mt-2 mb-0 mr-2">
<button type="submit" class="btn btn-info">Tampilkan</button> <button type="submit" class="btn btn-info">Tampilkan</button>
</div> </div>
<div class="form-group mt-2 mb-0"> <div class="form-group mt-2 mb-0">
<a href="{{ route('worksheet.export', [ <a href="{{ route($route.'.export', [
'inventoryYear' => $inventoryYear, 'inventoryYear' => $inventoryYear,
'activityYear' => $activityYear, 'activityYear' => $activityYear,
'sectorCode' => $sectorCode, 'sectorCode' => $sectorCode,
'wsCode' => $wsCode, 'wsCode' => $wsCode,
]) }}" ]) }}"
class="btn btn-info">Ekspor Excel</a> class="btn btn-success">Ekspor Excel</a>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
<br /> <br />
@if (\Illuminate\Support\Facades\File::exists(resource_path('views/reports/worksheet/tables/' . ($wsData ? $wsData->ws_code : 'test') . '.blade.php'))) @if (\Illuminate\Support\Facades\File::exists(resource_path('views/modules/reports/worksheet/tables/' . ($wsData ? $wsData->ws_code : 'test') . '.blade.php')))
@include('reports.worksheet.tables.' . $wsData->ws_code) @include('modules.reports.worksheet.tables.' . $wsData->ws_code)
@endif @endif
</div> </div>
</div> </div>
@endsection @endsection
@push('styles')
@endsection
@section('js') @section('js')
<script> <script>
@ -125,13 +115,12 @@
var actionUrl = updateFormAction(); var actionUrl = updateFormAction();
window.location.href = actionUrl; window.location.href = actionUrl;
}); });
$('#category').on('change',function(){
$('#category').change(function() {
var sectorCode = $(this).val(); var sectorCode = $(this).val();
var options = '<option value="">Pilih Worksheet</option>'; var options = '<option value="">Pilih Worksheet</option>';
$('#worksheet').html(options).val(''); $('#worksheet').html(options).val('');
$.ajax({ $.ajax({
url: '{{ route('ws.getWorksheetsBySector') }}', url: '{{ route('modules.laporan.ws.getWorksheetsBySector') }}',
method: 'GET', method: 'GET',
data: { data: {
sector: sectorCode sector: sectorCode
@ -156,7 +145,7 @@
var sectorCode = $('#category').val() || ''; var sectorCode = $('#category').val() || '';
var worksheetCode = $('#worksheet').val() || ''; var worksheetCode = $('#worksheet').val() || '';
var actionUrl = `{{ url('reports/worksheet') }}/${inventoryYear}`; var actionUrl = `{{ url('laporan/worksheet') }}/${inventoryYear}`;
if (activityYear) actionUrl += `/${activityYear}`; if (activityYear) actionUrl += `/${activityYear}`;
if (sectorCode) actionUrl += `/${sectorCode}`; if (sectorCode) actionUrl += `/${sectorCode}`;
if (worksheetCode) actionUrl += `/${worksheetCode}`; if (worksheetCode) actionUrl += `/${worksheetCode}`;

View File

@ -6,6 +6,6 @@
<p></p> <p></p>
</div> </div>
@if (\Illuminate\Support\Facades\File::exists(resource_path('views/reports/worksheet/tables/' . ($wsData ? $wsData->ws_code : 'test') . '.blade.php'))) @if (\Illuminate\Support\Facades\File::exists(resource_path('views/modules/reports/worksheet/tables/' . ($wsData ? $wsData->ws_code : 'test') . '.blade.php')))
@include('reports.worksheet.tables.' . $wsData->ws_code) @include('modules.reports.worksheet.tables.' . $wsData->ws_code)
@endif @endif

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th colspan="3">Energy Consumption</th> <th colspan="3">Energy Consumption</th>

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.1A1a') @include('modules.reports.worksheet.tables.1A1a')

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="3">Species / Livestock Category</th> <th rowspan="3">Species / Livestock Category</th>
<th>Number of Animals</th> <th>Number of Animals</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="3">Species / Livestock Category</th> <th rowspan="3">Species / Livestock Category</th>
<th>Number of Animals</th> <th>Number of Animals</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="3">Species / Livestock Category</th> <th rowspan="3">Species / Livestock Category</th>
<th>Number of Animals</th> <th>Number of Animals</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="2">Island</th> <th rowspan="2">Island</th>
<th rowspan="2">Before</th> <th rowspan="2">Before</th>

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3B1a') @include('modules.reports.worksheet.tables.3B1a')

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="4"></th> <th rowspan="4"></th>
<th>Area Burnt</th> <th>Area Burnt</th>

View File

@ -1 +1 @@
@include('reports.worksheet.tables.3C1a') @include('modules.reports.worksheet.tables.3C1a')

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="4">Subcategories for reporting year</th> <th rowspan="4">Subcategories for reporting year</th>
<th>Annual amount of Urea Fertilization</th> <th>Annual amount of Urea Fertilization</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="4" colspan="2">Anthropogenic N input type</th> <th rowspan="4" colspan="2">Anthropogenic N input type</th>
<th colspan="2">Annual amount of N applied</th> <th colspan="2">Annual amount of N applied</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="4">Anthropogenic N input type</th> <th rowspan="4">Anthropogenic N input type</th>
<th>Annual amount of synthetic fertilizer N applied to soils</th> <th>Annual amount of synthetic fertilizer N applied to soils</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th rowspan="3">Species / Livestock Category</th> <th rowspan="3">Species / Livestock Category</th>
<th>Total nitrogen excretion for the MMS</th> <th>Total nitrogen excretion for the MMS</th>

View File

@ -8,7 +8,7 @@
@endphp @endphp
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<!-- <th></th> --> <!-- <th></th> -->
<th>Unmanaged, Shallow</th> <th>Unmanaged, Shallow</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>Terangkut ke TPA<br>Gg</th> <th>Terangkut ke TPA<br>Gg</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>Sisa Makanan<br>%</th> <th>Sisa Makanan<br>%</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>Sisa Makanan<br>Gg</th> <th>Sisa Makanan<br>Gg</th>

View File

@ -3,7 +3,7 @@
@endphp @endphp
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th>Year</th> <th>Year</th>
<th>Amount deposited</th> <th>Amount deposited</th>

View File

@ -1 +1 @@
@include('reports.worksheet.tables.4A-e', [$activity = 'kertas']) @include('modules.reports.worksheet.tables.4A-e', [$activity = 'kertas'])

View File

@ -1 +1 @@
@include('reports.worksheet.tables.4A-e', [$activity = 'nappies']) @include('modules.reports.worksheet.tables.4A-e', [$activity = 'nappies'])

View File

@ -1 +1 @@
@include('reports.worksheet.tables.4A-e', [$activity = 'taman']) @include('modules.reports.worksheet.tables.4A-e', [$activity = 'taman'])

View File

@ -1 +1 @@
@include('reports.worksheet.tables.4A-e', [$activity = 'kayu']) @include('modules.reports.worksheet.tables.4A-e', [$activity = 'kayu'])

View File

@ -1 +1 @@
@include('reports.worksheet.tables.4A-e', [$activity = 'tekstil']) @include('modules.reports.worksheet.tables.4A-e', [$activity = 'tekstil'])

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th>Jenis Sampah / Tahun</th> <th>Jenis Sampah / Tahun</th>
<th>Total Amount of Waste open-burned<br>(Wet Weight)<br>(Gg Waste)</th> <th>Total Amount of Waste open-burned<br>(Wet Weight)<br>(Gg Waste)</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th>Type of Waste / Tahun</th> <th>Type of Waste / Tahun</th>
<th>Total Amount of Waste Open-burned (Wet Weight)<br>(Gg Sampah)</th> <th>Total Amount of Waste Open-burned (Wet Weight)<br>(Gg Sampah)</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th>Type of Waste / Tahun</th> <th>Type of Waste / Tahun</th>
<th>Total Amount of Waste Open-burned (Wet Weight)<br>(Gg Sampah)</th> <th>Total Amount of Waste Open-burned (Wet Weight)<br>(Gg Sampah)</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th></th> <th></th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>
<th>A</th> <th>A</th>

View File

@ -1,6 +1,6 @@
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped" style="min-width: 1095px;"> <table class="table table-bordered table-striped" style="min-width: 1095px;">
<thead class="bg-header text-white text-center"> <thead class="table-info text-white text-center">
<tr> <tr>
<th></th> <th></th>

View File

@ -1,44 +1,42 @@
@extends('layouts.master') @extends('layouts.master')
@section('title', 'Hitung Data dari Produsen')
@section('content') @section('content')
{{-- <div class="container"> --}} {{-- <div class="container"> --}}
<div class="card shadow-sm"> <div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0 font-weight-bold">Hitung Data dari Produsen</h5> <h5 class="mb-0 font-weight-bold">{{ @$title }}</h5>
<button type="button" class="btn btn-sm btn-primary float-right" data-toggle="modal" data-target="#lockModal"> <button type="button" class="btn btn-sm btn-primary float-right" data-bs-toggle="modal" data-bs-target="#lockModal">
Hitung Data Hitung Data
</button> </button>
</div> </div>
<div class="card-body"> <div class="card-body">
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
@if ($errors->has('error'))
<div class="alert alert-danger">
{{ $errors->first('error') }}
</div>
@endif
<div class="table-responsive"> <div class="table-responsive">
<table class="table align-items-center mb-0 display" id="data-table" style="width:100%"> <table class="table w-100"
<thead> data-search="true"
data-toggle="table"
data-pagination="true"
data-toolbar="#toolbar"
data-show-refresh="false"
data-url="{{route($route.'.grid')}}"
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
data-sort-name="ids"
data-sort-order="desc"
data-page-size="10"
data-id-field="id"
id="grid-data">
<thead class="table-primary text-primary">
<tr> <tr>
<th scope="col">Waktu Input</th> <th data-field="created_at">Waktu Input</th>
<th scope="col">Tahun Inventory</th> <th data-field="inventory_year">Tahun Inventory</th>
<th scope="col">Status</th> <th data-field="status">Status</th>
<th scope="col">Waktu Eksekusi</th> <th data-field="executed_time">Waktu Eksekusi</th>
<th scope="col">Waktu Selesai</th> <th data-field="finished_time">Waktu Selesai</th>
<th scope="col">Durasi</th> <th data-field="duration">Durasi</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody></tbody>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@ -51,11 +49,8 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="lockModalLabel">Hitung Data dari Produsen</h5> <h5 class="modal-title" id="lockModalLabel">Hitung Data dari Produsen</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div> </div>
<form action="{{ route('produsenCalculate.store') }}" method="POST" id="lockForm"> <form action="{{ route($route.'.store') }}" method="POST" id="lockForm">
@csrf @csrf
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
@ -73,7 +68,7 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
<button type="submit" class="btn btn-primary">Hitung Data</button> <button type="submit" class="btn btn-primary">Hitung Data</button>
</div> </div>
</form> </form>
@ -84,48 +79,7 @@
@section('js') @section('js')
<script> <script>
$(document).ready(function() {
$('#data-table').DataTable({
pageLength: 10,
responsive: true,
serverSide: true,
scrollX: true,
searchDelay: 1000,
ajax: {
url: '{{ route('produsenCalculate.index') }}',
type: 'GET',
dataSrc: 'data'
},
columns: [{
data: 'created_at',
name: 'created_at'
},
{
data: 'inventory_year',
name: 'inventory_year'
},
{
data: 'status',
name: 'status'
},
{
data: 'executed_time',
name: 'executed_time'
},
{
data: 'finished_time',
name: 'finished_time'
},
{
data: 'duration',
name: 'duration'
},
],
order: [
[0, 'desc']
]
});
});
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
$(document).on('click', 'form button', function(e) { $(document).on('click', 'form button', function(e) {

View File

@ -204,10 +204,11 @@ Route::name('management.')->prefix('management')->group(function () {
Route::get('salin-aktivitas/grid', [CopyActivityController::class, 'grid'])->name('salin-aktivitas.grid'); Route::get('salin-aktivitas/grid', [CopyActivityController::class, 'grid'])->name('salin-aktivitas.grid');
Route::resource('salin-aktivitas', CopyActivityController::class)->only('index', 'store')->names('salin-aktivitas'); Route::resource('salin-aktivitas', CopyActivityController::class)->only('index', 'store')->names('salin-aktivitas');
Route::get('hitung-produsen/grid', [ProdusenCalculateController::class, 'grid'])->name('hitung-produsen.grid');
Route::resource('hitung-produsen', ProdusenCalculateController::class)->only('index', 'store')->names('hitung-produsen'); Route::resource('hitung-produsen', ProdusenCalculateController::class)->only('index', 'store')->names('hitung-produsen');
}); });
Route::prefix('reports')->group(function () { Route::prefix('laporan')->name('laporan.')->group(function () {
Route::get('worksheet/export', [WorksheetController::class, 'export'])->name('worksheet.export'); Route::get('worksheet/export', [WorksheetController::class, 'export'])->name('worksheet.export');
Route::get('worksheet/{inventoryYear?}/{activityYear?}/{sectorCode?}/{wsCode?}', [WorksheetController::class, 'show'])->name('worksheet.show'); Route::get('worksheet/{inventoryYear?}/{activityYear?}/{sectorCode?}/{wsCode?}', [WorksheetController::class, 'show'])->name('worksheet.show');
@ -230,7 +231,7 @@ Route::name('management.')->prefix('management')->group(function () {
Route::resource('form/metadata', FormMetadataController::class)->only('index', 'store', 'destroy')->names('form.metadata'); Route::resource('form/metadata', FormMetadataController::class)->only('index', 'store', 'destroy')->names('form.metadata');
Route::get('form/aktivitas_user', [FormController::class, 'getUserActivities'])->name('form.aktivitasUser'); Route::get('form/aktivitas_user', [FormController::class, 'getUserActivities'])->name('form.aktivitasUser');
Route::get('ws/get_worksheets_by_sector', [WorksheetController::class, 'getWorksheetsBySector'])->name('ws.getWorksheetsBySector'); Route::get('ws/get_worksheets_by_sector', [WorksheetController::class, 'getWorksheetsBySector'])->name('laporan.ws.getWorksheetsBySector');
Route::get('activity_year_range', [CalculationController::class, 'getActivityYearRange'])->name('getActivityYearRange'); Route::get('activity_year_range', [CalculationController::class, 'getActivityYearRange'])->name('getActivityYearRange');
Route::get('get_subsectors', [DataAktivitasController::class, 'fetchSubSectors'])->name('subsectors.fetch'); Route::get('get_subsectors', [DataAktivitasController::class, 'fetchSubSectors'])->name('subsectors.fetch');
}); });