diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 3331a7e..4b1264a 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -40,7 +40,7 @@ public function login(Request $request) // Redirect berdasarkan role if ($user->role_user === 'admin') { // ✅ Lebih baik pakai route name daripada hardcoded URL - return redirect()->route('admin.dashboard'); + return redirect()->route('admin.welcome'); // Jika admin di project terpisah, gunakan: // return redirect('http://127.0.0.1:8001/admin'); } @@ -89,11 +89,17 @@ public function updatePassword(Request $request) // Logout public function logout(Request $request) { - Auth::logout(); + $role = Auth::user()->role_user; // ← cek role sebelum logout + Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); - return redirect()->route('welcome'); // Redirect ke halaman utama setelah logout + // Redirect berdasarkan role + if ($role === 'admin') { + return redirect()->route('login'); // ← admin ke login + } + + return redirect()->route('welcome'); // ← pengguna ke welcome } } \ No newline at end of file diff --git a/app/Models/Notifikasi.php b/app/Models/Notifikasi.php index 2a2cf00..155e0cc 100644 --- a/app/Models/Notifikasi.php +++ b/app/Models/Notifikasi.php @@ -1,10 +1,23 @@ @@ -747,7 +747,7 @@ class="nav-item {{ request()->routeIs('halaman_chatbot') ? 'active' : '' }}"> -
+ - + diff --git a/resources/views/admin/edit_user.blade.php b/resources/views/admin/edit_user.blade.php index 5f54728..0d03918 100644 --- a/resources/views/admin/edit_user.blade.php +++ b/resources/views/admin/edit_user.blade.php @@ -553,40 +553,41 @@
PT. Carani Bhanu Balakosa
- diff --git a/resources/views/admin/halaman_chatbot.blade.php b/resources/views/admin/halaman_chatbot.blade.php index 87a67d3..aecb98d 100644 --- a/resources/views/admin/halaman_chatbot.blade.php +++ b/resources/views/admin/halaman_chatbot.blade.php @@ -845,40 +845,40 @@ diff --git a/resources/views/admin/halaman_verifikasi.blade.php b/resources/views/admin/halaman_verifikasi.blade.php index b04c9ed..1233030 100644 --- a/resources/views/admin/halaman_verifikasi.blade.php +++ b/resources/views/admin/halaman_verifikasi.blade.php @@ -719,40 +719,40 @@ diff --git a/resources/views/admin/tambah-datauser.blade.php b/resources/views/admin/tambah-datauser.blade.php index 83497a1..7431072 100644 --- a/resources/views/admin/tambah-datauser.blade.php +++ b/resources/views/admin/tambah-datauser.blade.php @@ -549,40 +549,40 @@ @@ -617,7 +617,7 @@ class="nav-item {{ request()->routeIs('halaman_chatbot') ? 'active' : '' }}">

Isi data user baru dengan lengkap dan valid

- + @csrf

diff --git a/resources/views/admin/tambah-rumah.blade.php b/resources/views/admin/tambah-rumah.blade.php index 3696f9a..adee1c7 100644 --- a/resources/views/admin/tambah-rumah.blade.php +++ b/resources/views/admin/tambah-rumah.blade.php @@ -580,40 +580,40 @@

diff --git a/resources/views/admin/verifikasi_dokumen.blade.php b/resources/views/admin/verifikasi_dokumen.blade.php index 5cf84dc..8f752d0 100644 --- a/resources/views/admin/verifikasi_dokumen.blade.php +++ b/resources/views/admin/verifikasi_dokumen.blade.php @@ -859,40 +859,40 @@ diff --git a/resources/views/admin/welcome.blade.php b/resources/views/admin/welcome.blade.php index af14573..b15ac9e 100644 --- a/resources/views/admin/welcome.blade.php +++ b/resources/views/admin/welcome.blade.php @@ -156,6 +156,7 @@ margin-top: auto; white-space: nowrap; overflow: hidden; + color: #ffff; } .logout-btn:hover { @@ -571,40 +572,43 @@
diff --git a/resources/views/detail-katalog.blade.php b/resources/views/detail-katalog.blade.php index 0940c44..42127a8 100644 --- a/resources/views/detail-katalog.blade.php +++ b/resources/views/detail-katalog.blade.php @@ -1567,6 +1567,18 @@ class="action-btn btn-contact">Login function toggleMenu(){ document.getElementById('navMenu').classList.toggle('show'); } + + // PROFILE DROPDOWN + function toggleDropdown() { + document.getElementById('dropdownMenu').classList.toggle('show'); + } + + // Tutup dropdown kalau klik di luar + window.addEventListener('click', function(e) { + if (!e.target.closest('.profile-dropdown')) { + document.getElementById('dropdownMenu').classList.remove('show'); + } + }); diff --git a/resources/views/halaman-chatbot.blade.php b/resources/views/halaman-chatbot.blade.php index 85519e0..0812f86 100644 --- a/resources/views/halaman-chatbot.blade.php +++ b/resources/views/halaman-chatbot.blade.php @@ -168,6 +168,61 @@ .menu-toggle:hover{ background: rgba(255,255,255,0.15); } + + .profile-dropdown { + position: relative; + cursor: pointer; + } + + .profile-icon { + display: flex; + align-items: center; + gap: 8px; + } + + .dropdown-menu { + display: none; + position: absolute; + right: 0; + top: 100%; + background: white; + border: 1px solid #ddd; + border-radius: 8px; + min-width: 180px; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); + z-index: 999; + } + + .dropdown-menu a, + .dropdown-menu button { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 16px; + color: #333; + text-decoration: none; + width: 100%; + background: none; + border: none; + cursor: pointer; + font-size: 14px; + } + + .dropdown-menu a:hover, + .dropdown-menu button:hover { + background: #f5f5f5; + } + + .dropdown-menu hr { + margin: 4px 0; + border: none; + border-top: 1px solid #eee; + } + + /* Tampilkan dropdown */ + .dropdown-menu.show { + display: block; + } /* Chat Container */ .chat-container { diff --git a/resources/views/halaman-katalog.blade.php b/resources/views/halaman-katalog.blade.php index defd6f2..5311dfb 100644 --- a/resources/views/halaman-katalog.blade.php +++ b/resources/views/halaman-katalog.blade.php @@ -1229,5 +1229,7 @@ function toggleDropdown() { }); }); + + \ No newline at end of file diff --git a/resources/views/halaman-notifikasi.blade.php b/resources/views/halaman-notifikasi.blade.php index 1c4ae29..e270e85 100644 --- a/resources/views/halaman-notifikasi.blade.php +++ b/resources/views/halaman-notifikasi.blade.php @@ -165,10 +165,66 @@ .menu-toggle:hover{ background: rgba(255,255,255,0.15); } + + /* PROFILE DROPDOWN */ + .profile-dropdown { + position: relative; + cursor: pointer; + } + + .profile-icon { + display: flex; + align-items: center; + gap: 8px; + } + + .dropdown-menu { + display: none; + position: absolute; + right: 0; + top: 100%; + background: white; + border: 1px solid #ddd; + border-radius: 8px; + min-width: 180px; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); + z-index: 999; + } + + .dropdown-menu a, + .dropdown-menu button { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 16px; + color: #333; + text-decoration: none; + width: 100%; + background: none; + border: none; + cursor: pointer; + font-size: 14px; + } + + .dropdown-menu a:hover, + .dropdown-menu button:hover { + background: #f5f5f5; + } + + .dropdown-menu hr { + margin: 4px 0; + border: none; + border-top: 1px solid #eee; + } + + /* Tampilkan dropdown */ + .dropdown-menu.show { + display: block; + } /* Main Content */ .main-content { - margin: 80px auto 30px; + margin: 100px auto 30px; max-width: 600px; padding: 0 20px; } @@ -356,11 +412,6 @@ font-size: 1rem; } - .nav-menu { - display: none; - margin-bottom: 20px; - } - .user-actions { margin-left: auto; /* ← dorong ke kanan */ display: flex; @@ -422,7 +473,6 @@ -
@@ -453,17 +503,19 @@ class="nav-item {{ request()->routeIs('halaman-katalog') ? 'active' : '' }}"> class="nav-item {{ request()->routeIs('halaman-chatbot') ? 'active' : '' }}"> ChatBot - + @auth + Riwayat Pemesanan + @endauth + class="nav-item {{ request()->routeIs('kontak') ? 'active' : '' }}"> Kontak