sigd/resources/views/modules/reports/gcom-crf/index-backup.blade.php

696 lines
43 KiB
PHP

@extends('layouts.master')
@section('title')
GCOM CRF
@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">GCOM CRF</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-2 pr-1">
<x-activity-year-select :selected-year="$activityYear" :inventory-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>
</div>
</form>
<br />
@if ($gpcOutput)
<div class="table-responsive" style="overflow-x: auto;">
<table class="table table-bordered table-striped">
<thead class="table-info text-white text-center">
<tr>
<th rowspan="2" class="align-middle" style="width: 300px;">Sectors and Subsectors</th>
<th colspan="2">Direct Emissions (tCO2e)</th>
<th colspan="2">Indirect emissions from the use of grid-supplied electricity, heat, steam
and/or cooling</th>
<th colspan="2">Emissions occurring outside the city boundary as a result of in-city
activities</th>
<th rowspan="2" class="align-middle">Please explain any excluded sources, identify any
emissions covered under an ETS and provide any other comments</th>
</tr>
<tr>
<th>Emissions in tCO2e</th>
<th>Notation Key (if needed)</th>
<th>Emissions in tCO2e</th>
<th>Notation Key (if needed)</th>
<th>Emissions in tCO2e</th>
<th>Notation Key (if needed)</th>
</tr>
</thead>
<tbody>
<!-- Stationary Energy -->
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Residential buildings</td>
@if ($gpcOutput['i_1_1'] == null || $gpcOutput['i_1_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_1_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_1_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_1_2'] == null || $gpcOutput['i_1_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_1_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_1_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_1_3'] == null || $gpcOutput['i_1_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_1_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_1_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Commercial buildings &
facilities</td>
@if (
($gpcOutput['i_2_1'] == null && $gpcOutput['i_6_1'] == null) ||
($gpcOutput['i_2_1'] == 0 && $gpcOutput['i_6_1'] == 0))
<td></td>
<td class="text-center">{{ $gpcOutputR['i_2_1'] }}</td>
@else
@php
$energyCommercialDirect =
($gpcOutput['i_2_1'] ?? 0) + ($gpcOutput['i_6_1'] ?? 0);
@endphp
<td>{{ getFormattedValue($energyCommercialDirect, 2) }}</td>
<td></td>
@endif
@if (
($gpcOutput['i_2_2'] == null && $gpcOutput['i_6_2'] == null) ||
($gpcOutput['i_2_2'] == 0 && $gpcOutput['i_6_2'] == 0))
<td></td>
<td class="text-center">{{ $gpcOutputR['i_2_2'] }}</td>
@else
@php
$energyCommercialIndirect =
($gpcOutput['i_2_2'] ?? 0) + ($gpcOutput['i_6_2'] ?? 0);
@endphp
<td>{{ getFormattedValue($energyCommercialIndirect, 2) }}</td>
<td></td>
@endif
@if (
($gpcOutput['i_2_3'] == null && $gpcOutput['i_6_3'] == null) ||
($gpcOutput['i_2_3'] == 0 && $gpcOutput['i_6_3'] == 0))
<td></td>
<td class="text-center">{{ $gpcOutputR['i_2_3'] }}</td>
@else
@php
$energyCommercialOutside =
($gpcOutput['i_2_3'] ?? 0) + ($gpcOutput['i_6_3'] ?? 0);
@endphp
<td>{{ getFormattedValue($energyCommercialOutside, 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Institutional buildings &
facilities</td>
<td></td>
<td class="text-center">IE</td>
<td></td>
<td class="text-center">IE</td>
<td></td>
<td class="text-center">IE</td>
<td class="text-left">Included in Commercial Buildings and Facilities</td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Industrial buildings &
facilities</td>
@if ($gpcOutput['i_3_1'] == null || $gpcOutput['i_3_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_3_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_3_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_3_2'] == null || $gpcOutput['i_3_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_3_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_3_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_3_3'] == null || $gpcOutput['i_3_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_3_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_3_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Agriculture</td>
@if ($gpcOutput['i_5_1'] == null || $gpcOutput['i_5_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_5_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_5_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_5_2'] == null || $gpcOutput['i_5_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_5_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_5_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['i_5_3'] == null || $gpcOutput['i_5_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_5_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_5_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Stationary energy > Fugitive emissions</td>
@if ($gpcOutput['i_8_1'] == null || $gpcOutput['i_8_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['i_8_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['i_8_1'], 2) }}</td>
<td></td>
@endif
<td class="bg-black"></td>
<td class="bg-black"></td>
@if ($gpcOutput['vi_1'] == null || $gpcOutput['vi_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['vi_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['vi_1'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
@php
$totalEnergyDirect = ($gpcOutput['i_1_1'] ?? 0) + ($gpcOutput['i_2_1'] ?? 0) + ($gpcOutput['i_6_1'] ?? 0) + ($gpcOutput['i_3_1'] ?? 0) + ($gpcOutput['i_5_1'] ?? 0) + ($gpcOutput['i_8_1'] ?? 0);
$totalEnergyIndirect = ($gpcOutput['i_1_2'] ?? 0) + ($gpcOutput['i_2_2'] ?? 0) + ($gpcOutput['i_6_2'] ?? 0) + ($gpcOutput['i_3_2'] ?? 0) + ($gpcOutput['i_5_2'] ?? 0);
$totalEnergyOutside = ($gpcOutput['i_1_3'] ?? 0) + ($gpcOutput['i_2_3'] ?? 0) + ($gpcOutput['i_6_3'] ?? 0) + ($gpcOutput['i_3_3'] ?? 0) + ($gpcOutput['i_5_3'] ?? 0);
@endphp
<td class="bg-header text-white text-left">Total Stationary Energy</td>
@if ($totalEnergyDirect == 0)
<td></td>
<td></td>
{{-- <td class="text-center">{{ $gpcOutputR['i_2_1'] }}</td> --}}
@else
<td>{{ getFormattedValue($totalEnergyDirect, 2) }}</td>
<td></td>
@endif
@if ($totalEnergyIndirect == 0)
<td></td>
<td></td>
{{-- <td class="text-center">{{ $gpcOutputR['i_1_2'] }}</td> --}}
@else
<td>{{ getFormattedValue($totalEnergyIndirect, 2) }}</td>
<td></td>
@endif
@if ($totalEnergyOutside == 0)
<td></td>
<td class="text-center"></td>
@else
<td>{{ getFormattedValue($totalEnergyOutside, 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<!-- Transportation -->
<tr class="text-right">
<td class="bg-header text-white text-left">Transportation > On-road</td>
@if ($gpcOutput['ii_1_1'] == null || $gpcOutput['ii_1_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_1_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_1_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_1_2'] == null || $gpcOutput['ii_1_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_1_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_1_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_1_3'] == null || $gpcOutput['ii_1_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_1_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_1_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Transportation > Rail</td>
@if ($gpcOutput['ii_2_1'] == null || $gpcOutput['ii_2_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_2_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_2_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_2_2'] == null || $gpcOutput['ii_2_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_2_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_2_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_2_3'] == null || $gpcOutput['ii_2_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_2_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_2_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Transportation > Waterborne navigation</td>
@if ($gpcOutput['ii_3_1'] == null || $gpcOutput['ii_3_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_3_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_3_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_3_2'] == null || $gpcOutput['ii_3_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_3_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_3_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_3_3'] == null || $gpcOutput['ii_3_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_3_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_3_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Transportation > Aviation</td>
@if ($gpcOutput['ii_4_1'] == null || $gpcOutput['ii_4_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_4_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_4_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_4_2'] == null || $gpcOutput['ii_4_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_4_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_4_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_4_3'] == null || $gpcOutput['ii_4_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_4_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_4_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Transportation > Off-road</td>
@if ($gpcOutput['ii_5_1'] == null || $gpcOutput['ii_5_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_5_2'] == null || $gpcOutput['ii_5_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_5_3'] == null || $gpcOutput['ii_5_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
@php
$totalTransDirect = ($gpcOutput['ii_1_1'] ?? 0) + ($gpcOutput['ii_2_1'] ?? 0) +
($gpcOutput['ii_3_1'] ?? 0) + ($gpcOutput['ii_4_1'] ?? 0) + ($gpcOutput['ii_5_1'] ?? 0);
$totalTransIndirect = ($gpcOutput['ii_1_2'] ?? 0) + ($gpcOutput['ii_2_2'] ?? 0) +
($gpcOutput['ii_3_2'] ?? 0) + ($gpcOutput['ii_4_2'] ?? 0) + ($gpcOutput['ii_5_2'] ?? 0);
$totalTransOutside = ($gpcOutput['ii_1_3'] ?? 0) + ($gpcOutput['ii_2_3'] ?? 0) +
($gpcOutput['ii_3_3'] ?? 0) + ($gpcOutput['ii_4_3'] ?? 0) + ($gpcOutput['ii_5_3'] ?? 0);
@endphp
<td class="bg-header text-white text-left">Total Transport</td>
@if ($totalTransDirect == 0)
<td></td>
<td></td>
{{-- <td class="text-center">{{ $gpcOutputR['i_2_1'] }}</td> --}}
@else
<td>{{ getFormattedValue($totalTransDirect, 2) }}</td>
<td></td>
@endif
@if ($totalTransIndirect == 0)
<td></td>
<td></td>
{{-- <td class="text-center">{{ $gpcOutputR['i_1_2'] }}</td> --}}
@else
<td>{{ getFormattedValue($totalTransIndirect, 2) }}</td>
<td></td>
@endif
@if ($totalTransOutside == 0)
<td></td>
<td class="text-center"></td>
@else
<td>{{ getFormattedValue($totalTransOutside, 2) }}</td>
<td></td>
@endif
<td></td>
<td></td>
</tr>
<!-- Waste -->
<tr class="text-right">
<td class="bg-header text-white text-left">Waste > Solid waste disposal</td>
@if ($gpcOutput['ii_5_1'] == null || $gpcOutput['ii_5_1'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_1'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_1'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_5_2'] == null || $gpcOutput['ii_5_2'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_2'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_2'], 2) }}</td>
<td></td>
@endif
@if ($gpcOutput['ii_5_3'] == null || $gpcOutput['ii_5_3'] == 0)
<td></td>
<td class="text-center">{{ $gpcOutputR['ii_5_3'] }}</td>
@else
<td>{{ getFormattedValue($gpcOutput['ii_5_3'], 2) }}</td>
<td></td>
@endif
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Waste > Biological treatment</td>
<td>{{ getFormattedValue($gpcOutput['biological_treatment']) }}</td>
<td>{{ getFormattedValue($gpcOutput['biological_treatment_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['biological_treatment_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Waste > Incineration and open burning</td>
<td>{{ getFormattedValue($gpcOutput['incineration_open_burning']) }}</td>
<td>{{ getFormattedValue($gpcOutput['incineration_open_burning_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['incineration_open_burning_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Waste > Wastewater</td>
<td>{{ getFormattedValue($gpcOutput['wastewater']) }}</td>
<td>{{ getFormattedValue($gpcOutput['wastewater_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['wastewater_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Total Waste</td>
<td>{{ getFormattedValue($gpcOutput['total_waste']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_waste_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_waste_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<!-- IPPU -->
<tr class="text-right">
<td class="bg-header text-white text-left">IPPU > Industrial process</td>
<td>{{ getFormattedValue($gpcOutput['industrial_process']) }}</td>
<td>{{ getFormattedValue($gpcOutput['industrial_process_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['industrial_process_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">IPPU > Produce Use</td>
<td>{{ getFormattedValue($gpcOutput['produce_use']) }}</td>
<td>{{ getFormattedValue($gpcOutput['produce_use_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['produce_use_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Total IPPU</td>
<td>{{ getFormattedValue($gpcOutput['total_ippu']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_ippu_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_ippu_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<!-- AFOLU -->
<tr class="text-right">
<td class="bg-header text-white text-left">AFOLU > Livestock</td>
<td>{{ getFormattedValue($gpcOutput['livestock']) }}</td>
<td>{{ getFormattedValue($gpcOutput['livestock_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['livestock_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">AFOLU > Land use</td>
<td>{{ getFormattedValue($gpcOutput['land_use']) }}</td>
<td>{{ getFormattedValue($gpcOutput['land_use_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['land_use_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">AFOLU > Other AFOLU</td>
<td>{{ getFormattedValue($gpcOutput['other_afolu']) }}</td>
<td>{{ getFormattedValue($gpcOutput['other_afolu_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['other_afolu_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Total AFOLU</td>
<td>{{ getFormattedValue($gpcOutput['total_afolu']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_afolu_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_afolu_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<!-- Generation of Grid-Supplied Energy -->
<tr class="text-right">
<td class="bg-header text-white text-left">Generation of grid-supplied energy >
Electricity-only generation</td>
<td>{{ getFormattedValue($gpcOutput['electricity_only_generation']) }}</td>
<td>{{ getFormattedValue($gpcOutput['electricity_only_generation_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['electricity_only_generation_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Generation of grid-supplied energy > CHP
generation</td>
<td>{{ getFormattedValue($gpcOutput['chp_generation']) }}</td>
<td>{{ getFormattedValue($gpcOutput['chp_generation_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['chp_generation_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Generation of grid-supplied energy > Heat/cold
generation</td>
<td>{{ getFormattedValue($gpcOutput['heat_cold_generation']) }}</td>
<td>{{ getFormattedValue($gpcOutput['heat_cold_generation_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['heat_cold_generation_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Generation of grid-supplied energy > Local
renewable generation</td>
<td>{{ getFormattedValue($gpcOutput['local_renewable_generation']) }}</td>
<td>{{ getFormattedValue($gpcOutput['local_renewable_generation_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['local_renewable_generation_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<tr class="text-right">
<td class="bg-header text-white text-left">Total Generation of grid-supplied energy</td>
<td>{{ getFormattedValue($gpcOutput['total_grid_supplied_energy']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_grid_supplied_energy_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_grid_supplied_energy_outside']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
<!-- Total Emissions (excluding generation of grid-supplied energy) -->
<tr class="text-right">
<td class="bg-header text-white text-left">Total Emissions (excluding generation of
grid-supplied energy)</td>
<td>{{ getFormattedValue($gpcOutput['total_emissions_excluding_grid_energy']) }}</td>
<td>{{ getFormattedValue($gpcOutput['total_emissions_excluding_grid_energy_indirect']) }}
</td>
<td>{{ getFormattedValue($gpcOutput['total_emissions_excluding_grid_energy_outside']) }}
</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_indirect']) }}</td>
<td>{{ getFormattedValue($gpcOutput['residential_buildings_outside']) }}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
@endif
</div>
</div>
@endsection
@push('styles')
{{-- Include any custom styles here --}}
@endsection
@section('js')
<script>
$(document).ready(function() {
// Initialize select2 for dropdowns
$('#inventoryYear').select2({
placeholder: 'Pilih Tahun'
});
$('#activityYear').select2({
placeholder: 'Pilih Tahun'
});
// Handle form submission
$('#gpcForm').on('submit', function(event) {
event.preventDefault();
const actionUrl = updateFormAction();
window.location.href = actionUrl;
});
});
// Function to build the action URL for the form based on selected years
function updateFormAction() {
const inventoryYear = $('#inventoryYear').val();
const activityYear = $('#activityYear').val() || '';
let actionUrl = `{{ url('reports/gcom_crf') }}/${inventoryYear}`;
if (activityYear) actionUrl += `/${activityYear}`;
return actionUrl;
}
</script>
@endsection