255 lines
9.4 KiB
PHP
255 lines
9.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Laporan Perhitungan F-AHP Sub-Kriteria</title>
|
|
<style>
|
|
/* 1. FONT & KERTAS */
|
|
body {
|
|
font-family: "Times New Roman", Times, serif;
|
|
font-size: 10pt;
|
|
color: #000;
|
|
margin: 0; padding: 0;
|
|
line-height: 1.4;
|
|
}
|
|
h2, h3, h4 { text-align: center; margin: 2px 0; text-transform: uppercase; }
|
|
.header {
|
|
border-bottom: 2px solid #000;
|
|
padding-bottom: 10px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
/* 2. PENGATURAN TABEL UMUM */
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-bottom: 0;
|
|
font-size: 9pt;
|
|
table-layout: fixed;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
.table-container {
|
|
page-break-inside: avoid;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
thead { display: table-header-group; }
|
|
tr { page-break-inside: avoid !important; }
|
|
|
|
th, td {
|
|
border: 1px solid #000;
|
|
padding: 5px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
/* 3. JUDUL TAHAPAN (SECTION TITLE) */
|
|
th.section-title {
|
|
background-color: #d9d9d9 !important;
|
|
text-align: left;
|
|
font-size: 10pt;
|
|
padding: 8px 10px;
|
|
text-transform: uppercase;
|
|
border-bottom: 2px solid #000;
|
|
}
|
|
|
|
/* 4. HELPER CLASS */
|
|
th.col-header { background-color: #f2f2f2 !important; font-weight: bold; }
|
|
.text-left { text-align: left; padding-left: 8px; }
|
|
.text-right { text-align: right; padding-right: 8px; }
|
|
.font-bold { font-weight: bold; }
|
|
.bg-valid { background-color: #d4edda !important; }
|
|
.col-code { width: 60px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="header">
|
|
<h2>LAPORAN HASIL PERHITUNGAN SISTEM PENDUKUNG KEPUTUSAN</h2>
|
|
<h3>METODE FUZZY ANALYTICAL HIERARCHY PROCESS (F-AHP)</h3>
|
|
<h4>Sub-Kriteria: {{ $kriteriaInduk->nama }} ({{ $kriteriaInduk->kode }})</h4>
|
|
</div>
|
|
|
|
{{-- TAHAP 1: MATRIKS KONSENSUS --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="{{ count($kodes) + 1 }}" class="section-title">Tahap 1: Matriks Konsensus Multi-Pakar (Geometric Mean)</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header col-code">Kode</th>
|
|
@foreach ($kodes as $k)
|
|
<th class="col-header">{{ $k }}</th>
|
|
@endforeach
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($kodes as $i)
|
|
<tr>
|
|
<th class="col-header">{{ $i }}</th>
|
|
@foreach ($kodes as $j)
|
|
@php
|
|
$val = $crispMatrix[$i][$j];
|
|
$cetak = ($val == 1) ? "1" : (($val < 1 && $val > 0) ? "1/" . round(1/$val) : number_format($val, 2));
|
|
@endphp
|
|
<td>{{ $cetak }}</td>
|
|
@endforeach
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- TAHAP VALIDASI: CR (PENTING UNTUK SUB-KRITERIA) --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="3" class="section-title">Tahap Validasi: Uji Konsistensi (AHP Klasik)</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header" style="width: 20%;">Sub-Kode</th>
|
|
<th class="col-header" style="width: 40%;">Total Kolom Matriks</th>
|
|
<th class="col-header" style="width: 40%;">Nilai Eigen (Priority Vector)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($kodes as $k)
|
|
<tr>
|
|
<td class="font-bold">{{ $k }}</td>
|
|
<td>{{ number_format($colSums[$k], 4) }}</td>
|
|
<td class="font-bold">{{ number_format($priorityVector[$k], 4) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
<tr class="bg-valid">
|
|
<td colspan="2" class="text-right font-bold">Consistency Ratio (CR)</td>
|
|
<td class="font-bold">{{ number_format($cr * 100, 2) }}% (VALID)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- TAHAP 2: MATRIKS FUZZY --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="{{ count($kodes) + 1 }}" class="section-title">Tahap 2: Matriks Perbandingan Berpasangan Fuzzy (TFN)</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header col-code">Kode</th>
|
|
@foreach ($kodes as $k)
|
|
<th class="col-header">{{ $k }}</th>
|
|
@endforeach
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($kodes as $i)
|
|
<tr>
|
|
<th class="col-header">{{ $i }}</th>
|
|
@foreach ($kodes as $j)
|
|
@php $v = $matrix[$i][$j]; @endphp
|
|
<td>({{ number_format($v[0],3) }}, {{ number_format($v[1],3) }}, {{ number_format($v[2],3) }})</td>
|
|
@endforeach
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- TAHAP 3: NILAI SINTESIS --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" class="section-title">Tahap 3: Nilai Sintesis Fuzzy (S<sub>i</sub>)</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header" style="width: 40%;">Sub-Kriteria</th>
|
|
<th class="col-header" style="width: 60%;">Vektor S<sub>i</sub> (l, m, u)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($si as $kode => $v)
|
|
@php $namaSub = $subs->where('kode', $kode)->first()->nama_sub ?? '-'; @endphp
|
|
<tr>
|
|
<td class="text-left font-bold">{{ $kode }} - {{ $namaSub }}</td>
|
|
<td>({{ number_format($v[0],4) }}, {{ number_format($v[1],4) }}, {{ number_format($v[2],4) }})</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- TAHAP 4: V MATRIX --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="{{ count($kodes) + 1 }}" class="section-title">Tahap 4: Derajat Kemungkinan (V Matrix)</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header" style="width: 80px;">V(S<sub>i</sub> ≥ S<sub>k</sub>)</th>
|
|
@foreach ($kodes as $k)
|
|
<th class="col-header">{{ $k }}</th>
|
|
@endforeach
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($vMatrix as $i => $rows)
|
|
<tr>
|
|
<th class="col-header">{{ $i }}</th>
|
|
@foreach ($rows as $val)
|
|
<td>{{ number_format($val, 3) }}</td>
|
|
@endforeach
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- TAHAP AKHIR --}}
|
|
<div class="table-container">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="4" class="section-title">Tahap Akhir: Bobot Lokal (W) & Skala 1000</th>
|
|
</tr>
|
|
<tr>
|
|
<th class="col-header" style="width: 45%;">Sub-Kriteria</th>
|
|
<th class="col-header" style="width: 15%;">Min Degree (d')</th>
|
|
<th class="col-header" style="width: 20%;">Bobot Lokal (W)</th>
|
|
<th class="col-header" style="width: 20%;">Bobot Skala 1000</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@php $sumDPrime = array_sum($dPrime); @endphp
|
|
@foreach ($dPrime as $kode => $minV)
|
|
@php
|
|
$w = ($sumDPrime > 0) ? ($minV / $sumDPrime) : 0;
|
|
$namaSub = $subs->where('kode', $kode)->first()->nama_sub ?? '-';
|
|
@endphp
|
|
<tr>
|
|
<td class="text-left font-bold">{{ $kode }} - {{ $namaSub }}</td>
|
|
<td>{{ number_format($minV, 4) }}</td>
|
|
<td>{{ number_format($w, 4) }}</td>
|
|
<td class="font-bold">{{ $bobot1000[$kode] ?? '-' }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
<tfoot>
|
|
<tr style="background-color: #f2f2f2;">
|
|
<th class="text-right font-bold">TOTAL AKUMULASI</th>
|
|
<th class="font-bold">{{ number_format($sumDPrime, 4) }}</th>
|
|
<th class="font-bold">1.0000</th>
|
|
<th class="font-bold">{{ array_sum($bobot1000) }}</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|