MIF_E31221259/resources/views/user/perhitunganaph.blade.php

193 lines
5.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('user.layouts.user')
@push('perhitungan')
<style>
body {
margin: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f5f5;
}
.logo {
color: #2196F3;
font-weight: bold;
margin-right: 8px;
font-size: 22px;
}
.role {
font-weight: bold;
color: #000;
font-size: 1px;
}
.content {
padding: 20px 50px;
}
.card {
border-radius: 16px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.form-label {
font-weight: 600;
}
.btn-check:checked+.btn-option {
background-color: #0d6efd;
color: #fff;
border-color: #0d6efd;
}
.btn-check:checked+.btn-option small {
color: #fff;
}
.btn-option {
border-radius: 0.5rem;
border: 1px solid #dee2e6;
background-color: #f8f9fa;
color: #000;
font-weight: 500;
padding: 0.75rem 0.5rem;
line-height: 1.2;
text-align: center;
font-size: 0.875rem;
}
.btn-option small {
display: block;
font-size: 0.75rem;
color: #6c757d;
}
.btn-primary {
padding: 0.5rem 2rem;
border-radius: 8px;
}
</style>
@endpush
@section('content')
@include('user.partials.navbar')
<div class="container my-5 text-center">
<h1 class="mb-4">Analisa Pilihan Kecerdasan</h1>
@if (session('success'))
<div class="alert alert-success">{{ session('success') }}</div>
@endif
@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $err)
<li>{{ $err }}</li>
@endforeach
</ul>
</div>
@endif
{{-- MULAI FORM --}}
<form action="{{ route('user.perhitunganaph.analisa') }}" method="POST">
@csrf
@php
$descriptions = [
4 => 'Sangat Setuju',
3 => 'Setuju',
2 => 'Netral',
1 => 'Tidak Setuju',
0 => 'Sangat Tidak Setuju',
];
@endphp
<div class="d-flex flex-column align-items-center">
@foreach ($kriterias as $k)
<div class="card p-4 mb-4" style="max-width:600px; width:100%;">
<h5 class="card-title">{{ $k->nama }}</h5>
<div class="d-flex justify-content-center gap-3 mt-3">
@for ($lvl = 4; $lvl >= 0; $lvl--)
@php
$val = $k->id . '_' . $lvl;
$checked =
old("kondisi.{$k->id}") === $val ||
(isset($kepastian[$k->id]) && $kepastian[$k->id] == $lvl);
@endphp
<div class="form-check text-center">
<input class="form-check-input" type="radio" name="kondisi[{{ $k->id }}]"
id="{{ $k->id }}_{{ $lvl }}" value="{{ $val }}"
{{ $checked ? 'checked' : '' }}>
<label class="form-check-label" for="{{ $k->id }}_{{ $lvl }}">
{{ $descriptions[$lvl] }}
</label>
</div>
@endfor
</div>
</div>
@endforeach
</div>
<div class="mt-4 d-flex justify-content-center">
<button type="submit" class="btn btn-primary me-2">Hitung Analisa</button>
<a href="{{ route('user.perhitunganaph.reset') }}" class="btn btn-secondary">Reset</a>
</div>
</form>
@if (isset($cfHasil))
<hr class="my-5">
<h2 class="mb-3">Hasil Analisa</h2>
<table class="table table-striped mx-auto" style="width: auto;">
<thead class="table-primary">
<tr>
<th>#</th>
<th>Kecerdasan</th>
<th>Persentase</th>
</tr>
</thead>
<tbody>
@php $rank = 1; @endphp
@foreach ($cfHasil as $kecId => $score)
@php $kec = $kecerdasans->firstWhere('id', $kecId); @endphp
<tr @if ($rank === 1) class="table-success" @endif>
<td>{{ $rank++ }}</td>
<td>{{ $kec->nama ?? '' }}</td>
<td>{{ number_format($score * 100, 2) }}%</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 d-flex justify-content-center">
<a href="{{ route('user.ahp.index') }}" class="btn btn-secondary me-2">
Analisa Ahp
</a>
</div>
@endif
</div>
@endsection
@push('dashboard-scripts')
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
@endpush
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Pemilihan Jurusan Kuliah</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
</body>
</html>