<?php

use Illuminate\Support\Facades\Route;


use App\Http\Controllers\AdminController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\LayananPemutihanController;
use App\Http\Controllers\LayananPengajuanAduanController;
use App\Http\Controllers\LayananPengajuanDpuDpaController;
use App\Http\Controllers\LayananPengajuanWisudaController;
use App\Http\Controllers\LayananRevisiPublikasiController;
use App\Http\Controllers\LayananSeminarProposal;
use App\Http\Controllers\LayananSidangAkhirController;
use App\Http\Controllers\MahasiswaController;
use App\Http\Controllers\MonitoringController;
use App\Http\Controllers\SesiLoginController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::middleware(['guest'])->group(function () {
    route::get('/admin/login',[SesiLoginController::class, 'login'])->name('login');
    route::post('/admin/login',[SesiLoginController::class, 'ceklogin'])->name('admin.ceklogin');    
});

route::get('/', function(){
    return view('index'); })->name('laman-awal');
route::get('/privacy-policy', function(){
    return view('privacy-policy'); })->name('privacy-policy');
route::get('/term-of-use', function(){
    return view('term-of-use'); })->name('term-of-use');

Route::get('/home', function(){
    return redirect('/admin');
});

Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function () {
    Route::get('/', [AdminController::class, 'index'])->name('admin.dashboard');
    Route::get('/logout', [SesiLoginController::class, 'logout'])->name('admin.logout');
    //layanan Pemutihan kelas
    Route::get('/layanan-pemutihan', [LayananPemutihanController::class, 'index'])->name('layanan-pemutihan.index');
    Route::POST('/layanan-pemutihan', [LayananPemutihanController::class, 'terima'])->name('layanan-pemutihan.terima');
    Route::POST('/layanan-pemutihan/tolak/{caseid}', [LayananPemutihanController::class, 'tolak'])->name('layanan-pemutihan.tolak');
    Route::POST('/layanan-pemutihan/selesai/{caseid}', [LayananPemutihanController::class, 'selesai'])->name('layanan-pemutihan.selesai');
    //layanan Pengajuan DPU DPA
    Route::get('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'index'])->name('layanan-dpudpa.index');
    Route::DELETE('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'destroy'])->name('layanan-dpudpa.destroy');
    Route::POST('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'terima'])->name('layanan-dpudpa.terima');
    Route::POST('/layanan-dpudpa/resend/{caseid}', [LayananPengajuanDpuDpaController::class, 'resend'])->name('layanan-dpudpa.resend');
    //layanan Pengajuan Seminar Proposal
    Route::get('/layanan-sempro', [LayananSeminarProposal::class, 'index'])->name('layanan-sempro.index');
    Route::DELETE('/layanan-sempro', [LayananSeminarProposal::class, 'destroy'])->name('layanan-sempro.destroy');
    Route::POST('/layanan-sempro', [LayananSeminarProposal::class, 'terima'])->name('layanan-sempro.terima');
    Route::POST('/layanan-sempro/resend/{caseid}', [LayananSeminarProposal::class, 'resend'])->name('layanan-sempro.resend');
    //layanan Pengajuan Sidang Akhir
    Route::get('/layanan-sidangakhir', [LayananSidangAkhirController::class, 'index'])->name('layanan-sidangakhir.index');
    Route::DELETE('/layanan-sidangakhir', [LayananSidangAkhirController::class, 'destroy'])->name('layanan-sidangakhir.destroy');
    Route::POST('/layanan-sidangakhir', [LayananSidangAkhirController::class, 'terima'])->name('layanan-sidangakhir.terima');
    Route::POST('/layanan-sidangakhir/resend/{caseid}', [LayananSidangAkhirController::class, 'resend'])->name('layanan-sidangakhir.resend');
    //layanan Pengajuan Revisi Publikasi
    Route::get('/layanan-revisipublikasi', [LayananRevisiPublikasiController::class, 'index'])->name('layanan-revisipublikasi.index');
    Route::DELETE('/layanan-revisipublikasi', [LayananRevisiPublikasiController::class, 'destroy'])->name('layanan-revisipublikasi.destroy');
    Route::POST('/layanan-revisipublikasi', [LayananrevisipublikasiController::class, 'terima'])->name('layanan-revisipublikasi.terima');
    Route::POST('/layanan-revisipublikasi/resend/{caseid}', [LayananRevisiPublikasiController::class, 'resend'])->name('layanan-revisipublikasi.resend');
    //layanan Pengajuan Wisuda Yudisium
    Route::get('/layanan-wisuda', [LayananPengajuanWisudaController::class, 'index'])->name('layanan-wisuda.index');
    Route::DELETE('/layanan-wisuda', [LayananPengajuanWisudaController::class, 'destroy'])->name('layanan-wisuda.destroy');
    Route::POST('/layanan-wisuda', [LayananPengajuanWisudaController::class, 'terima'])->name('layanan-wisuda.terima');
    Route::get('/layanan-wisuda/resend/', [LayananPengajuanWisudaController::class, 'resend'])->name('layanan-wisuda.resend');
    Route::POST('/layanan-wisuda/resend/', [LayananPengajuanWisudaController::class, 'resendsubmit'])->name('layanan-wisuda.resendsubmit');
    //layanan Aduan
    Route::get('/layanan-aduan', [LayananPengajuanAduanController::class, 'index'])->name('layanan-aduan.index');
    Route::DELETE('/layanan-aduan/tolak', [LayananPengajuanAduanController::class, 'destroy'])->name('layanan-aduan.destroy');
    Route::POST('/layanan-aduan', [LayananPengajuanAduanController::class, 'selesai'])->name('layanan-aduan.selesai');

    
    //User
    Route::get('/users', [UserController::class, 'index'])->name('users.index');
    Route::POST('/users', [UserController::class, 'store'])->name('users.store');
    Route::PUT('/users', [UserController::class, 'update'])->name('users.update');
    Route::DELETE('/users', [UserController::class, 'destroy'])->name('users.destroy');
    //Mahasiswa
    Route::get('/mahasiswa', [MahasiswaController::class, 'index'])->name('mahasiswa.index');
    Route::POST('/mahasiswa', [MahasiswaController::class, 'store'])->name('mahasiswa.store');
    Route::PUT('/mahasiswa', [MahasiswaController::class, 'update'])->name('mahasiswa.update');
    Route::DELETE('/mahasiswa', [MahasiswaController::class, 'destroy'])->name('mahasiswa.destroy');
    //User Roles
    Route::get('/users-roles', [UserController::class, 'userroles_index'])->name('users-roles.index');
    Route::POST('/users-roles', [UserController::class, 'userroles_store'])->name('users-roles.store');
    Route::POST('/users-roles/assign', [UserController::class, 'userroles_assign'])->name('users-roles.assign');
    Route::POST('/users-roles/deassign', [UserController::class, 'userroles_deassign'])->name('users-roles.deassign');
});


//Layanan Pengajuan DPU/DPA
Route::get('/layanan-dpudpa/cari', [LayananPengajuanDpuDpaController::class, 'cari'])->name('layanan-dpudpa.cari');
Route::post('/layanan-dpudpa/cari', [LayananPengajuanDpuDpaController::class, 'search'])->name('layanan-dpudpa.search');
Route::get('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'tambah'])->name('layanan-dpudpa.tambah');
Route::post('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'store'])->name('layanan-dpudpa.store');
Route::get('/layanan-dpudpa/cetak/{caseid}', [LayananPengajuanDpuDpaController::class, 'cetak'])->name('layanan-dpudpa.cetak');
Route::get('/layanan-dpudpa/{url}/{caseid}', [LayananPengajuanDpuDpaController::class, 'ettd'])->name('layanan-dpudpa.ettd');
Route::POST('/layanan-dpudpa/{url}/{caseid}', [LayananPengajuanDpuDpaController::class, 'submitettd'])->name('layanan-dpudpa.submitettd');
//Layanan Pengajuan Sempro
Route::get('/layanan-sempro/cari', [LayananSeminarProposal::class, 'cari'])->name('layanan-sempro.cari');
Route::post('/layanan-sempro/cari', [LayananSeminarProposal::class, 'search'])->name('layanan-sempro.search');
Route::get('/layanan-sempro/tambah', [LayananSeminarProposal::class, 'tambah'])->name('layanan-sempro.tambah');
Route::post('/layanan-sempro/tambah', [LayananSeminarProposal::class, 'store'])->name('layanan-sempro.store');
Route::get('/layanan-sempro/cetak/{caseid}', [LayananSeminarProposal::class, 'cetak'])->name('layanan-sempro.cetak');
Route::get('/layanan-sempro/dpu/{caseid}', [LayananSeminarProposal::class, 'ettd'])->name('layanan-sempro.ettd');
Route::POST('/layanan-sempro/dpu/{caseid}', [LayananSeminarProposal::class, 'submitettd'])->name('layanan-sempro.submitettd');
//Layanan Pengajuan SidangAkhir
Route::get('/layanan-sidangakhir/cari', [LayananSidangAkhirController::class, 'cari'])->name('layanan-sidangakhir.cari');
Route::post('/layanan-sidangakhir/cari', [LayananSidangAkhirController::class, 'search'])->name('layanan-sidangakhir.search');
Route::get('/layanan-sidangakhir/tambah', [LayananSidangAkhirController::class, 'tambah'])->name('layanan-sidangakhir.tambah');
Route::post('/layanan-sidangakhir/tambah', [LayananSidangAkhirController::class, 'store'])->name('layanan-sidangakhir.store');
Route::get('/layanan-sidangakhir/cetak/{caseid}', [LayananSidangAkhirController::class, 'cetak'])->name('layanan-sidangakhir.cetak');
Route::get('/layanan-sidangakhir/dpu/{caseid}', [LayananSidangAkhirController::class, 'ettd'])->name('layanan-sidangakhir.ettd');
Route::POST('/layanan-sidangakhir/dpu/{caseid}', [LayananSidangAkhirController::class, 'submitettd'])->name('layanan-sidangakhir.submitettd');
//Layanan Pengajuan Revisi Publikasi
Route::get('/layanan-revisipublikasi/cari', [LayananRevisiPublikasiController::class, 'cari'])->name('layanan-revisipublikasi.cari');
Route::post('/layanan-revisipublikasi/cari', [LayananRevisiPublikasiController::class, 'search'])->name('layanan-revisipublikasi.search');
Route::get('/layanan-revisipublikasi/tambah', [LayananRevisiPublikasiController::class, 'tambah'])->name('layanan-revisipublikasi.tambah');
Route::post('/layanan-revisipublikasi/tambah', [LayananRevisiPublikasiController::class, 'store'])->name('layanan-revisipublikasi.store');
Route::get('/layanan-revisipublikasi/cetak/{caseid}', [LayananRevisiPublikasiController::class, 'cetak'])->name('layanan-revisipublikasi.cetak');
Route::get('/layanan-revisipublikasi/{url}/{caseid}', [LayananRevisiPublikasiController::class, 'ettd'])->name('layanan-revisipublikasi.ettd');
Route::POST('/layanan-revisipublikasi/{url}/{caseid}', [LayananRevisiPublikasiController::class, 'submitettd'])->name('layanan-revisipublikasi.submitettd');
//Layanan Pengajuan Syarat Wisuda
Route::get('/layanan-wisuda/cari', [LayananPengajuanWisudaController::class, 'cari'])->name('layanan-wisuda.cari');
Route::post('/layanan-wisuda/cari', [LayananPengajuanWisudaController::class, 'search'])->name('layanan-wisuda.search');
Route::get('/layanan-wisuda/tambah', [LayananPengajuanWisudaController::class, 'tambah'])->name('layanan-wisuda.tambah');
Route::post('/layanan-wisuda/tambah', [LayananPengajuanWisudaController::class, 'store'])->name('layanan-wisuda.store');
Route::get('/layanan-wisuda/cetak/{caseid}', [LayananPengajuanWisudaController::class, 'cetak'])->name('layanan-wisuda.cetak');
Route::get('/layanan-wisuda/{url}/{caseid}', [LayananPengajuanWisudaController::class, 'ettd'])->name('layanan-wisuda.ettd');
Route::POST('/layanan-wisuda/{url}/{caseid}', [LayananPengajuanWisudaController::class, 'submitettd'])->name('layanan-wisuda.submitettd');
//Layanan Pengajuan Pemutihan
Route::get('/pemutihan/tambah', [LayananPemutihanController::class, 'tambah'])->name('layanan-pemutihan.tambah');
Route::post('/pemutihan/tambah', [LayananPemutihanController::class, 'store'])->name('layanan-pemutihan.store');
Route::get('/pemutihan/cetak/{caseid}', [LayananPemutihanController::class, 'cetak'])->name('layanan-pemutihan.cetak');
//Layanan Aduan
Route::get('/aduan/tambah', [LayananPengajuanAduanController::class, 'tambah'])->name('layanan-aduan.tambah');
Route::post('/aduan/tambah', [LayananPengajuanAduanController::class, 'store'])->name('layanan-aduan.store');

Route::get('/monitoring', [MonitoringController::class, 'index'])->name('monitoring.index');
Route::post('/monitoring', [MonitoringController::class, 'search'])->name('monitoring.search');
Route::get('/monitoring/ruangbaca', [MonitoringController::class, 'ruangbaca'])->name('monitoring.ruangbaca');
Route::get('/monitoring/pemutihan', [MonitoringController::class, 'pemutihan'])->name('monitoring.pemutihan');
Route::get('/monitoring/{caseid}', [MonitoringController::class, 'caseid'])->name('monitoring.caseid');