diff --git a/app/Http/Controllers/Admin/AdminController.php b/app/Http/Controllers/Admin/AdminController.php index ebdd874..7449f61 100644 --- a/app/Http/Controllers/Admin/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -27,7 +27,7 @@ public function dashboard() ->toArray(); // Pastikan semua status memiliki nilai, jika tidak ada datanya - $allStatuses = ['Menunggu', 'Diterima', 'Diproses', 'Selesai']; + $allStatuses = ['Menunggu', 'Diterima', 'Diproses', 'Selesai', 'Ditolak']; foreach ($allStatuses as $status) { if (!isset($serviceStats[$status])) { $serviceStats[$status] = 0; @@ -182,11 +182,20 @@ public function update(Request $request, User $admin) 'gender' => $request->gender, ]); + // Jika password baru diisi, validasi password lama if ($request->filled('password')) { $request->validate([ + 'current_password' => 'required|string', 'password' => 'required|string|min:8|confirmed', ]); + // Verifikasi password lama + if (!Hash::check($request->current_password, $admin->password)) { + return back() + ->withErrors(['current_password' => 'Password lama tidak sesuai']) + ->withInput(); + } + $admin->update([ 'password' => Hash::make($request->password), ]); diff --git a/app/Http/Controllers/ComplaintController.php b/app/Http/Controllers/ComplaintController.php index efd51e3..bd38845 100644 --- a/app/Http/Controllers/ComplaintController.php +++ b/app/Http/Controllers/ComplaintController.php @@ -7,6 +7,7 @@ use App\Http\Requests\UpdateComplaintRequest; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Barryvdh\DomPDF\Facade\PDF; class ComplaintController extends Controller { @@ -120,4 +121,60 @@ public function destroy(Complaint $complaint) return redirect()->route('complaints.index') ->with('success', 'Keluhan berhasil dihapus!'); } + + /** + * Generate PDF for a single complaint + */ + public function pdf(Complaint $complaint) + { + // Pastikan pengguna hanya bisa melihat keluhan miliknya sendiri atau admin + if (Auth::user()->role === 'pelanggan') { + if ($complaint->user_id !== Auth::id()) { + abort(403, 'Unauthorized action.'); + } + } + + $pdf = PDF::loadView('complaints.pdf', compact('complaint')); + return $pdf->download('keluhan-' . $complaint->id . '.pdf'); + } + + /** + * Generate PDF for all complaints (admin only) + */ + public function allPdf(Request $request) + { + // Hanya admin yang bisa akses + if (Auth::user()->role !== 'admin') { + abort(403, 'Unauthorized action.'); + } + + // Ambil semua data atau filter jika diperlukan + $complaints = Complaint::latest()->get(); + + // Jika ada filter, tambahkan ke array filters + $filters = []; + if ($request->filled('tanggal_mulai')) { + $complaints = $complaints->filter(function ($item) use ($request) { + return $item->created_at->format('Y-m-d') >= $request->tanggal_mulai; + }); + $filters['tanggal_mulai'] = $request->tanggal_mulai; + } + + if ($request->filled('tanggal_selesai')) { + $complaints = $complaints->filter(function ($item) use ($request) { + return $item->created_at->format('Y-m-d') <= $request->tanggal_selesai; + }); + $filters['tanggal_selesai'] = $request->tanggal_selesai; + } + + if ($request->filled('jenis_layanan')) { + $complaints = $complaints->filter(function ($item) use ($request) { + return $item->jenis_layanan == $request->jenis_layanan; + }); + $filters['jenis_layanan'] = $request->jenis_layanan; + } + + $pdf = PDF::loadView('complaints.all-pdf', compact('complaints', 'filters')); + return $pdf->download('semua-keluhan.pdf'); + } } diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index c1aeff6..2a7e1bc 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -26,6 +26,9 @@ public function home() $completedServices = Service::where('user_id', $user->id) ->where('status', 'Selesai') ->count(); + $rejectedServices = Service::where('user_id', $user->id) + ->where('status', 'Ditolak') + ->count(); // Mengambil layanan terbaru milik customer $latestServices = Service::where('user_id', $user->id) @@ -39,6 +42,7 @@ public function home() 'pendingServices', 'processedServices', 'completedServices', + 'rejectedServices', 'latestServices' )); } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 5526b50..52a47b3 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -25,18 +25,18 @@ public function edit() public function update(Request $request) { $user = Auth::user(); - + // Validasi berbeda untuk admin dan customer if ($user->role === 'admin') { $request->validate([ 'name' => 'required|string|max:255', 'password' => 'nullable|string|min:8|confirmed', ]); - + // Data yang dapat diubah untuk admin - $data = [ - 'name' => $request->name, - ]; + User::where('id', $user->id)->update([ + 'name' => $request->name + ]); } else { // Untuk customer $request->validate([ @@ -45,20 +45,30 @@ public function update(Request $request) 'business_name' => 'required|string|max:255', 'business_address' => 'required|string', ]); - + // Data yang dapat diubah untuk customer - $data = [ + User::where('id', $user->id)->update([ 'name' => $request->name, 'business_name' => $request->business_name, - 'business_address' => $request->business_address, - ]; + 'business_address' => $request->business_address + ]); } - - $user->update($data); // Update password jika diisi if ($request->filled('password')) { - $user->update([ + // Validasi password lama + $request->validate([ + 'current_password' => 'required|string', + ]); + + // Verifikasi password lama + if (!Hash::check($request->current_password, $user->password)) { + return back() + ->withErrors(['current_password' => 'Password lama tidak sesuai']) + ->withInput(); + } + + User::where('id', $user->id)->update([ 'password' => Hash::make($request->password) ]); } diff --git a/app/Http/Controllers/SatisfactionController.php b/app/Http/Controllers/SatisfactionController.php index 9a1778a..fcb2a63 100644 --- a/app/Http/Controllers/SatisfactionController.php +++ b/app/Http/Controllers/SatisfactionController.php @@ -7,6 +7,7 @@ use App\Http\Requests\UpdateSatisfactionRequest; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Barryvdh\DomPDF\Facade\PDF; class SatisfactionController extends Controller { @@ -15,9 +16,9 @@ class SatisfactionController extends Controller */ public function index() { - if(Auth::user()->role === 'admin'){ + if (Auth::user()->role === 'admin') { $satisfactions = Satisfaction::latest()->paginate(10); - }else{ + } else { $satisfactions = Satisfaction::where('user_id', Auth::id())->latest()->paginate(10); } return view('satisfactions.index', compact('satisfactions')); @@ -28,13 +29,7 @@ public function index() */ public function create() { - // Cek apakah user sudah pernah mengisi kuesioner - $hasSurvey = Satisfaction::where('user_id', Auth::id())->exists(); - if ($hasSurvey) { - return redirect()->route('satisfactions.index') - ->with('warning', 'Anda sudah pernah mengisi kuesioner kepuasan pelanggan.'); - } - + // Kode lama yang membatasi satu kali pengisian per user telah dihapus return view('satisfactions.create'); } @@ -77,7 +72,7 @@ public function store(Request $request) public function show(Satisfaction $satisfaction) { // Pastikan pengguna hanya bisa melihat data survei miliknya sendiri - if(Auth::user()->role === 'pelanggan'){ + if (Auth::user()->role === 'pelanggan') { if ($satisfaction->user_id !== Auth::id()) { abort(403, 'Unauthorized action.'); } @@ -150,6 +145,69 @@ public function destroy(Satisfaction $satisfaction) ->with('success', 'Penilaian kepuasan pelanggan berhasil dihapus.'); } + /** + * Generate PDF for a single satisfaction + */ + public function pdf(Satisfaction $satisfaction) + { + // Pastikan pengguna hanya bisa melihat data survei miliknya sendiri atau admin + if (Auth::user()->role === 'pelanggan') { + if ($satisfaction->user_id !== Auth::id()) { + abort(403, 'Unauthorized action.'); + } + } + + $pdf = PDF::loadView('satisfactions.pdf', compact('satisfaction')); + return $pdf->download('penilaian-kepuasan-' . $satisfaction->id . '.pdf'); + } + + /** + * Generate PDF for all satisfactions (admin only) + */ + public function allPdf(Request $request) + { + // Hanya admin yang bisa akses + if (Auth::user()->role !== 'admin') { + abort(403, 'Unauthorized action.'); + } + + // Ambil semua data atau filter jika diperlukan + $satisfactions = Satisfaction::latest()->get(); + + // Jika ada filter, tambahkan ke array filters + $filters = []; + if ($request->filled('tanggal_mulai')) { + $satisfactions = $satisfactions->filter(function ($item) use ($request) { + return $item->created_at->format('Y-m-d') >= $request->tanggal_mulai; + }); + $filters['tanggal_mulai'] = $request->tanggal_mulai; + } + + if ($request->filled('tanggal_selesai')) { + $satisfactions = $satisfactions->filter(function ($item) use ($request) { + return $item->created_at->format('Y-m-d') <= $request->tanggal_selesai; + }); + $filters['tanggal_selesai'] = $request->tanggal_selesai; + } + + if ($request->filled('rating_min')) { + $satisfactions = $satisfactions->filter(function ($item) use ($request) { + return $item->average_score >= $request->rating_min; + }); + $filters['rating_min'] = $request->rating_min; + } + + if ($request->filled('rating_max')) { + $satisfactions = $satisfactions->filter(function ($item) use ($request) { + return $item->average_score <= $request->rating_max; + }); + $filters['rating_max'] = $request->rating_max; + } + + $pdf = PDF::loadView('satisfactions.all-pdf', compact('satisfactions', 'filters')); + return $pdf->download('semua-penilaian-kepuasan.pdf'); + } + /** * Display the admin dashboard for survey results */ diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index fc0f8ce..91ad74f 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -184,6 +184,13 @@ public function update(Request $request, Service $service) $rules['biaya_retribusi_jarak'] = 'nullable|integer|min:0'; $rules['biaya_retribusi'] = 'nullable|integer|min:0'; + // Validasi keterangan jika status Diterima atau Ditolak + if (in_array($request->status, ['Diterima', 'Ditolak'])) { + $rules['keterangan'] = 'required|string|min:5'; + } else { + $rules['keterangan'] = 'nullable|string'; + } + // Validasi file hasil uji jika ada if ($request->hasFile('file_hasil_uji')) { $rules['file_hasil_uji'] = 'file|mimes:pdf,doc,docx,png,jpg,jpeg|max:10240'; diff --git a/app/Models/Service.php b/app/Models/Service.php index 78f948c..df5b2a5 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -23,6 +23,7 @@ class Service extends Model 'biaya_retribusi_jarak', 'biaya_retribusi', 'file_hasil_uji', + 'keterangan', ]; /** diff --git a/config/app.php b/config/app.php index 9207160..f43851e 100644 --- a/config/app.php +++ b/config/app.php @@ -70,7 +70,7 @@ | */ - 'timezone' => 'UTC', + 'timezone' => 'Asia/Jakarta', /* |-------------------------------------------------------------------------- @@ -83,7 +83,7 @@ | */ - 'locale' => 'en', + 'locale' => 'id', /* |-------------------------------------------------------------------------- @@ -96,7 +96,7 @@ | */ - 'fallback_locale' => 'en', + 'fallback_locale' => 'id', /* |-------------------------------------------------------------------------- @@ -109,7 +109,7 @@ | */ - 'faker_locale' => 'en_US', + 'faker_locale' => 'id_ID', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2025_04_26_120229_add_keterangan_to_services_table.php b/database/migrations/2025_04_26_120229_add_keterangan_to_services_table.php new file mode 100644 index 0000000..af071a5 --- /dev/null +++ b/database/migrations/2025_04_26_120229_add_keterangan_to_services_table.php @@ -0,0 +1,49 @@ +text('keterangan')->nullable()->after('file_hasil_uji'); + + // Drop dan recreate kolom status untuk menambahkan opsi 'Ditolak' + $table->dropColumn('status'); + }); + + // Membuat ulang kolom status dengan enum yang diperbarui + Schema::table('services', function (Blueprint $table) { + $table->enum('status', ['Menunggu', 'Diterima', 'Diproses', 'Selesai', 'Ditolak']) + ->default('Menunggu') + ->nullable() + ->after('jarak_pengambilan_sampel'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('services', function (Blueprint $table) { + $table->dropColumn('keterangan'); + + // Drop dan recreate kolom status tanpa opsi 'Ditolak' + $table->dropColumn('status'); + }); + + // Membuat ulang kolom status dengan enum original + Schema::table('services', function (Blueprint $table) { + $table->enum('status', ['Menunggu', 'Diterima', 'Diproses', 'Selesai']) + ->default('Menunggu') + ->nullable() + ->after('jarak_pengambilan_sampel'); + }); + } +}; diff --git a/public/images/logo1.png b/public/images/logo1.png index 95498c6..fdcba6b 100644 Binary files a/public/images/logo1.png and b/public/images/logo1.png differ diff --git a/public/images/logo4.png b/public/images/logo4.png new file mode 100644 index 0000000..53d7b52 Binary files /dev/null and b/public/images/logo4.png differ diff --git a/public/images/logo5.png b/public/images/logo5.png new file mode 100644 index 0000000..7ac54da Binary files /dev/null and b/public/images/logo5.png differ diff --git a/public/images/logobulat.jpg b/public/images/logobulat.jpg index 15e24b4..c68e16f 100644 Binary files a/public/images/logobulat.jpg and b/public/images/logobulat.jpg differ diff --git a/resources/views/Dashboard/layouts/main.blade.php b/resources/views/Dashboard/layouts/main.blade.php index ba91638..b140f17 100644 --- a/resources/views/Dashboard/layouts/main.blade.php +++ b/resources/views/Dashboard/layouts/main.blade.php @@ -2,13 +2,13 @@ - @yield('title') | YudhaAsrama + @yield('title') | UPTD. LABLING DLH KOTA PROBOLINGGO - - + + - + diff --git a/resources/views/Dashboard/partials/footer.blade.php b/resources/views/Dashboard/partials/footer.blade.php index ff42bf3..7ff46a7 100644 --- a/resources/views/Dashboard/partials/footer.blade.php +++ b/resources/views/Dashboard/partials/footer.blade.php @@ -3,7 +3,10 @@
- © {{ date('Y') }} - YudhaAsrama by Yudha Developer + © {{ date('Y') }} + - + {{-- - Pengujian Air by --}} + UPTD Laboratorium Lingkungan Pada Dinas Lingkungan Hidup Kota Probolinggo
diff --git a/resources/views/Dashboard/partials/navbar.blade.php b/resources/views/Dashboard/partials/navbar.blade.php index 51501c7..9f570e9 100644 --- a/resources/views/Dashboard/partials/navbar.blade.php +++ b/resources/views/Dashboard/partials/navbar.blade.php @@ -64,14 +64,14 @@ function toggleFullScreen() {
-
diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index d634dce..4c6603c 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -126,18 +126,24 @@

Diterima

-
+

{{ $serviceStats['Diproses'] }}

Diproses

-
+

{{ $serviceStats['Selesai'] }}

Selesai

+
+

+ {{ $serviceStats['Ditolak'] }} +

+

Ditolak

+
@@ -197,6 +203,8 @@ Diproses @elseif($service->status == 'Selesai') Selesai + @elseif($service->status == 'Ditolak') + Ditolak @endif @@ -264,12 +272,24 @@ {label: "Menunggu", value: {{ $serviceStats['Menunggu'] }}}, {label: "Diterima", value: {{ $serviceStats['Diterima'] }}}, {label: "Diproses", value: {{ $serviceStats['Diproses'] }}}, - {label: "Selesai", value: {{ $serviceStats['Selesai'] }}} + {label: "Selesai", value: {{ $serviceStats['Selesai'] }}}, + {label: "Ditolak", value: {{ $serviceStats['Ditolak'] }}} ], - colors: ['#ffbd4a', '#4fc6e1', '#6658dd', '#1abc9c'], + colors: ['#ffbd4a', '#4fc6e1', '#6658dd', '#1abc9c', '#d9534f'], resize: true }); + // Menentukan nilai maksimum untuk grafik bar + var maxValue = Math.max( + @foreach($waterTestTypes as $type => $count) + {{ $count }}, + @endforeach + 0 + ); + + // Menentukan jumlah garis untuk grafik berdasarkan nilai maksimum + var numLines = maxValue <= 1 ? 2 : Math.ceil(maxValue) + 1; + // Morris Bar Chart - Distribusi Pengujian Kualitas Air Morris.Bar({ element: 'morris-bar-example', @@ -285,7 +305,13 @@ hideHover: 'auto', resize: true, gridLineColor: '#eef0f2', - barColors: ['#4a81d4'] + barColors: ['#4a81d4'], + ymax: maxValue <= 1 ? 1 : Math.ceil(maxValue), + ymin: 0, + numLines: numLines, + yLabelFormat: function(y) { + return Math.round(y); // Hanya menampilkan angka bulat + } }); // Morris Pie Chart - Jenis Permintaan diff --git a/resources/views/admin/edit.blade.php b/resources/views/admin/edit.blade.php index 6c9215c..baa2099 100644 --- a/resources/views/admin/edit.blade.php +++ b/resources/views/admin/edit.blade.php @@ -56,9 +56,34 @@
- - + +
+ +
+ +
+
+ @error('current_password') +
+ {{ $message }} +
+ @enderror +
+ +
+ +
+ +
+ +
+
@error('password')
{{ $message }} @@ -67,9 +92,16 @@
- - + +
+ +
+ +
+
@@ -80,4 +112,24 @@
+@endsection + +@section('scripts') + @endsection \ No newline at end of file diff --git a/resources/views/admin/index.blade.php b/resources/views/admin/index.blade.php index 8ebee09..673a17f 100644 --- a/resources/views/admin/index.blade.php +++ b/resources/views/admin/index.blade.php @@ -65,13 +65,9 @@ @if(auth()->id() !== $admin->id) -
- @csrf - @method('DELETE') - -
+ @endif @@ -82,6 +78,9 @@ + + +@include('layouts.delete-modal') @endsection @section('scripts') diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index e222f67..007818f 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -24,9 +24,13 @@ @enderror -
+
+ placeholder="Masukkan Password Anda" name="password" id="password" required> + + + @error('password') {{ $message }} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 664ac5b..bcff97f 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -83,9 +83,13 @@ @enderror
-
+
+ placeholder="Masukkan Password" name="password" id="password" required> + + + @error('password') {{ $message }} @@ -93,9 +97,13 @@ @enderror
-
+
+ placeholder="Konfirmasi Password" name="password_confirmation" id="password_confirmation" required> + + +
diff --git a/resources/views/complaints/all-pdf.blade.php b/resources/views/complaints/all-pdf.blade.php new file mode 100644 index 0000000..d917a33 --- /dev/null +++ b/resources/views/complaints/all-pdf.blade.php @@ -0,0 +1,158 @@ + + + + + Daftar Keluhan + + + +
+

DAFTAR KELUHAN PELANGGAN

+

Dicetak pada: {{ date('d-m-Y H:i:s') }}

+
+ + @if(isset($filters) && count($filters) > 0) +
+

Filter yang digunakan:

+
    + @foreach($filters as $key => $value) + @if($value) +
  • {{ ucfirst(str_replace('_', ' ', $key)) }}: {{ $value }}
  • + @endif + @endforeach +
+
+ @endif + +
+

Daftar Keluhan

+ + + + + + + + + + + + + + @forelse($complaints as $key => $complaint) + + + + + + + + + + @empty + + + + @endforelse + +
NoNamaJenis LayananTanggal KeluhanTanggal DibuatUraian KeluhanSaran
{{ $key + 1 }}{{ $complaint->user->name }}{{ $complaint->jenis_layanan }}{{ \Carbon\Carbon::parse($complaint->tanggal_keluhan)->format('d M Y') }}{{ $complaint->created_at->format('d M Y') }}{{ Str::limit($complaint->uraian_keluhan, 100) }}{{ Str::limit($complaint->saran, 100) }}
Tidak ada data keluhan
+
+ +
+

Ringkasan

+ + + + + + + + + + + + + +
Total Keluhan{{ $complaints->count() }}
Keluhan Bulan Ini{{ $complaints->filter(function($item) { return $item->created_at->isCurrentMonth(); })->count() }}
Jenis Layanan Terbanyak + @php + $serviceCounts = []; + foreach ($complaints as $complaint) { + if (!isset($serviceCounts[$complaint->jenis_layanan])) { + $serviceCounts[$complaint->jenis_layanan] = 0; + } + $serviceCounts[$complaint->jenis_layanan]++; + } + arsort($serviceCounts); + $topService = key($serviceCounts); + $topCount = reset($serviceCounts); + @endphp + {{ $complaints->count() > 0 ? $topService . ' (' . $topCount . ')' : '-' }} +
+
+ + + + \ No newline at end of file diff --git a/resources/views/complaints/create.blade.php b/resources/views/complaints/create.blade.php index 69a0cbc..ea77b42 100644 --- a/resources/views/complaints/create.blade.php +++ b/resources/views/complaints/create.blade.php @@ -42,9 +42,7 @@ @error('jenis_layanan')
{{ $message }}
diff --git a/resources/views/complaints/edit.blade.php b/resources/views/complaints/edit.blade.php index f002fcc..c9b0e5f 100644 --- a/resources/views/complaints/edit.blade.php +++ b/resources/views/complaints/edit.blade.php @@ -43,9 +43,7 @@ @error('jenis_layanan')
{{ $message }}
diff --git a/resources/views/complaints/index.blade.php b/resources/views/complaints/index.blade.php index 64cf6a2..cfc1947 100644 --- a/resources/views/complaints/index.blade.php +++ b/resources/views/complaints/index.blade.php @@ -40,8 +40,81 @@ @endcan
+ + @can('admin') +
+
+ + +
+
+ @endcan
+ @can('admin') +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + + Reset Filter + + +
+
+
+
+
+ + + @endcan +
@@ -49,7 +122,6 @@ - @@ -60,24 +132,22 @@ - @@ -102,4 +172,7 @@ + + +@include('layouts.delete-modal') @endsection \ No newline at end of file diff --git a/resources/views/complaints/pdf.blade.php b/resources/views/complaints/pdf.blade.php new file mode 100644 index 0000000..01a2837 --- /dev/null +++ b/resources/views/complaints/pdf.blade.php @@ -0,0 +1,130 @@ + + + + + Detail Keluhan #{{ $complaint->id }} + + + +
+

DETAIL KELUHAN #{{ $complaint->id }}

+

Dicetak pada: {{ date('d-m-Y H:i:s') }}

+
+ +
+

Informasi Pelanggan

+
No Jenis Layanan Tanggal KeluhanUraian Keluhan Tanggal Dibuat Aksi
{{ $index + $complaints->firstItem() }} {{ $complaint->jenis_layanan }} {{ \Carbon\Carbon::parse($complaint->tanggal_keluhan)->format('d-m-Y') }}{{ \Illuminate\Support\Str::limit($complaint->uraian_keluhan, 50) }} {{ $complaint->created_at->format('d-m-Y H:i') }}
+ + + @can('customer') -
- @csrf - @method('DELETE') - -
+ @endcan
+ + + + + + + + + + + + + + + + +
Nama{{ $complaint->user->name }}
Email{{ $complaint->user->email }}
No. HP{{ $complaint->user->phone ?? '-' }}
Nama Badan Usaha{{ $complaint->user->business_name ?? '-' }}
+
+ +
+

Detail Keluhan

+ + + + + + + + + + + + + +
Jenis Layanan{{ $complaint->jenis_layanan }}
Tanggal Keluhan{{ \Carbon\Carbon::parse($complaint->tanggal_keluhan)->format('d F Y') }}
Tanggal Dibuat{{ $complaint->created_at->format('d F Y, H:i') }}
+
+ +
+

Uraian Keluhan

+
+ {{ $complaint->uraian_keluhan }} +
+
+ +
+

Saran

+
+ {{ $complaint->saran }} +
+
+ + + + \ No newline at end of file diff --git a/resources/views/customer/home.blade.php b/resources/views/customer/home.blade.php index aa78c34..687e857 100644 --- a/resources/views/customer/home.blade.php +++ b/resources/views/customer/home.blade.php @@ -24,6 +24,7 @@

Sistem ini memungkinkan Anda melakukan permintaan pengambilan dan pengujian sampel air. Kami siap melayani Anda dengan profesional dan memberikan hasil uji yang akurat. + Setelah pendaftaran uji kualitas air, kami akan menginformasikan lebih lanjut mengenai proses pengujian paling lambat 3 hari kerja.

Profil Anda telah terdaftar sebagai: @@ -48,7 +49,7 @@ Ajukan Permintaan Pengujian Baru - + Edit Profil

@@ -98,7 +99,7 @@ -
+

Diproses

@@ -115,7 +116,7 @@
-
+

Selesai

@@ -131,6 +132,23 @@
+ +
+
+

Ditolak

+
+
+ Ditolak +

{{ $rejectedServices }}

+

Layanan

+
+
+
+
+
+
+
+
@@ -168,6 +186,8 @@ Diproses @elseif($service->status == 'Selesai') Selesai + @elseif($service->status == 'Ditolak') + Ditolak @endif diff --git a/resources/views/layouts/auth.blade.php b/resources/views/layouts/auth.blade.php index ee04c80..f22b9db 100644 --- a/resources/views/layouts/auth.blade.php +++ b/resources/views/layouts/auth.blade.php @@ -5,6 +5,13 @@ @yield('title') - UPTD Laboratorium Lingkungan + + + + + + + @@ -96,8 +106,8 @@
- Logo Kota - Logo Dinas + Logo Kota + Logo Dinas

UPTD LABORATORIUM LINGKUNGAN PADA DINAS LINGKUNGAN HIDUP KOTA PROBOLINGGO

@@ -114,5 +124,21 @@
+ \ No newline at end of file diff --git a/resources/views/layouts/delete-modal.blade.php b/resources/views/layouts/delete-modal.blade.php new file mode 100644 index 0000000..282e13c --- /dev/null +++ b/resources/views/layouts/delete-modal.blade.php @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/resources/views/profile/edit.blade.php b/resources/views/profile/edit.blade.php index 82a0037..3e2e574 100644 --- a/resources/views/profile/edit.blade.php +++ b/resources/views/profile/edit.blade.php @@ -67,7 +67,7 @@ id="business_name" name="business_name" value="{{ old('business_name', $user->business_name) }}" required> @error('business_name')
- + {{ $message }}
@enderror
@@ -78,16 +78,41 @@ id="business_address" name="business_address" rows="3" required>{{ old('business_address', $user->business_address) }} @error('business_address')
- + {{ $message }}
@enderror
@endif +
+ +
+ +
+ +
+
+ @error('current_password') +
+ {{ $message }} +
+ @enderror +
+
- +
+ +
+ +
+
@error('password')
{{ $message }} @@ -97,8 +122,15 @@
- +
+ +
+ +
+
@@ -109,4 +141,24 @@
+@endsection + +@section('scripts') + @endsection \ No newline at end of file diff --git a/resources/views/satisfactions/all-pdf.blade.php b/resources/views/satisfactions/all-pdf.blade.php new file mode 100644 index 0000000..849c6bf --- /dev/null +++ b/resources/views/satisfactions/all-pdf.blade.php @@ -0,0 +1,203 @@ + + + + + Daftar Penilaian Kepuasan Pelanggan + + + +
+

DAFTAR PENILAIAN KEPUASAN PELANGGAN

+

Dicetak pada: {{ date('d-m-Y H:i:s') }}

+
+ + @if(isset($filters) && count($filters) > 0) +
+

Filter yang digunakan:

+ +
+ @endif + +
+

Daftar Penilaian

+ + + + + + + + + + + + + + + + + + + + + + + + + + @forelse($satisfactions as $key => $satisfaction) + + + + + + + + + + + + + + + + + + + + + + @empty + + + + @endforelse + +
NoNamaTanggal PengisianNilai Rata-rataQ1Q2Q3Q4Q5Q6Q7Q8Q9Q10Q11Q12Q13Q14Q15
{{ $key + 1 }}{{ $satisfaction->user->name }}{{ $satisfaction->created_at->format('d M Y') }} + {{ number_format($satisfaction->average_score, 1) }} + {{ $satisfaction->q1 }}{{ $satisfaction->q2 }}{{ $satisfaction->q3 }}{{ $satisfaction->q4 }}{{ $satisfaction->q5 }}{{ $satisfaction->q6 }}{{ $satisfaction->q7 }}{{ $satisfaction->q8 }}{{ $satisfaction->q9 }}{{ $satisfaction->q10 }}{{ $satisfaction->q11 }}{{ $satisfaction->q12 }}{{ $satisfaction->q13 }}{{ $satisfaction->q14 }}{{ $satisfaction->q15 }}
Tidak ada data penilaian kepuasan
+
+ +
+

Ringkasan

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total Penilaian{{ $satisfactions->count() }}
Rata-rata Keseluruhan{{ number_format($satisfactions->avg('average_score'), 2) }}
Nilai Tertinggi{{ number_format($satisfactions->max('average_score'), 2) }}
Nilai Terendah{{ number_format($satisfactions->min('average_score'), 2) }}
Jumlah Penilaian Sangat Baik (>=4){{ $satisfactions->filter(function($item) { return $item->average_score >= 4; })->count() }}
Jumlah Penilaian Baik (>=3){{ $satisfactions->filter(function($item) { return $item->average_score >= 3 && $item->average_score < 4; })->count() }}
Jumlah Penilaian Cukup (>=2){{ $satisfactions->filter(function($item) { return $item->average_score >= 2 && $item->average_score < 3; })->count() }}
Jumlah Penilaian Kurang (<2){{ $satisfactions->filter(function($item) { return $item->average_score < 2; })->count() }}
+
+ + + + \ No newline at end of file diff --git a/resources/views/satisfactions/index.blade.php b/resources/views/satisfactions/index.blade.php index 16aecf3..9ef9922 100644 --- a/resources/views/satisfactions/index.blade.php +++ b/resources/views/satisfactions/index.blade.php @@ -49,8 +49,101 @@ @endcan
+ + @can('admin') +
+
+ + +
+
+ @endcan + @can('admin') +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + + Reset Filter + + +
+
+
+
+
+ + + @endcan +
@@ -76,17 +169,16 @@ + + + @can('customer') - - @csrf - @method('DELETE') - - + @endcan @@ -111,4 +203,7 @@ + + +@include('layouts.delete-modal') @endsection \ No newline at end of file diff --git a/resources/views/satisfactions/pdf.blade.php b/resources/views/satisfactions/pdf.blade.php new file mode 100644 index 0000000..ebb27de --- /dev/null +++ b/resources/views/satisfactions/pdf.blade.php @@ -0,0 +1,228 @@ + + + + + Detail Penilaian Kepuasan #{{ $satisfaction->id }} + + + +
+

PENILAIAN KEPUASAN PELANGGAN #{{ $satisfaction->id }}

+

Dicetak pada: {{ date('d-m-Y H:i:s') }}

+
+ +
+

Informasi Pelanggan

+
+ + + + + + + + + + + + +
Nama{{ $satisfaction->user->name }}
Email{{ $satisfaction->user->email }}
Waktu Pengisian{{ $satisfaction->created_at->format('d F Y, H:i') }}
+
+ +
+ Nilai Rata-rata: {{ number_format($satisfaction->average_score, 1) }} + @if($satisfaction->average_score >= 4) + (Sangat Baik) + @elseif($satisfaction->average_score >= 3) + (Baik) + @elseif($satisfaction->average_score >= 2) + (Cukup) + @else + (Kurang) + @endif +
+ +
+

Hasil Penilaian

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NoPertanyaanNilai
1Kesesuaian persyarataran pelayanan dengan jenis pelayanan{{ $satisfaction->q1 }}
2Kejelasan persyaratan administrasi yang dibutuhkan{{ $satisfaction->q2 }}
3Kemudahan prosedur mendapatkan pelayanan di unit ini{{ $satisfaction->q3 }}
4Kecepatan waktu dalam memberikan pelayanan{{ $satisfaction->q4 }}
5Ketepatan waktu jam buka pelayanan sesuai standar{{ $satisfaction->q5 }}
6Kewajaran biaya/tarif dalam pelayanan{{ $satisfaction->q6 }}
7Kesesuaian produk hasil pelayanan dengan standar pelayanan{{ $satisfaction->q7 }}
8Kompetensi/kemampuan petugas dalam pelayanan{{ $satisfaction->q8 }}
9Kesopanan dan keramahan petugas dalam memberikan pelayanan{{ $satisfaction->q9 }}
10Kualitas sarana dan prasarana pelayanan{{ $satisfaction->q10 }}
11Kebersihan dan kenyamanan ruang pelayanan{{ $satisfaction->q11 }}
12Kebersihan kamar mandi atau toilet{{ $satisfaction->q12 }}
13Kecukupan luas, kenyamanan dan keamanan tempat parkir{{ $satisfaction->q13 }}
14Penanganan saran dan pengaduan pengguna layanan{{ $satisfaction->q14 }}
15Kemudahan akses sarana pengaduan (kotak saran/telepon/email){{ $satisfaction->q15 }}
+
+ + @if($satisfaction->kritik_saran) +
+

Kritik dan Saran

+
+ {{ $satisfaction->kritik_saran }} +
+
+ @endif + + + + \ No newline at end of file diff --git a/resources/views/services/all-pdf.blade.php b/resources/views/services/all-pdf.blade.php index 2e17fdb..372a7f1 100644 --- a/resources/views/services/all-pdf.blade.php +++ b/resources/views/services/all-pdf.blade.php @@ -62,6 +62,7 @@ .status-diterima { background-color: #5bc0de; } .status-diproses { background-color: #0275d8; } .status-selesai { background-color: #5cb85c; } + .status-ditolak { background-color: #d9534f; } .footer { margin-top: 30px; text-align: center; @@ -128,6 +129,8 @@ @if($service->biaya_retribusi) Rp {{ number_format($service->biaya_retribusi, 0, ',', '.') }} + @elseif($service->status == 'Ditolak') + Ditolak @else Menunggu @endif @@ -151,7 +154,7 @@ Total Biaya Retribusi - Rp {{ number_format($services->sum('biaya_retribusi'), 0, ',', '.') }} + Rp {{ number_format($services->whereNotIn('status', ['Ditolak'])->sum('biaya_retribusi'), 0, ',', '.') }} Layanan Status Menunggu @@ -169,6 +172,10 @@ Layanan Status Selesai {{ $services->where('status', 'Selesai')->count() }} + + Layanan Status Ditolak + {{ $services->where('status', 'Ditolak')->count() }} + diff --git a/resources/views/services/edit.blade.php b/resources/views/services/edit.blade.php index d931386..6b37cf4 100644 --- a/resources/views/services/edit.blade.php +++ b/resources/views/services/edit.blade.php @@ -137,6 +137,7 @@ + @error('status')
{{ $message }}
@@ -158,6 +159,15 @@
{{ $message }}
@enderror + +
+ + + Tuliskan keterangan mengapa layanan diterima atau ditolak. Keterangan ini akan ditampilkan kepada pelanggan. + @error('keterangan') +
{{ $message }}
+ @enderror +
@@ -213,6 +223,32 @@ @section('scripts') @endsection \ No newline at end of file diff --git a/resources/views/services/pdf.blade.php b/resources/views/services/pdf.blade.php index 76f5869..e462a12 100644 --- a/resources/views/services/pdf.blade.php +++ b/resources/views/services/pdf.blade.php @@ -57,6 +57,7 @@ .status-diterima { background-color: #5bc0de; } .status-diproses { background-color: #0275d8; } .status-selesai { background-color: #5cb85c; } + .status-ditolak { background-color: #d9534f; } .footer { margin-top: 30px; text-align: center; @@ -69,7 +70,17 @@
-

LAYANAN PENGUJIAN AIR #{{ $service->id }}

+

LAYANAN PENGUJIAN AIR #{{ $service->id }} + @if($service->status == 'Ditolak') + (DITOLAK) + @elseif($service->status == 'Selesai') + (SELESAI) + @elseif($service->status == 'Diproses') + (DIPROSES) + @elseif($service->status == 'Diterima') + (DITERIMA) + @endif +

Dicetak pada: {{ date('d-m-Y H:i:s') }}

@@ -108,6 +119,14 @@ {{ $service->status }} + @if($service->keterangan && ($service->status == 'Diterima' || $service->status == 'Ditolak')) + + Keterangan Status + + {{ $service->keterangan }} + + + @endif Jenis Permintaan {{ $service->jenis_permintaan }} @@ -147,6 +166,8 @@ @if($service->tanggal_selesai_uji) {{ \Carbon\Carbon::parse($service->tanggal_selesai_uji)->format('d F Y') }} + @elseif($service->status == 'Ditolak') + Ditolak @else Menunggu @endif @@ -163,6 +184,8 @@ @if($service->biaya_retribusi_parameter) Rp {{ number_format($service->biaya_retribusi_parameter, 0, ',', '.') }} + @elseif($service->status == 'Ditolak') + Ditolak @else Menunggu @endif @@ -173,6 +196,8 @@ @if($service->biaya_retribusi_jarak) Rp {{ number_format($service->biaya_retribusi_jarak, 0, ',', '.') }} + @elseif($service->status == 'Ditolak') + Ditolak @else Menunggu @endif @@ -183,6 +208,8 @@ @if($service->biaya_retribusi) Rp {{ number_format($service->biaya_retribusi, 0, ',', '.') }} + @elseif($service->status == 'Ditolak') + Ditolak @else Menunggu @endif @@ -191,6 +218,13 @@
+ @if($service->status == 'Ditolak' && $service->keterangan) +
+

Alasan Penolakan

+

{{ $service->keterangan }}

+
+ @endif + diff --git a/routes/web.php b/routes/web.php index ec8d1e7..a8e035a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -21,22 +21,17 @@ | */ -// Route::get('/', function () { -// if (auth()->check() && auth()->user()->role === 'admin') { -// return redirect()->route('admin.dashboard'); -// } -// return view('Dashboard.dashboard'); -// })->name('dashboard'); + Route::get('/', function () { if (auth()->check()) { if (auth()->user()->role === 'admin') { return redirect()->route('admin.dashboard'); } else { - return redirect()->route('customer.home'); + return redirect('/home'); } } - return view('Dashboard.dashboard'); + return redirect('/login'); })->name('dashboard'); // Rute untuk autentikasi @@ -70,10 +65,14 @@ // Rute untuk fitur-fitur regular Route::middleware(['auth'])->group(function () { Route::resource('complaints', ComplaintController::class); + Route::get('complaints/{complaint}/pdf', [ComplaintController::class, 'pdf'])->name('complaints.pdf'); + Route::get('complaints-pdf', [ComplaintController::class, 'allPdf'])->name('complaints.all-pdf')->middleware('admin'); Route::resource('services', ServiceController::class); Route::get('services/{service}/pdf', [ServiceController::class, 'generatePdf'])->name('services.pdf'); Route::get('services-pdf', [ServiceController::class, 'generateAllPdf'])->name('services.all-pdf')->middleware('admin'); Route::resource('satisfactions', SatisfactionController::class); + Route::get('satisfactions/{satisfaction}/pdf', [SatisfactionController::class, 'pdf'])->name('satisfactions.pdf'); + Route::get('satisfactions-pdf', [SatisfactionController::class, 'allPdf'])->name('satisfactions.all-pdf')->middleware('admin'); Route::get('satisfaction-dashboard', [SatisfactionController::class, 'dashboard'])->name('satisfactions.dashboard')->middleware('admin'); Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');