Update Hasil PDF & Questionnaire User
-Menambahkan handler ketika terdapat kuesioner yang belum diisi
This commit is contained in:
parent
12979a9e9a
commit
9e74c18f5f
|
@ -24,31 +24,30 @@
|
||||||
<body class="bg-white">
|
<body class="bg-white">
|
||||||
|
|
||||||
<div class="container py-5">
|
<div class="container py-5">
|
||||||
<div class="row pb-1">
|
<table class="table table-borderless">
|
||||||
<div class="col-4 col-sm-3 col-md-2" style="font-weight: bold;">Tanggal Pengisian</div>
|
<tbody>
|
||||||
<div class="col-1" style="font-weight: bold">:</div>
|
<tr>
|
||||||
<div class="col-7 col-sm-8 col-md-9">{{ $result->formatted_created_at }}</div>
|
<td style="font-weight: bold">Tanggal Pengisian</td>
|
||||||
</div>
|
<td style="font-weight: bold">:</td>
|
||||||
<div class="row pb-1">
|
<td>{{ $result->formatted_created_at }}</td>
|
||||||
<div class="col-4 col-sm-3 col-md-2" style="font-weight: bold;">Nama</div>
|
</tr>
|
||||||
<div class="col-1" style="font-weight: bold">:</div>
|
<tr>
|
||||||
<div class="col-7 col-sm-8 col-md-9">{{ $result->user->nama_lengkap }}</div>
|
<td style="font-weight: bold">Nama</td>
|
||||||
</div>
|
<td style="font-weight: bold">:</td>
|
||||||
<div class="row pb-1">
|
<td>{{ $result->user->nama_lengkap }}</td>
|
||||||
<div class="col-4 col-sm-3 col-md-2" style="font-weight: bold;">Nim</div>
|
</tr>
|
||||||
<div class="col-1" style="font-weight: bold">:</div>
|
<tr>
|
||||||
<div class="col-7 col-sm-8 col-md-9">{{ $result->user->nim }}</div>
|
<td style="font-weight: bold">Golongan</td>
|
||||||
</div>
|
<td style="font-weight: bold">:</td>
|
||||||
<div class="row pb-1">
|
<td>{{ $result->user->kelas_user }}</td>
|
||||||
<div class="col-4 col-sm-3 col-md-2" style="font-weight: bold;">Golongan</div>
|
</tr>
|
||||||
<div class="col-1" style="font-weight: bold">:</div>
|
<tr>
|
||||||
<div class="col-7 col-sm-8 col-md-9">{{ $result->user->kelas_user }}</div>
|
<td style="font-weight: bold">Jurusan</td>
|
||||||
</div>
|
<td style="font-weight: bold">:</td>
|
||||||
<div class="row pb-4">
|
<td>Teknologi Informasi</td>
|
||||||
<div class="col-4 col-sm-3 col-md-2" style="font-weight: bold;">Jurusan</div>
|
</tr>
|
||||||
<div class="col-1" style="font-weight: bold">:</div>
|
</tbody>
|
||||||
<div class="col-7 col-sm-8 col-md-9">Teknologi Informasi</div>
|
</table>
|
||||||
</div>
|
|
||||||
<h5 style="font-weight: bold">Knowledge of Metacognitif(KM)</h5>
|
<h5 style="font-weight: bold">Knowledge of Metacognitif(KM)</h5>
|
||||||
<div>
|
<div>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
{{--! start fill --}}
|
{{--! start fill --}}
|
||||||
|
|
||||||
<form action="{{ route('userQuestionnaire.store') }}" method="POST" class="needs-validation" novalidate>
|
<form action="{{ route('userQuestionnaire.store') }}" id="questionnaireForm" method="POST" class="needs-validation" novalidate>
|
||||||
@csrf
|
@csrf
|
||||||
@foreach ($kuesioners as $index => $kuesioner)
|
@foreach ($kuesioners as $index => $kuesioner)
|
||||||
<div class="mb-3 visually-hidden">
|
<div class="mb-3 visually-hidden">
|
||||||
|
@ -62,6 +62,35 @@
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#sidebar-questionnaire").removeClass("collapsed");
|
$("#sidebar-questionnaire").removeClass("collapsed");
|
||||||
|
|
||||||
|
const form = $("#questionnaireForm");
|
||||||
|
|
||||||
|
form.submit(function(event) {
|
||||||
|
let isValid = true;
|
||||||
|
|
||||||
|
form.find("input[type='radio']").each(function() {
|
||||||
|
const groupName = $(this).attr("name");
|
||||||
|
if (!form.find(`input[name='${groupName}']:checked`).length) {
|
||||||
|
isValid = false;
|
||||||
|
$(this).siblings(".invalid-feedback").show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!isValid) {
|
||||||
|
Swal.fire({
|
||||||
|
icon: "error",
|
||||||
|
title: "Isi Semua Data",
|
||||||
|
text: "Terdapat kuesioner yang masih belum diisi",
|
||||||
|
confirmButtonColor: '#0d6efd',
|
||||||
|
confirmButtonText: 'Tutup',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Hide the invalid feedback when a radio button is clicked
|
||||||
|
form.find("input[type='radio']").change(function() {
|
||||||
|
$(this).siblings(".invalid-feedback").hide();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
Loading…
Reference in New Issue