<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LandingPageController;
use App\Http\Controllers\Student\StudentDashboardController;
use App\Http\Controllers\Student\RecommendationController;
use App\Http\Controllers\Admin\AdminDashboardController;
use App\Http\Controllers\Admin\SiswaController;
use App\Http\Controllers\Admin\JurusanController;
use App\Http\Controllers\Admin\GuruController;
use App\Http\Controllers\Admin\RiwayatController;
use App\Http\Controllers\Admin\AlumniController;
use App\Http\Controllers\Admin\ProspekKerjaController;
use App\Http\Controllers\PanduanController;

Route::get('/', [LandingPageController::class, 'index'])->name('landingpage');
Route::get('/login', function () {
    return view('auth.login');
})->name('login');

Route::get('/panduan', [PanduanController::class, 'showPanduan'])->name('panduan');

Route::prefix('student')->name('student.')->group(function () {
    Route::get('/profile', [StudentDashboardController::class, 'profile'])->name('profile');
    Route::get('/prediction', [RecommendationController::class, 'prediction'])->name('prediction');
    Route::get('/result/{id}', [RecommendationController::class, 'result'])->name('result');
});

Route::prefix('admin')->name('admin.')->group(function () {
    Route::get('/dashboard', [AdminDashboardController::class, 'index'])->name('dashboard');

    Route::resource('siswa', SiswaController::class)->only(['index', 'create', 'edit'])->names(['index' => 'siswa']);
    Route::resource('alumni', AlumniController::class)->only(['index', 'create', 'edit'])->names(['index' => 'alumni']);
    Route::resource('jurusan', JurusanController::class)->only(['index', 'create', 'edit'])->names(['index' => 'jurusan']);
    Route::resource('guru', GuruController::class)->only(['index', 'create', 'edit'])->names(['index' => 'guru']);
    Route::resource('prospek-kerja', ProspekKerjaController::class)->only(['index', 'create', 'edit'])->names(['index' => 'prospek-kerja']);
    Route::get('/riwayat', [RiwayatController::class, 'index'])->name('riwayat');

    Route::get('/latih-model', function () {
        return view('admin.latihmodel');
    })->name('latih-model');
});