propil wuser
This commit is contained in:
parent
49f900cfa9
commit
a46f042ea3
|
@ -6,18 +6,12 @@
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
use App\Models\Kriteria;
|
||||
use App\Models\Alternatif;
|
||||
use App\Models\Role;
|
||||
use App\Models\Makanan;
|
||||
use App\Models\Rekomendasi;
|
||||
use App\Http\Requests\UserRequest;
|
||||
use App\Http\Requests\KriteriaRequest;
|
||||
use App\Http\Requests\AlternatifRequest;
|
||||
use App\Http\Requests\RoleRequest;
|
||||
use App\Http\Requests\UpdateUserRequest;
|
||||
use App\Http\Requests\UpdateKriteriaRequest;
|
||||
use App\Http\Requests\UpdateAlternatifRequest;
|
||||
use App\Http\Requests\UpdateRoleRequest;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
use App\Http\Requests\UpdateUserRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
// Tampilkan profil admin
|
||||
public function adminprofile()
|
||||
{
|
||||
$user = Auth::user()->load('role');
|
||||
return view('admin.profile', compact('user'));
|
||||
}
|
||||
|
||||
// Update profil (nama, email, no_telp, password jika diisi)
|
||||
public function update(UpdateUserRequest $request)
|
||||
{
|
||||
$data = $request->validated();
|
||||
|
||||
// Jika password tidak diisi, hapus dari array
|
||||
if (empty($data['password'])) {
|
||||
unset($data['password']);
|
||||
}
|
||||
|
||||
Auth::user()->update($data);
|
||||
|
||||
return back()->with('success', 'Profil berhasil diperbarui tanpa hash password!');
|
||||
}
|
||||
|
||||
// Ganti password secara langsung tanpa hash
|
||||
public function password(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'current_password' => ['required'],
|
||||
'password' => ['required', 'min:6', 'confirmed'],
|
||||
]);
|
||||
|
||||
// Verifikasi password lama (plain comparison, bukan hash)
|
||||
if ($request->current_password !== Auth::user()->password) {
|
||||
return back()->withErrors(['current_password' => 'Password lama salah.']);
|
||||
}
|
||||
|
||||
// Simpan password baru langsung tanpa hash
|
||||
Auth::user()->update([
|
||||
'password' => $request->password,
|
||||
]);
|
||||
|
||||
return back()->with('success', 'Password berhasil diubah tanpa hash!');
|
||||
}
|
||||
|
||||
|
||||
public function userprofile()
|
||||
{
|
||||
$user = Auth::user();
|
||||
return view('user.profileuser', compact('user'));
|
||||
}
|
||||
|
||||
// Update data profil (termasuk password tanpa hash)
|
||||
public function userupdate(ProfileRequest $request)
|
||||
{
|
||||
$data = $request->validated(); // sudah berisi role_id = 2
|
||||
// jika password kosong, hapus
|
||||
if (empty($data['password'])) unset($data['password']);
|
||||
|
||||
Auth::user()->update($data);
|
||||
|
||||
return back()->with('success', 'Profile updated!');
|
||||
}
|
||||
|
||||
|
||||
// Update password terpisah tanpa hash, dan validasi password lama juga tanpa hash
|
||||
public function userpassword(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
$request->validate([
|
||||
'current_password' => ['required'],
|
||||
'password' => ['required', 'string', 'min:6', 'confirmed'],
|
||||
]);
|
||||
|
||||
// Cek password lama sesuai input tanpa hash
|
||||
if ($request->current_password !== $user->password) {
|
||||
return back()->withErrors(['current_password' => 'Current password is incorrect']);
|
||||
}
|
||||
|
||||
// Simpan password baru tanpa hash
|
||||
$user->password = $request->password;
|
||||
$user->save();
|
||||
|
||||
return redirect()->route('user.profile')->with('success', 'Password updated successfully.');
|
||||
}
|
||||
}
|
|
@ -15,36 +15,42 @@ class RekomendasiController extends Controller
|
|||
{
|
||||
//
|
||||
public function hitungDanSimpan()
|
||||
{
|
||||
$alternatifs = Makanan::all();
|
||||
$kriterias = Kriteria::all();
|
||||
$bobotKriterias = BobotKriteria::pluck('bobot', 'kriteria_id');
|
||||
{
|
||||
$idAlternatif = session('alternatifs_dipilih');
|
||||
|
||||
foreach ($alternatifs as $alternatif) {
|
||||
$nilaiAkhir = 0;
|
||||
if (!$idAlternatif || count($idAlternatif) < 2) {
|
||||
return redirect()->route('alternatif.pilih')->with('error', 'Alternatif belum dipilih atau kurang dari dua.');
|
||||
}
|
||||
|
||||
foreach ($kriterias as $kriteria) {
|
||||
$bobotKriteria = $bobotKriterias[$kriteria->id] ?? 0;
|
||||
$bobotAlternatif = SkorMakanan::where('kriteria_id', $kriteria->id)
|
||||
->where('makanan_id', $alternatif->id)
|
||||
->value('nilai') ?? 0;
|
||||
$alternatifs = Makanan::whereIn('id', $idAlternatif)->get();
|
||||
$kriterias = Kriteria::all();
|
||||
$bobotKriterias = BobotKriteria::pluck('bobot', 'kriteria_id');
|
||||
|
||||
$nilaiAkhir += $bobotKriteria * $bobotAlternatif;
|
||||
}
|
||||
foreach ($alternatifs as $alternatif) {
|
||||
$nilaiAkhir = 0;
|
||||
|
||||
// Simpan ke tabel rekomendasi
|
||||
Rekomendasi::updateOrCreate(
|
||||
['makanan_id' => $alternatif->id, 'user_id' => Auth::id()],
|
||||
[
|
||||
'nilai_akhir' => $nilaiAkhir,
|
||||
'tanggal_rekomendasi' => Carbon::now()->toDateString()
|
||||
]
|
||||
);
|
||||
foreach ($kriterias as $kriteria) {
|
||||
$bobotKriteria = $bobotKriterias[$kriteria->id] ?? 0;
|
||||
$bobotAlternatif = SkorMakanan::where('kriteria_id', $kriteria->id)
|
||||
->where('makanan_id', $alternatif->id)
|
||||
->value('nilai') ?? 0;
|
||||
|
||||
$nilaiAkhir += $bobotKriteria * $bobotAlternatif;
|
||||
}
|
||||
|
||||
return redirect()->route('rekomendasi.hasil')->with('success', 'Rekomendasi berhasil dihitung dan disimpan.');
|
||||
Rekomendasi::updateOrCreate(
|
||||
['makanan_id' => $alternatif->id, 'user_id' => Auth::id()],
|
||||
[
|
||||
'nilai_akhir' => $nilaiAkhir,
|
||||
'tanggal_rekomendasi' => now()->toDateString()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return redirect()->route('rekomendasi.hasil')->with('success', 'Rekomendasi berhasil dihitung dan disimpan.');
|
||||
}
|
||||
|
||||
|
||||
// 2. Tampilkan hasil rekomendasi
|
||||
public function tampil()
|
||||
{
|
||||
|
@ -54,7 +60,13 @@ public function tampil()
|
|||
->orderByDesc('nilai_akhir')
|
||||
->get();
|
||||
|
||||
return view('admin.rekomendasi', compact('rekomendasi'));
|
||||
|
||||
$tanggalList = Rekomendasi::select('tanggal_rekomendasi')
|
||||
->distinct()
|
||||
->orderBy('tanggal_rekomendasi', 'desc')
|
||||
->pluck('tanggal_rekomendasi');
|
||||
|
||||
return view('admin.rekomendasi', compact('rekomendasi', 'tanggalList'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,11 +90,20 @@ public function kirimKeUser($userId)
|
|||
return redirect()->back()->with('success', 'Hasil rekomendasi berhasil dikirim ke user.');
|
||||
}
|
||||
|
||||
public function hapusSemua()
|
||||
public function hapusSemua(Request $request)
|
||||
{
|
||||
Rekomendasi::truncate(); // Menghapus semua data
|
||||
return redirect()->back()->with('success', 'Semua data rekomendasi berhasil dihapus.');
|
||||
$tanggal = $request->input('tanggal_rekomendasi');
|
||||
|
||||
if (!$tanggal) {
|
||||
return redirect()->back()->with('error', 'Tanggal rekomendasi harus dipilih.');
|
||||
}
|
||||
|
||||
// Hapus data berdasarkan tanggal_rekomendasi
|
||||
Rekomendasi::where('tanggal_rekomendasi', $tanggal)->delete();
|
||||
|
||||
return redirect()->back()->with('success', 'Data rekomendasi untuk tanggal ' . $tanggal . ' berhasil dihapus.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public function userdata(Request $request)
|
|||
// Menentukan jumlah data per halaman
|
||||
$perPage = $request->per_page === 'all'
|
||||
? $makananQuery->count() // tampilkan semua jika 'all'
|
||||
: ($request->per_page ?? 25); // default 25
|
||||
: ($request->per_page ?? 10); // default 25
|
||||
|
||||
// Ambil data dengan paginasi dan simpan parameter pencarian/filter
|
||||
$makanans = $makananQuery->paginate($perPage)->appends($request->except('page'));
|
||||
|
@ -69,20 +69,32 @@ public function userdata(Request $request)
|
|||
|
||||
|
||||
|
||||
public function userresult()
|
||||
public function userresult(Request $request)
|
||||
{
|
||||
$tanggal = $request->input('tanggal');
|
||||
|
||||
$rekomendasi = Rekomendasi::with('makanan')
|
||||
->when($tanggal, function ($query) use ($tanggal) {
|
||||
$query->whereDate('tanggal_rekomendasi', $tanggal);
|
||||
})
|
||||
->where('nilai_akhir', '>', 0)
|
||||
->orderByDesc('nilai_akhir')
|
||||
->get();
|
||||
|
||||
// Hitung total nilai akhir
|
||||
$totalNilaiAkhir = $rekomendasi->sum('nilai_akhir');
|
||||
|
||||
return view('user.userresult', compact('rekomendasi', 'totalNilaiAkhir'));
|
||||
// Ambil daftar tanggal unik dari database
|
||||
$listTanggal = Rekomendasi::select('tanggal_rekomendasi')
|
||||
->distinct()
|
||||
->orderBy('tanggal_rekomendasi', 'desc')
|
||||
->pluck('tanggal_rekomendasi');
|
||||
|
||||
return view('user.userresult', compact('rekomendasi', 'totalNilaiAkhir', 'tanggal', 'listTanggal'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
// ambil data berdasarkan $id atau bisa juga switch/case
|
||||
|
@ -90,4 +102,11 @@ public function show($id)
|
|||
}
|
||||
|
||||
|
||||
public function register()
|
||||
{
|
||||
// ambil data berdasarkan $id atau bisa juga switch/case
|
||||
return view('user.userregister', compact('id'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ProfileRequest extends FormRequest
|
||||
{
|
||||
/** Selalu izinkan (atau sesuaikan logic Anda) */
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inject role_id = 2 ke dalam request sebelum validasi.
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'role_id' => 2, // 2 = role "user"
|
||||
]);
|
||||
}
|
||||
|
||||
/** Aturan validasi */
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'email' => 'required|email|unique:users,email,' . Auth::id(),
|
||||
'no_telp' => 'required|string|max:20',
|
||||
'password' => 'nullable|string|min:6',
|
||||
'role_id' => 'in:2', // pastikan nilai akhirnya memang 2
|
||||
];
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
|
@ -23,7 +24,7 @@ public function rules(): array
|
|||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'email' => 'required|email|unique:users,email,' . $this->route('user')->id, // Ensure the user ID is passed correctly
|
||||
'email' => 'required|email|unique:users,email,' . Auth::id(), // Ensure the user ID is passed correctly
|
||||
'no_telp' => 'required|string|max:20',
|
||||
'password' => 'nullable|string|min:6', // Password is optional, only validated if present
|
||||
'role_id' => 'required|exists:roles,id', // Ensures 'role_id' exists in the 'roles' table
|
||||
|
|
|
@ -228,7 +228,7 @@
|
|||
|
||||
|
||||
<!-- Recent Sales -->
|
||||
{{-- <div class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="card recent-sales overflow-auto">
|
||||
|
||||
<div class="filter">
|
||||
|
@ -299,7 +299,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- End Recent Sales --> --}}
|
||||
</div><!-- End Recent Sales -->
|
||||
</div>
|
||||
</div><!-- End Left side columns -->
|
||||
|
||||
|
|
|
@ -0,0 +1,160 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('content')
|
||||
<div class="pagetitle">
|
||||
<h1>Profile</h1>
|
||||
<nav>
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('admindash') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('admin.profile') }}">Profile</a></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<section class="section profile">
|
||||
<div class="row">
|
||||
<!-- Kartu info ringkas -->
|
||||
<div class="col-xl-4">
|
||||
<div class="card">
|
||||
<div class="card-body pt-4 text-center">
|
||||
<h2>{{ $user->name }}</h2>
|
||||
<h5 class="text-muted mb-0">{{ $user->role->name ?? '-' }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabs -->
|
||||
<div class="col-xl-8">
|
||||
<div class="card">
|
||||
<div class="card-body pt-3">
|
||||
<ul class="nav nav-tabs nav-tabs-bordered">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" data-bs-toggle="tab"
|
||||
data-bs-target="#tab-overview">Overview</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab"
|
||||
data-bs-target="#tab-edit">Edit Profile</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab"
|
||||
data-bs-target="#tab-password">Change Password</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content pt-2">
|
||||
|
||||
<!-- ========= Overview ========= -->
|
||||
<div class="tab-pane fade show active profile-overview" id="tab-overview">
|
||||
<h5 class="card-title">Profile Details</h5>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-3 col-md-4 label">Name</div>
|
||||
<div class="col-lg-9 col-md-8">{{ $user->name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-3 col-md-4 label">Email</div>
|
||||
<div class="col-lg-9 col-md-8">{{ $user->email }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-3 col-md-4 label">Phone</div>
|
||||
<div class="col-lg-9 col-md-8">{{ $user->no_telp }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-3 col-md-4 label">Role</div>
|
||||
<div class="col-lg-9 col-md-8">{{ $user->role->name ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ========= Edit profile ===== -->
|
||||
<div class="tab-pane fade profile-edit pt-3" id="tab-edit">
|
||||
<form action="{{ route('profile.update') }}" method="POST">
|
||||
@csrf @method('PATCH')
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Name</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="name" type="text" class="form-control"
|
||||
value="{{ old('name', $user->name) }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Email</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="email" type="email" class="form-control"
|
||||
value="{{ old('email', $user->email) }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Phone</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="no_telp" type="phone" class="form-control"
|
||||
value="{{ old('no_telp', $user->no_telp) }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Role</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<select name="role_id" class="form-control" required>
|
||||
@foreach (\App\Models\Role::all() as $role)
|
||||
<option value="{{ $role->id }}" {{ $user->role_id == $role->id ? 'selected' : '' }}>
|
||||
{{ $role->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- ======== Change password ==== -->
|
||||
<div class="tab-pane fade pt-3" id="tab-password">
|
||||
<form action="{{ route('profile.password') }}" method="POST">
|
||||
@csrf @method('PUT')
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Current Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="current_password" type="password" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">New Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="password" type="password" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-4 col-lg-3 col-form-label">Confirm Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="password_confirmation" type="password" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Change Password</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div><!-- tab-content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
|
@ -11,10 +11,89 @@
|
|||
</nav>
|
||||
</div><!-- End Page Title -->
|
||||
|
||||
<div class="card shadow-lg border-start border-4 border-primary mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title text-primary fw-bold mb-0 d-flex justify-content-between align-items-center">
|
||||
📌 Aturan Penilaian <span class="text-muted">| AHP</span>
|
||||
<button class="btn btn-sm btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAHP" aria-expanded="false" aria-controls="collapseAHP">
|
||||
Lihat Detail
|
||||
</button>
|
||||
</h5>
|
||||
|
||||
<div class="collapse mt-3" id="collapseAHP">
|
||||
<p class="fs-6">Sebelum melakukan perbandingan, pahami skala penilaian berikut. Skala ini digunakan untuk menilai tingkat kepentingan antar kriteria maupun alternatif.</p>
|
||||
|
||||
<div class="row row-cols-1 row-cols-md-2 g-3 mt-2">
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-success rounded-pill me-3">1</span>
|
||||
<div>
|
||||
<strong>Equal Importance</strong><br>
|
||||
Kedua elemen sama pentingnya
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-primary rounded-pill me-3">3</span>
|
||||
<div>
|
||||
<strong>Moderate Importance</strong><br>
|
||||
Salah satu elemen sedikit lebih penting
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-warning text-dark rounded-pill me-3">5</span>
|
||||
<div>
|
||||
<strong>Strong Importance</strong><br>
|
||||
Salah satu elemen lebih penting secara kuat
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-danger rounded-pill me-3">7</span>
|
||||
<div>
|
||||
<strong>Very Strong Importance</strong><br>
|
||||
Salah satu elemen sangat penting
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-dark rounded-pill me-3">9</span>
|
||||
<div>
|
||||
<strong>Extreme Importance</strong><br>
|
||||
Salah satu elemen mutlak lebih penting
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-start">
|
||||
<span class="badge bg-secondary rounded-pill me-3">2, 4, 6, 8</span>
|
||||
<div>
|
||||
<strong>Intermediate Values</strong><br>
|
||||
Nilai antara dua pertimbangan yang berdekatan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
|
||||
|
||||
<!-- Form input -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
|
|
@ -56,12 +56,20 @@
|
|||
</div>
|
||||
|
||||
<div class="mt-3 text-end">
|
||||
<form action="{{ route('rekomendasi.hapusSemua') }}" method="POST" onsubmit="return confirm('Yakin ingin menghapus semua data rekomendasi?')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">🗑️ Hapus Semua Rekomendasi</button>
|
||||
</form>
|
||||
</div>
|
||||
<form action="{{ route('rekomendasi.hapusSemua') }}" method="POST" class="mb-4">
|
||||
@csrf
|
||||
<label for="tanggal_rekomendasi">Pilih Tanggal Rekomendasi:</label>
|
||||
<select name="tanggal_rekomendasi" required>
|
||||
<option value="">-- Pilih Tanggal --</option>
|
||||
@foreach ($tanggalList as $tgl)
|
||||
<option value="{{ $tgl }}">{{ \Carbon\Carbon::parse($tgl)->format('d M Y') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button type="submit" class="btn btn-danger">Hapus Data</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-end mt-4">
|
||||
<a href="{{ route('alternatif.pilih') }}" class="btn btn-outline-secondary">🔙 Kembali ke Pemilihan Alternatif</a>
|
||||
|
|
|
@ -25,12 +25,18 @@
|
|||
<li class="dropdown-header text-center">
|
||||
{{-- <img src="{{ asset('assetss/img/profile-default.png') }}" alt="Profile" class="rounded-circle mb-2" width="60" height="60"> --}}
|
||||
<h6 class="mb-0">{{ Auth::user()->name }}</h6>
|
||||
<span class="text-muted">{{ Auth::user()->role->name ?? 'User' }}</span><br>
|
||||
{{-- <span class="text-muted">{{ Auth::user()->role->name ?? 'User' }}</span><br> --}}
|
||||
<small class="text-muted">{{ Auth::user()->email }}</small>
|
||||
</li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item d-flex align-items-center" href="{{ route('admin.profile') }}">
|
||||
<i class="bi bi-person"></i><span>My Profile</span>
|
||||
</a>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<form id="logoutForm" method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<a class="nav-link dropdown-toggle d-flex justify-content justify-content-lg-start align-items-center" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="ps-2 fw-semibold text-dark">{{ Auth::user()->name }}</span>
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-end shadow-sm" aria-labelledby="navbarDropdown">
|
||||
<li class="dropdown-header text-center">
|
||||
<h6 class="mb-0">{{ Auth::user()->name }}</h6>
|
||||
|
@ -27,6 +28,11 @@
|
|||
<small class="text-muted">{{ Auth::user()->email }}</small>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<a class="dropdown-item d-flex align-items-center" href="{{ route('user.profile') }}">
|
||||
<i class="bi bi-person"></i><span>My Profile</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<form id="logoutForm" method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
@extends('layoutuser.app')
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
/* Optional: background animation */
|
||||
body {
|
||||
background: linear-gradient(135deg, #e3f2fd, #ffffff);
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="py-5" style="background: linear-gradient(135deg, #e3f2fd, #ffffff); min-height: 100vh;">
|
||||
<div class="container py-5">
|
||||
|
||||
{{-- Flash & error messages --}}
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
{{ session('success') }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<ul class="mb-0">
|
||||
@foreach ($errors->all() as $e)
|
||||
<li>{{ $e }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<h2 class="fw-bold mb-4">👤 My Profile</h2>
|
||||
|
||||
<div class="row g-4">
|
||||
{{-- Sidebar Profile --}}
|
||||
<div class="col-lg-4">
|
||||
<div class="card border-0 shadow-sm text-center p-4 rounded-4">
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="rounded-circle bg-white shadow p-4" style="width: 100px; height: 100px; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="bi bi-person-fill text-primary fs-1"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="fw-semibold mb-1">{{ $user->name }}</h5>
|
||||
<p class="text-muted mb-2">{{ $user->email }}</p>
|
||||
<span class="badge rounded-pill bg-primary">
|
||||
<i class="bi bi-award me-1"></i> {{ ucfirst($user->role->name ?? 'user') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Profile Content --}}
|
||||
<div class="col-lg-8">
|
||||
<div class="card border-0 shadow-sm rounded-4">
|
||||
<div class="card-body">
|
||||
|
||||
<ul class="nav nav-tabs nav-justified mb-4" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#tab-details" role="tab">
|
||||
<i class="bi bi-person-lines-fill me-1"></i> Details
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#tab-edit" role="tab">
|
||||
<i class="bi bi-pencil-square me-1"></i> Edit Profile
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#tab-password" role="tab">
|
||||
<i class="bi bi-lock-fill me-1"></i> Change Password
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{-- DETAILS TAB --}}
|
||||
<div class="tab-pane fade show active" id="tab-details" role="tabpanel">
|
||||
<h5 class="fw-semibold mb-3">👁️ Profile Overview</h5>
|
||||
<div class="mb-2"><strong>Name:</strong> {{ $user->name }}</div>
|
||||
<div class="mb-2"><strong>Email:</strong> {{ $user->email }}</div>
|
||||
<div class="mb-2"><strong>Phone:</strong> {{ $user->no_telp }}</div>
|
||||
</div>
|
||||
|
||||
{{-- EDIT PROFILE TAB --}}
|
||||
<div class="tab-pane fade" id="tab-edit" role="tabpanel">
|
||||
<h5 class="fw-semibold mb-3">✏️ Update Profile</h5>
|
||||
<form action="{{ route('user.update') }}" method="POST">
|
||||
@csrf @method('PATCH')
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input name="name" type="text" class="form-control"
|
||||
value="{{ old('name', $user->name) }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Email</label>
|
||||
<input name="email" type="email" class="form-control"
|
||||
value="{{ old('email', $user->email) }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Phone</label>
|
||||
<input name="no_telp" type="text" class="form-control"
|
||||
value="{{ old('no_telp', $user->no_telp) }}" required>
|
||||
</div>
|
||||
<button class="btn btn-success w-100">💾 Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- CHANGE PASSWORD TAB --}}
|
||||
<div class="tab-pane fade" id="tab-password" role="tabpanel">
|
||||
<h5 class="fw-semibold mb-3">🔒 Change Password</h5>
|
||||
<form action="{{ route('user.password') }}" method="POST">
|
||||
@csrf @method('PATCH')
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Current Password</label>
|
||||
<input name="current_password" type="password" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">New Password</label>
|
||||
<input name="password" type="password" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Confirm New Password</label>
|
||||
<input name="password_confirmation" type="password" class="form-control" required>
|
||||
</div>
|
||||
<button class="btn btn-warning w-100">🔁 Update Password</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -59,6 +59,29 @@
|
|||
</div>
|
||||
</form>
|
||||
|
||||
{{-- <form method="GET" action="{{ route('userdata') }}" class="row g-3 align-items-end mb-4">
|
||||
<div class="col-md-5">
|
||||
<label for="jenis_id" class="form-label fw-semibold"></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-primary text-white"><i class="fas fa-utensils"></i></span>
|
||||
<select class="form-select" id="jenis_id" name="jenis_id">
|
||||
<option value="">Semua</option>
|
||||
@foreach ($jenisMakananList as $jenis)
|
||||
<option value="{{ $jenis->id }}" {{ request('jenis_id') == $jenis->id ? 'selected' : '' }}>
|
||||
{{ ucfirst($jenis->name) }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 d-grid">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fas fa-filter me-1"></i> Terapkan
|
||||
</button>
|
||||
</div>
|
||||
</form> --}}
|
||||
|
||||
<!-- Filter Per Page + Search -->
|
||||
<form method="GET" action="{{ route('userdata') }}" class="row g-3 align-items-end mb-4">
|
||||
<!-- Kirim parameter filter yang aktif -->
|
||||
|
@ -86,8 +109,8 @@
|
|||
<span class="input-group-text bg-primary text-white"><i class="fas fa-list-ol"></i></span>
|
||||
<select class="form-select" name="per_page" id="per_page" onchange="this.form.submit()">
|
||||
@php
|
||||
$perPageOptions = [25, 50, 100, 'all'];
|
||||
$currentPerPage = request('per_page', 25);
|
||||
$perPageOptions = [10, 25, 50, 100, 'all'];
|
||||
$currentPerPage = request('per_page', 10);
|
||||
@endphp
|
||||
@foreach($perPageOptions as $option)
|
||||
<option value="{{ $option }}" {{ $currentPerPage == $option ? 'selected' : '' }}>
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
|
||||
<title>Register</title>
|
||||
<meta content="" name="description">
|
||||
<meta content="" name="keywords">
|
||||
|
||||
<!-- Favicons -->
|
||||
<link href="{{ asset('logo/baru/dutdut.png') }}" rel="icon">
|
||||
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect">
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
|
||||
|
||||
<!-- Vendor CSS Files -->
|
||||
<link href="{{ asset('assets/vendor/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('assets/vendor/bootstrap-icons/bootstrap-icons.css') }}" rel="stylesheet">
|
||||
|
||||
<!-- Template Main CSS File -->
|
||||
<link href="{{ asset('assets/css/style.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Nunito', sans-serif;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.register-container {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.register-card {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.register-card .card-body {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.register-card h5 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
.register-card p {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Responsive design for smaller screens */
|
||||
@media (max-width: 768px) {
|
||||
.register-card .card-body {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.register-card h5 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.register-card {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.register-card h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.register-card p {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.register-card .card-body {
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<main>
|
||||
<div class="container">
|
||||
|
||||
<section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
|
||||
<div class="row justify-content-center w-100">
|
||||
<div class="col-12 col-md-8 col-lg-6 d-flex flex-column align-items-center justify-content-center">
|
||||
|
||||
<div class="card mb-3 register-card">
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="pt-4 pb-2">
|
||||
<h5 class="card-title text-center pb-0 fs-4">Create an Account</h5>
|
||||
<p class="text-center small">Enter your personal details to create an account</p>
|
||||
</div>
|
||||
|
||||
<form class="row g-3 needs-validation" action="{{ route('register.post') }}" method="POST" novalidate>
|
||||
@csrf
|
||||
<div class="col-12">
|
||||
<label for="yourName" class="form-label">Your Name</label>
|
||||
<input type="text" name="name" class="form-control" id="yourName" required>
|
||||
<div class="invalid-feedback">Please, enter your name!</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="yourEmail" class="form-label">Your Email</label>
|
||||
<input type="email" name="email" class="form-control" id="yourEmail" required>
|
||||
<div class="invalid-feedback">Please enter a valid Email address!</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="phoneNumber" class="form-label">Phone Number</label>
|
||||
<div class="input-group has-validation">
|
||||
<input type="tel" name="no_telp" class="form-control" id="phoneNumber" required placeholder="08...">
|
||||
<div class="invalid-feedback">Please enter a valid phone number.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="yourPassword" class="form-label">Password</label>
|
||||
<input type="password" name="password" class="form-control" id="yourPassword" required placeholder="input min 6 characters">
|
||||
<div class="invalid-feedback">Please enter your password!</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="yourPasswordConfirmation" class="form-label">Confirm Password</label>
|
||||
<input type="password" name="password_confirmation" class="form-control" id="yourPasswordConfirmation" required placeholder="Re-enter password">
|
||||
<div class="invalid-feedback">Please confirm your password!</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button class="btn btn-primary w-100" type="submit">Create Account</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<p class="small mb-0">Already have an account? <a href="{{ route('login') }}">Log in</a></p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Back to Top -->
|
||||
<a href="#" class="back-to-top d-flex align-items-center justify-content-center">
|
||||
<i class="bi bi-arrow-up-short"></i>
|
||||
</a>
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="{{ asset('assets/vendor/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<script>
|
||||
// Bootstrap validation script
|
||||
(() => {
|
||||
'use strict'
|
||||
const forms = document.querySelectorAll('.needs-validation')
|
||||
Array.from(forms).forEach(form => {
|
||||
form.addEventListener('submit', event => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -7,6 +7,24 @@
|
|||
<p class="d-inline-block border rounded-pill py-1 px-4 bg-primary text-white">Hasil Rekomendasi AHP</p>
|
||||
<h1 class="mb-3">Rekomendasi Menu Makanan Terbaik untuk Anda</h1>
|
||||
<p class="text-muted">Berikut adalah hasil akhir dari perhitungan berdasarkan metode AHP. Nilai akhir menunjukkan tingkat kesesuaian berdasarkan kriteria yang telah di pilih.</p>
|
||||
|
||||
<form method="GET" action="{{ route('userresult') }}" class="row g-3 mb-4 justify-content-center">
|
||||
<div class="col-md-auto">
|
||||
<select name="tanggal" class="form-select" onchange="this.form.submit()">
|
||||
<option value="">-- Pilih Tanggal Rekomendasi --</option>
|
||||
@foreach ($listTanggal as $tgl)
|
||||
<option value="{{ $tgl }}" {{ request('tanggal') == $tgl ? 'selected' : '' }}>
|
||||
{{ \Carbon\Carbon::parse($tgl)->translatedFormat('d F Y') }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-auto">
|
||||
<a href="{{ route('userresult') }}" class="btn btn-secondary">Reset</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="table-responsive wow fadeInUp" data-wow-delay="0.2s">
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
use App\Http\Controllers\LandingPageController;
|
||||
use App\Http\Controllers\RegisterController;
|
||||
use App\Http\Controllers\RekomendasiController;
|
||||
use App\Http\Controllers\ProfileController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -28,11 +29,17 @@
|
|||
// });
|
||||
|
||||
|
||||
|
||||
// User Routes (Hanya bisa diakses oleh Admin)
|
||||
Route::middleware(['cekrole:admin'])->group(function () {
|
||||
|
||||
Route::get('/admindash', [AdminController::class, 'admindash'])->name('admindash');
|
||||
|
||||
Route::get('/admin/profile', [ProfileController::class, 'adminprofile'])->name('admin.profile');
|
||||
Route::patch('/admin/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||
Route::patch('/admin/password', [ProfileController::class, 'password'])->name('profile.password');
|
||||
|
||||
|
||||
// Routes untuk user
|
||||
Route::get('/datauser', [AdminController::class, 'datauser'])->name('datauser');
|
||||
Route::get('/edituser/{user}/edituser', [AdminController::class, 'edituser'])->name('edituser');
|
||||
Route::put('/datauser/{user}', [AdminController::class, 'updateuser'])->name('updateuser');
|
||||
|
@ -40,6 +47,8 @@
|
|||
Route::get('/tambahuser', [AdminController::class, 'tambahuser'])->name('tambahuser');
|
||||
Route::post('/datauser/storeuser', [AdminController::class, 'storeuser'])->name('storeuser');
|
||||
|
||||
|
||||
// Routes untuk role
|
||||
Route::get('/role', [AdminController::class, 'role'])->name('role');
|
||||
Route::get('/editrole/{role}/editrole', [AdminController::class, 'editrole'])->name('editrole');
|
||||
Route::put('/role/{role}', [AdminController::class, 'updaterole'])->name('updaterole');
|
||||
|
@ -50,6 +59,8 @@
|
|||
|
||||
// Routes untuk kategori, jenis makanan, dan makanan
|
||||
Route::middleware(['cekrole:admin'])->group(function () {
|
||||
|
||||
// Routes untuk kategori
|
||||
Route::get('/kategori', [MakananController::class, 'kategori'])->name('kategori');
|
||||
Route::get('/editkategori/{kategori}/editkategori', [MakananController::class, 'editkategori'])->name('editkategori');
|
||||
Route::put('/kategori/{kategori}', [MakananController::class, 'updatekategori'])->name('updatekategori');
|
||||
|
@ -57,6 +68,8 @@
|
|||
Route::get('/tambahkategori', [MakananController::class, 'tambahkategori'])->name('tambahkategori');
|
||||
Route::post('/kategori/storekategori', [MakananController::class, 'storekategori'])->name('storekategori');
|
||||
|
||||
|
||||
// Routes untuk jenis makanan
|
||||
Route::get('/jenismakanan', [MakananController::class, 'jenismakanan'])->name('jenismakanan');
|
||||
Route::get('/editjenismakanan/{jenis}/editjenismakanan', [MakananController::class, 'editjenismakanan'])->name('editjenismakanan');
|
||||
Route::put('/jenismakanan/{jenis}', [MakananController::class, 'updatejenismakanan'])->name('updatejenismakanan');
|
||||
|
@ -64,6 +77,8 @@
|
|||
Route::get('/tambahjenismakanan', [MakananController::class, 'tambahjenismakanan'])->name('tambahjenismakanan');
|
||||
Route::post('/jenismakanan/storejenismakanan', [MakananController::class, 'storejenismakanan'])->name('storejenismakanan');
|
||||
|
||||
|
||||
// Routes untuk makanan
|
||||
Route::get('/makanan', [MakananController::class, 'makanan'])->name('makanan');
|
||||
Route::get('/editmakanan/{makanan}/editmakanan', [MakananController::class, 'editmakanan'])->name('editmakanan');
|
||||
Route::put('/makanan/{makanan}', [MakananController::class, 'updatemakanan'])->name('updatemakanan');
|
||||
|
@ -72,6 +87,7 @@
|
|||
Route::post('/makanan/storemakanan', [MakananController::class, 'storemakanan'])->name('makanan.storemakanan');
|
||||
});
|
||||
|
||||
// Routes untuk kriteria
|
||||
Route::middleware(['cekrole:admin'])->group(function () {
|
||||
Route::get('/kriteria', [PerbandinganKriteriaController::class, 'kriteria'])->name('kriteria');
|
||||
Route::get('/editkriteria/{kriteria}/editkriteria', [PerbandinganKriteriaController::class, 'editkriteria'])->name('editkriteria');
|
||||
|
@ -83,6 +99,8 @@
|
|||
|
||||
// Routes untuk proses
|
||||
Route::middleware(['cekrole:admin'])->group(function () {
|
||||
|
||||
// Routes untuk perbandingan
|
||||
Route::get('/perbandingan', [ProsesController::class, 'showPerbandingan'])->name('perbandingan');
|
||||
Route::post('/perbandingan/proses', [ProsesController::class, 'prosesSementara'])->name('sementara');
|
||||
Route::post('/simpan-perbandingan', [ProsesController::class, 'simpanPerbandingan'])->name('simpan.perbandingan');
|
||||
|
@ -98,8 +116,7 @@
|
|||
Route::get('/alternatif/normalisasi', [AlternatifController::class, 'tampilNormalisasi'])->name('alternatif.normalisasi');
|
||||
Route::post('/alternatif/simpan-normalisasi', [AlternatifController::class, 'simpanNormalisasi'])->name('alternatif.simpanNormalisasi');
|
||||
|
||||
|
||||
|
||||
// Routes untuk rekomendasi
|
||||
Route::get('/rekomendasi/proses', [RekomendasiController::class, 'hitungDanSimpan'])->name('rekomendasi.proses');
|
||||
Route::get('/rekomendasi/hasil', [RekomendasiController::class, 'tampil'])->name('rekomendasi.hasil');
|
||||
Route::post('/rekomendasi/kirim/{user}', [RekomendasiController::class, 'kirimKeUser'])->name('rekomendasi.kirim');
|
||||
|
@ -108,6 +125,10 @@
|
|||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// User Routes (Hanya bisa diakses oleh User)
|
||||
Route::middleware(['cekrole:user'])->group(function () {
|
||||
Route::get('/userdash', [UserController::class, 'userdash'])->name('userdash');
|
||||
|
@ -117,8 +138,13 @@
|
|||
Route::get('/userdata', [UserController::class, 'userdata'])->name('userdata');
|
||||
Route::get('/userfeatures/{id}', [UserController::class, 'show'])->name('userfeatures.show');
|
||||
Route::get('/user/makanan', [UserController::class, 'userdata'])->name('user.makanan');
|
||||
Route::get('/userregister', [UserController::class, 'userregister'])->name('userregister');
|
||||
|
||||
|
||||
|
||||
Route::get('/user/profile', [ProfileController::class, 'userprofile'])->name('user.profile');
|
||||
Route::patch('/user/profile', [ProfileController::class, 'userupdate'])->name('user.update');
|
||||
Route::patch('/user/password', [ProfileController::class, 'userpassword'])->name('user.password');
|
||||
});
|
||||
|
||||
// Landing Page Routes
|
||||
|
|
Loading…
Reference in New Issue