survey-sdgs/resources/views/pages/admins/surveys/detail.blade.php

124 lines
6.7 KiB
PHP

@extends('layouts.app')
@section('title', 'Detail Survei')
@section('content')
<!-- button back -->
<a href="{{ URL::to('admin/surveys') }}" class="mb-3 badge text-bg-light text-primary">
<i class="ti ti-arrow-left">&nbsp;</i> Kembali
</a>
<!-- Surveys -->
<div class="row d-flex align-items-strech">
<div class="col-lg-12 mx-auto">
<div class="card">
<div class="card-header text-white bg-primary">
<h3 class="form-label mt-2 text-white border-bottom pb-3">{{ $survey->name }}</h3>
<pre for="description" class="mt-3 text-wrap">{{ $survey->description }}</pre>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-lg-12">
<div class="card">
<div class="card-body table-responsive">
<table class="table table-responsive table-bordered text-nowrap mb-0 align-middle">
<thead class="text-dark fs-4">
<tr>
<th class="border-bottom-0 align-middle" width="45px">
<h6 class="fw-semibold mb-0 text-center">No.</h6>
</th>
<th class="border-bottom-0 align-middle" width="100px">
<h6 class="fw-semibold mb-0 text-center">Tahun</h6>
</th>
<th class="border-bottom-0 align-middle">
<h6 class="fw-semibold mb-0">NIK</h6>
</th>
<th class="border-bottom-0 align-middle" width="100px">
<h6 class="fw-semibold mb-0 text-center">Nama</h6>
</th>
<th class="border-bottom-0 align-middle" width="100px">
<h6 class="fw-semibold mb-0 text-center">Jenis Kelamin</h6>
</th>
<th class="border-bottom-0 align-middle" width="100px">
<h6 class="fw-semibold mb-0 text-center">Tempat Lahir</h6>
</th>
<th class="border-bottom-0 align-middle" width="100px">
<h6 class="fw-semibold mb-0 text-center">Usia</h6>
</th>
@foreach ($survey->questionSurveys as $_question)
<th class="border-bottom-0 align-middle" width="300px">
<h6 class="fw-semibold mb-0 text-wrap text-center">
{{ $_question->name }}
</h6>
</th>
@endforeach
</tr>
</thead>
<tbody>
@php
$no = 1;
$answer_user = '';
@endphp
@foreach ($questionAnswers as $_answers)
<tr>
<td>{{ $no++ }}</td>
<td>{{ $survey->years }}</td>
{{-- @php $user_detail = $question->questionAnswers->first(); @endphp --}}
<td>{{ $_answers->users->nik }}</td>
<td>{{ $_answers->users->name }}</td>
<td>{{ $_answers->users->gender }}</td>
<td>{{ $_answers->users->place_of_birth }}</td>
<td>{{ $_answers->users->date_of_birth }}</td>
@foreach ($survey->questionSurveys as $_question)
<td>{{ $_question->id == $_answers->question_id ? $_answers->answer : 'Kosong' }}
</td>
@endforeach
</tr>
@endforeach
{{-- <tr>
<td class="border-bottom-0" width="45px">
<h6 class="fw-normal mb-0 text-center">{{ ($questionSurveys->currentPage()-1) * $questionSurveys->perPage() + $loop->index + 1 }}</h6>
</td>
<td class="border-bottom-0" width="400px">
<h6 class="fw-normal mb-0 text-wrap">{{ $question->name }}</h6>
</td>
<td class="border-bottom-0" width="100px">
<h6 class="fw-normal mb-0">
{{ $question->type }}
@if ($question->questionDetails && $question->type == 'Skala')
<hr>
{{ json_decode($question->questionDetails->question_value)[0] }} = {{ json_decode($question->questionDetails->question_label)[0] }}
<br>
{{ json_decode($question->questionDetails->question_value)[1] }} = {{ json_decode($question->questionDetails->question_label)[1] }}
@endif
</h6>
</td>
@forelse ($question->questionAnswers as $row)
<td class="border-bottom-0" width="300px">
<h6 class="fw-normal mb-0 text-wrap text-break text-center">{{ $row->answer }}</h6>
</td>
@empty
<td class="border-bottom-0" width="100px">
<h6 class="fw-normal mb-0 text-center">Jawaban Kosong</h6>
</td>
@endforelse
</tr> --}}
{{-- @empty
<tr>
<th class="border-bottom-0" width="100px" colspan="3">
<h6 class="fw-normal mb-0 text-center">Survey Kosong</h6>
</th>
</tr>
@endforelse --}}
</tbody>
</table>
</div>
</div>
</div>
</div>
@stop