first commit

This commit is contained in:
2026-05-22 20:46:29 +08:00
commit b04f87f2b0
121 changed files with 14851 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="card p-2 shadow-sm border-0 mb-3" style="border-radius: 15px;">
<h5 class="mb-3 text-success">Jawapan Responden</h5>
<div class="row">
<div class="col-md-4">
<small class="text-muted d-block">Nama</small>
<strong>{{ $response->respondent_name ?? '-' }}</strong>
</div>
<div class="col-md-4 border-start border-end">
<small class="text-muted d-block">No. Pekerja</small>
<strong>{{ $response->respondent_no_pekerja ?? '-' }}</strong>
</div>
<div class="col-md-4">
<small class="text-muted d-block">Jabatan</small>
<strong>{{ $response->respondent_jabatan ?? '-' }}</strong>
</div>
</div>
</div>
<div class="mt-2 px-2">
<p class="mb-0">
<span class="fw-bold text-primary">{{ $response->survey->title }}</span>
</p>
</div>
<hr>
@foreach($response->answers as $answer)
<div class="mb-3">
<strong>{{ $answer->question->question_text }}</strong>
<p>{{ $answer->answer_text }}</p>
</div>
@endforeach
</div>
@endsection

View File

@@ -0,0 +1,61 @@
@extends('layouts.app')
@push('styles')
<link rel="stylesheet" href="{{ asset('css/adminHeader.css') }}">
<link rel="stylesheet" href="{{ asset('css/responsesAdmin.css') }}">
@endpush
@section('content')
<div class="container">
<div class="admin-header-box">
<div>
<h4>Senarai Borang & Responden</h4>
<p>Klik pada butang tersebut untuk melihat senarai dan jawapan responden.</p>
</div>
<form method="GET" action="{{ route('admin.responses.list') }}" style="max-width: 300px; width: 100%;">
<div class="input-group input-group-sm shadow-sm">
<input type="text" name="search" value="{{ request('search') }}" class="form-control border-0 ps-3" placeholder="Cari tajuk..." style="border-radius: 20px 0 0 20px;">
<button class="btn btn-light border-0 px-3" type="submit" style="color: #4e73df;">
<i class="bi bi-search"></i>
</button>
@if(request('search'))
<a href="{{ route('admin.responses.list') }}" class="btn btn-light border-0 border-start px-2" style="border-radius: 0 20px 20px 0;">
<i class="bi bi-arrow-counterclockwise"></i>
</a>
@else
<div class="bg-light px-2" style="border-radius: 0 20px 20px 0;"></div>
@endif
</div>
</form>
</div>
<div class="row g-3">
@forelse($surveys as $survey)
<div class="col-md-6 col-lg-4 d-flex">
<div class="response-survey-item d-flex align-items-center justify-content-between p-3 shadow-sm w-100">
<div class="d-flex align-items-center flex-grow-1 me-3">
<div class="icon-box-stat me-3">
<span class="fw-bold text-secondary">#{{ $loop->iteration }}</span>
</div>
<div class="flex-grow-1">
<h6 class="mb-1 text-dark text-uppercase">{{ $survey->title }}</h6>
<small class="text-muted">{{ $survey->responses_count }} respons</small>
</div>
</div>
<a href="{{ route('admin.responses.respondents', $survey->id) }}" class="btn btn-primary btn-sm rounded-2 px-3">
<i class="bi bi-box-arrow-up-right"></i>
</a>
</div>
</div>
@empty
<div class="col-12 text-center py-5">
<div class="text-muted">
<i class="bi bi-inbox fs-1 d-block mb-2 opacity-25"></i>
<p class="small">Tiada borang ditemui.</p>
</div>
</div>
@endforelse
</div>
</div>
@endsection

View File

@@ -0,0 +1,66 @@
@extends('layouts.app')
@push('styles')
<link rel="stylesheet" href="{{ asset('css/adminHeader.css') }}">
@endpush
@section('content')
<div class="container">
<div class="admin-header-box mb-4">
<div>
<h4>Responden: {{ $survey->title }}</h4>
<p>Senarai pengguna yang telah menjawab borang ini.</p>
</div>
<a href="{{ route('admin.responses.list') }}" class="btn btn-sm btn-light px-3 fw-bold text-primary">
<i class="bi bi-arrow-left"></i> Kembali
</a>
</div>
<div class="card shadow-sm">
<div class="card-header bg-primary text-white">
<h5 class="mb-0">Jumlah Responden: {{ $responses->count() }}</h5>
</div>
<div class="card-body p-0">
@if($responses->isEmpty())
<div class="alert alert-info mb-0 p-4">
Belum ada responden yang menjawab borang ini.
</div>
@else
<div class="table-responsive">
<table class="table table-striped table-hover mb-0">
<thead>
<tr>
<th>#</th>
<th>Responden</th>
<th>Nombor Pekerja</th>
<th>Tarikh Jawab</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
@foreach($responses as $index => $response)
<tr>
<td>{{ $index + 1 }}</td>
<td>
{{-- Klik nama/butang untuk ke halaman detail.blade.php --}}
<a href="{{ route('admin.responses.detail', $response->id) }}" class="text-primary fw-bold">
{{ $response->respondent_name ?? '-' }}
</a>
</td>
<td>{{ $response->respondent_no_pekerja ?? '-' }}</td>
<td>{{ $response->created_at->format('d M Y') }}</td>
<td>
<a href="{{ route('admin.responses.detail', $response->id) }}" class="btn btn-sm btn-info text-white">
Lihat Jawapan
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
</div>
@endsection