<?php

use Core\Route;
use App\Controllers\HomeController;
use App\Controllers\AuthController;
use App\Controllers\DashboardController;
use App\Controllers\MahasiswaController;
use App\Controllers\KrsController;
use App\Controllers\KhsController;
use App\Controllers\PdfKRSController;
use App\Controllers\CetakKHSController;
use App\Controllers\UjianController;
use App\Controllers\SoalController;
use App\Controllers\MahasiswaJadwalController;
use App\Controllers\MahasiswaTAController;
use App\Controllers\KompreController;
use App\Controllers\PDFKompreController;
use App\Controllers\AjuanMhsController;
use App\Controllers\PDFTranskipController;
use App\Controllers\KKNController;
use App\Controllers\PPLKController;
use App\Controllers\PDFFormKKNController;
use App\Controllers\PDFFormPPLKController;
use App\Controllers\SidangController;
use App\Controllers\PDFSidangSkrController;
use App\Controllers\YudisiumController;
use App\Controllers\WisudaController;
use App\Controllers\PDFYudisiumController;
use App\Controllers\PDFWisudaController;
use App\Controllers\AbsensiController;
use App\Controllers\ImageController;
use App\Controllers\PengaturanAdminController;
use App\Controllers\ManagePMBController;
use App\Controllers\PDFHasilTPMBController;
use App\Controllers\DownloadController;
use App\Controllers\SoalPMBController;
use App\Controllers\DataPMBController;
use App\Controllers\DownloadDataPMBController;
use App\Controllers\EditAbsensiController;
use App\Controllers\UploadSoalController;
use App\Controllers\DosenLihatSoalController;
use App\Controllers\DosenDownloadPdfSoalController;
use App\Controllers\DosenCorectSoalController;
use App\Controllers\DosenKoreksiJawabanController;
use App\Controllers\DosenInputNilaiController;
use App\Controllers\DosenViewNilaiKelasController;
use App\Controllers\DosenInputUTSUASKelasController;
use App\Controllers\DosenPDFUTSUASKelasController;
use App\Controllers\JadwalDosenController;
use App\Controllers\DonNilaiDosenController;
use App\Controllers\DosenDownJawabanController;
use App\Controllers\DataMHSController;
use App\Controllers\AturJadwalUjianController;
use App\Controllers\PegawaiUTokenController;
use App\Controllers\MonitoringKIPController;
use App\Controllers\UploadNilaiController;
use App\Controllers\PresenKegiatanController;


Route::get('/news-image/{filename}', 'ImageController@serveNewsImage');

Route::get('/', 'HomeController@index');
Route::post('/login', 'AuthController@login');
Route::get('/logout', 'AuthController@logout');
Route::get('/dashboard/admin', 'DashboardController@admin');
Route::get('/dashboard/pegawai', 'DashboardController@pegawai');
Route::get('/dashboard/staff', 'DashboardController@staff');
Route::get('/dashboard/pimpinan', 'DashboardController@pimpinan');
Route::get('/dashboard/humas', 'DashboardController@humas');
Route::get('/dashboard/mahasiswa', 'DashboardController@mahasiswa');
Route::get('/dashboard/dosen', 'DashboardController@dosen');
Route::get('/dashboard/kaprodi', 'DashboardController@kaprodi');
Route::get('/dashboard/pegawai-set_ujian', 'SetUjianController@index');
Route::get('/dashboard/maba', 'DashboardController@maba');


Route::get('/dashboard/mahasiswa-profile', 'MahasiswaController@profile');
Route::post('/dashboard/mahasiswa-update-pribadi', 'MahasiswaController@updatePribadi');
Route::post('/dashboard/mahasiswa-update-alamat', 'MahasiswaController@updateAlamat');
Route::post('/dashboard/mahasiswa-update-ortu', 'MahasiswaController@updateOrtu');
Route::get('/dashboard/mahasiswa-search-kecamatan', 'MahasiswaController@searchKecamatan');

Route::get('/dashboard/mahasiswa-krs', 'KrsController@index');
Route::post('/dashboard/mahasiswa-krs', 'KrsController@simpanToken');
Route::post('/dashboard/mahasiswa-krs/submit', 'KrsController@submit');
Route::get('/dashboard/pdfkrs', 'PdfKRSController@index');
Route::post('/dashboard/update-krs', 'KrsController@updateKRS');
Route::get('/dashboard/mahasiswa-khs', 'KhsController@index');
Route::get('/dashboard/mahasiswa-khs/detail', 'KhsController@detail');
Route::post('/dashboard/mahasiswa-khs/detail', 'KhsController@detail'); // untuk kirim token
Route::get('/dashboard/cetak-khs', 'CetakKHSController@index'); // untuk kirim token
Route::post('/dashboard/cetak-khs', 'CetakKHSController@index'); // untuk kirim token
Route::get('/dashboard/mahasiswa-soal', 'UjianController@index');
Route::post('/dashboard/mahasiswa-soal/verifikasi-token', 'UjianController@verifikasiToken');
Route::get('/dashboard/mahasiswa-mulai-ujian', 'SoalController@mulai');
Route::post('/ujian/simpan', 'SoalController@simpanJawaban');
Route::get('/dashboard/mahasiswa-jadwal', 'MahasiswaJadwalController@index');
Route::get('/dashboard/mahasiswa-ta', 'MahasiswaTAController@index');
Route::get('/dashboard/mahasiswa-reg-kompre', 'KompreController@index');
Route::post('/dashboard/mahasiswa-reg-kompre/mulai', 'KompreController@mulai');
Route::get('/dashboard/mahasiswa-reg-kompre/soal', 'KompreController@soal');
Route::post('/dashboard/mahasiswa-reg-kompre/simpan-jawaban', 'KompreController@simpanJawaban');
Route::get('/dashboard/mahasiswa-reg-kompre/hasil', 'KompreController@hasil');
Route::get('/dashboard/mahasiswa-pdf_kompre', 'PDFKompreController@hasilPDF');
Route::get('/dashboard/mahasiswa-ajukan', 'AjuanMhsController@index');
Route::get('/dashboard/mahasiswa-cetak_trskp_smtr', 'PDFTranskipController@hasilPDF');
Route::get('/dashboard/mahasiswa-daftarkkn', 'KKNController@form');
Route::post('/dashboard/mahasiswa-daftarkkn', 'KKNController@form');
Route::get('/dashboard/mahasiswa-frm_kkn', 'PDFFormKKNController@hasilPDF');
Route::get('/dashboard/mahasiswa-daftarpplk', 'PPLKController@form');
Route::post('/dashboard/mahasiswa-daftarpplk', 'PPLKController@form');
Route::get('/dashboard/mahasiswa-frm_pplk', 'PDFFormPPLKController@hasilPDF');
Route::get('/dashboard/mahasiswa-daftarskripsi', 'SidangController@index');
Route::post('/dashboard/mahasiswa-daftarskripsi', 'SidangController@daftarSkripsi');
Route::post('/dashboard/mahasiswa-daftarskripsi-update', 'SidangController@updatesidang');
Route::get('/dashboard/mahasiswa-search-dosen', 'SidangController@searchDosen');
Route::get('/dashboard/mahasiswa/form-s-skripsi', 'PDFSidangSkrController@hasilPDF');
Route::get('/dashboard/mahasiswa-daftaryudisium', 'YudisiumController@index');
Route::post('/dashboard/mahasiswa-daftaryudisium/daftar', 'YudisiumController@daftar');
Route::get('/dashboard/mahasiswa-daftaryudisium/token', 'YudisiumController@inputToken');
Route::post('/dashboard/mahasiswa-daftaryudisium/token/check', 'YudisiumController@checkToken');
Route::get('/dashboard/mahasiswa-cetakfyudisium', 'PDFYudisiumController@hasilPDF');
Route::get('/dashboard/search-dosen-yudis', 'YudisiumController@searchDosen');
Route::get('/dashboard/mahasiswa-daftarwisuda', 'WisudaController@index');
Route::post('/dashboard/mahasiswa-daftarwisuda/daftar', 'WisudaController@daftar');
Route::post('/dashboard/mahasiswa-daftarwisuda/token/check', 'WisudaController@checkToken');
Route::get('/dashboard/mahasiswa-cetakfwisuda', 'PDFWisudaController@hasilPDF');
Route::get('/dashboard/search-dosen-wisud', 'WisudaController@searchDosen');
Route::get('/dashboard/mahasiswa-khs/detailnilai', 'KhsController@detailNilai');




Route::get('/dashboard/dosen-profile', 'DosenController@profile');
Route::post('/dashboard/updt-prf-dsn', 'DosenController@updateProfile');
Route::get('/dashboard/dosen-absen_mahasiswa', 'AbsensiController@index');       // Form awal tampil matkul
Route::post('/dashboard/dosen-absen_mahasiswa', 'AbsensiController@cari');       // Saat klik tombol Cari
Route::post('/dashboard/dosen-absen_mahasiswa/simpan', 'AbsensiController@simpan'); // Untuk simpan absensi
Route::get('/dashboard/dosen-editabsen_mahasiswa', 'EditAbsensiController@index');
Route::post('/dashboard/dosen-editabsen_mahasiswa', 'EditAbsensiController@index');
Route::post('/dashboard/dosen-editabsen_mahasiswa/update', 'EditAbsensiController@update');
Route::get('/dashboard/dosen-cetakpresensi-excel', 'EditAbsensiController@cetakExcel');

Route::get('/dashboard/dosen-upload-soal', 'UploadSoalController@index');
Route::post('/dashboard/dosen-upload-soal/upload', 'UploadSoalController@upload');
Route::get('/dashboard/dosen-upload-soal-excel', 'UploadSoalExcelController@index');
Route::post('/dashboard/dosen-upload-soal-excel', 'UploadSoalExcelController@index');


Route::get('/dashboard/dosen-lihatsoal', 'DosenLihatSoalController@index');
Route::post('/dashboard/dosen-lihatsoal/edit', 'DosenLihatSoalController@edit');
Route::post('/dashboard/dosen-lihatsoal/delete', 'DosenLihatSoalController@delete');
Route::get('/dashboard/dosen-download_pdfsoal', 'DosenDownloadPdfSoalController@index');
Route::get('/dashboard/dosen-koreksi-soal', 'DosenCorectSoalController@index');
Route::get('/dashboard/dosen-koreksi-jawaban', 'DosenKoreksiJawabanController@index');
Route::post('/dashboard/dosen-koreksi-jawaban', 'DosenKoreksiJawabanController@simpanNilai');
Route::get('/dashboard/dosen-input-nilai', 'DosenInputNilaiController@index');
Route::get('/dashboard/dosen-dosen-view-nilaikelas', 'DosenViewNilaiKelasController@index');
Route::post('/dashboard/dosen-dosen-view-nilaikelas', 'DosenViewNilaiKelasController@index'); // untuk handle POST juga
Route::get('/dashboard/dosen-view-utsuas', 'DosenViewUTSUASKelasController@index');
Route::get('/dashboard/dosen-input-uasuts', 'DosenInputUTSUASKelasController@index');
Route::post('/dashboard/dosen-input-uasuts', 'DosenInputUTSUASKelasController@index');
Route::get('/dashboard/dosen-pdf_uas_uts', 'DosenPDFUTSUASKelasController@index');
Route::get('/dashboard/dosen-jadwal', 'JadwalDosenController@index');
Route::get('/dashboard/dosen-download-nilai', 'DonNilaiDosenController@index');
Route::post('/dashboard/dosen-download-nilai', 'DonNilaiDosenController@downloadExcel');

Route::get('/dashboard/dosen-download_jawaban', 'DosenDownJawabanController@index');
Route::get('/dashboard/dosen-download-nilai-akhir', 'DosenDownloadNilaiController@index');

Route::get('/dashboard/dosen-transkip/export', 'DonNilaiDosenController@export');

Route::get('/dashboard/dosen-cetakpresensi-pdf', 'CetakPresensiPdfController@index');



Route::get('/dashboard/pegawai-profil', 'PegawaiController@profile');
Route::get('/dashboard/pegawai-data-mhs', 'DataMHSController@index');
Route::get('/dashboard/pegawai-download-mhs', 'DataMHSController@download');
Route::post('/dashboard/pegawai-import-mhs', 'DataMHSController@importExcel');

Route::get('/dashboard/pegawai-in-jadwal', 'JadwalUjianController@index');
Route::get('/dashboard/pegawai-jadwal-ujian', 'AturJadwalUjianController@index');
Route::post('/dashboard/pegawai-jadwal-ujian/simpan', 'AturJadwalUjianController@store');
Route::get('/dashboard/pegawai-jadwal-ujian/download-belum-upload', 'AturJadwalUjianController@downloadBelumUpload');
Route::get('/dashboard/pegawai-jadwal-ujian/download-sudah-upload', 'AturJadwalUjianController@downloadSudahUpload');
Route::post('/dashboard/pegawai-jadwal-ujian/edit', 'AturJadwalUjianController@edit');
Route::get('/dashboard/pegawai-jadwal-ujian/cari-dosen', 'AturJadwalUjianController@cariDosen');

Route::get('/dashboard/pegawai-uploadstaftoken', 'PegawaiUTokenController@index');
Route::post('/dashboard/pegawai-uploadstaftoken', 'PegawaiUTokenController@index');

Route::get('/dashboard/pegawai-ta', 'PengaturanPegawaiController@index');
Route::get('/dashboard/pegawai-manage_pmb', 'ManagePegPMBController@index');
Route::post('/dashboard/pegawai-manage_pmb/uploadSoal', 'SoalPegPMBController@uploadSoal');
// Tampilkan data PMB
Route::get('/dashboard/pegawai-data_pmb', 'DataPegPMBController@index');
Route::post('/dashboard/pegawai-delete_data_pmb', 'DataPegPMBController@delete');
Route::get('/dashboard/pegawai-edit_data_pmb/{id}', 'DataPegPMBController@edit');
Route::post('/dashboard/pegawai-update_data_pmb', 'DataPegPMBController@update');
Route::post('/dashboard/pegawai-import_pmb', 'DataPegPMBController@importExcel');
Route::get('/dashboard/pegawai-template_pmb', 'DataPegPMBController@downloadTemplate');



Route::get('/dashboard/pegawai-ubah_gel_mhs', 'DataPegGelMhsController@index');
Route::post('/dashboard/pegawai-ubah_gel_mhs', 'DataPegGelMhsController@index');

Route::post('/dashboard/pegawai-download_data_pmb', 'DownloadDataPMBController@downloadHasil');
Route::post('/manage_pmb/updatePegAksesPmb', 'ManagePegPMBController@updateAksesPmb');
Route::post('/manage_pmb/updatePegStatusSoal', 'ManagePegPMBController@updateStatusSoal');
Route::post('/manage_pmb/downloadPegHasil', 'PDFHasilTPMBController@downloadHasil');
Route::post('/manage_pmb/tambahPegGelombang', 'ManagePegPMBController@tambahGelombang');
Route::post('/manage_pmb/hapusPegGelombang', 'ManagePegPMBController@hapusGelombang');
Route::post('/manage_pmb/editPegGelombang', 'ManagePegPMBController@editGelombang');
Route::get('/dashboard/pegawai-manage_kkn', 'ManagePegKKNController@index');
Route::get('/dashboard/pegawai-download-kkn', 'DownloadDataKKNController@index');
Route::get('/dashboard/pegawai-manage_skripsi', 'ManagePegSkripsiController@index');
Route::get('/dashboard/pegawai-download-skripsi', 'DownloadDataSkripsiController@index');

Route::get('/dashboard/pegawai-input-nilai', 'PegawaiInputNilaiController@index');
Route::get('/dashboard/pegawai-mk-by-tahun', 'PegawaiInputNilaiController@getMataKuliahByTahun');

Route::get('/dashboard/pegawai-view-nilaikelas', 'PegawaiViewNilaiKelasController@index');
Route::post('/dashboard/pegawai-view-nilaikelas', 'PegawaiViewNilaiKelasController@index'); 
Route::post('/dashboard/pegawai-view-nilaikelasUpdatKHS', 'PegawaiViewNilaiKelasController@updateKHS'); 
Route::get('/dashboard/pegawai-download-nilai-akhir', 'PegawaiDownloadNilaiController@index');

Route::get('/dashboard/pegawai-manage_kompre', 'ManagePegKompreController@index');
Route::post('/dashboard/pegawai-manage_kompre', 'ManagePegKompreController@index');
Route::get('/dashboard/pegawai-download-kompre', 'DownloadDataKompreController@index');
Route::get('/dashboard/pegawai-transkip', 'PegawaiTranskipController@index');
Route::get('/dashboard/pegawai-transkip/export', 'PegawaiTranskipController@export');
Route::get('/dashboard/pegawai-transkip/xls', 'PegawaiTranskipController@exportPerMahasiswaXLS');
Route::get('/dashboard/pegawai-transkip/pdf', 'PegawaiTranskipController@exportPerMahasiswaPDF');

Route::get('/dashboard/pegawai-up_nilai', 'UploadNilaiController@index');
Route::post('/dashboard/pegawai-up_nilai', 'UploadNilaiController@upload');
Route::get('/dashboard/pegawai-download_template', 'UploadNilaiController@downloadTemplate');

Route::get('/dashboard/pegawai-presen-kegiatan', 'PresenKegiatanController@index');
Route::post('/dashboard/pegawai-presen-kegiatan/store', 'PresenKegiatanController@store');
Route::post('/dashboard/pegawai-presen-kegiatan/scan', 'PresenKegiatanController@scan');

Route::get('/dashboard/pegawai-ips-ipk', 'IPSIPKController@index');
Route::get('/dashboard/pegawai-export', 'IPSIPKController@export');
Route::get('/dashboard/pegawai-data-maba', 'DataMabaPegController@index');
Route::get('/dashboard/pegawai-download-maba', 'DataMabaPegController@download');
Route::get('/dashboard/pegawai-maba-detail', 'DataMabaPegController@detail');
Route::post('/dashboard/pegawai-maba-check', 'DataMabaPegController@check');
Route::get('/dashboard/maba-get-kecamatan', 'DataMabaPegController@getKecamatanById');



Route::get('/dashboard/admin-ta', 'PengaturanAdminController@index');
Route::get('/dashboard/admin-manage_pmb', 'ManagePMBController@index');
Route::post('/manage_pmb/updateAksesPmb', 'ManagePMBController@updateAksesPmb');
Route::post('/manage_pmb/updateStatusSoal', 'ManagePMBController@updateStatusSoal');
Route::post('/manage_pmb/tambahGelombang', 'ManagePMBController@tambahGelombang');
Route::post('/manage_pmb/editGelombang', 'ManagePMBController@editGelombang');
Route::post('/manage_pmb/hapusGelombang', 'ManagePMBController@hapusGelombang');
Route::post('/manage_pmb/downloadHasil', 'PDFHasilTPMBController@downloadHasil');
Route::post('/dashboard/admin-download_data_pmb', 'DownloadDataPMBController@downloadHasil');
Route::get('/download_format', 'DownloadController@format');
Route::get('/download_format_soal', 'DownloadController@format_excel');
Route::post('/dashboard/admin-manage_pmb/uploadSoal', 'SoalPMBController@uploadSoal');
Route::get('/dashboard/admin-data_pmb', 'DataPMBController@index');
Route::post('/dashboard/admin-data_pmb', 'DataPMBController@index');
Route::get('/dashboard/admin-ubah_pw_mahasiswa', 'PWMahasiswaController@index');
Route::post('/dashboard/admin-ubah_pw_mahasiswa/reset', 'PWMahasiswaController@updatePassword');
Route::get('/dashboard/admin-ubah_pw_dosen', 'PWDosenController@index');
Route::post('/dashboard/admin-ubah_pw_dosen/reset', 'PWDosenController@updatePassword');
Route::get('/dashboard/admin-validasi_krs', 'ValidasiKRSController@index');
Route::post('/dashboard/admin-validasi_krs', 'ValidasiKRSController@index');
Route::get('/dashboard/admin-validasi_khs', 'ValidasiKHSController@index');
Route::post('/dashboard/admin-validasi_khs', 'ValidasiKHSController@index');
Route::get('/dashboard/admin-add_mahasiswa', 'AddMahasiswaController@index');
Route::post('/dashboard/admin-add_mahasiswa', 'AddMahasiswaController@store');
Route::get('/dashboard/admin-monitoring_kip', 'MonitoringKIPController@index');
Route::get('/dashboard/admin-khs', 'ManageKHSController@index');
Route::post('/dashboard/admin-khs-update', 'ManageKHSController@update');
Route::get('/dashboard/admin-mbr', 'ManageKRSController@index');
// Insert kelas
Route::post('/dashboard/admin-mbr/insert-kelas', 'ManageKRSController@insertKelas');
// Update user
Route::post('/dashboard/admin-mbr/update-user', 'ManageKRSController@updateUser');
// Delete kelas
Route::get('/dashboard/admin-mbr/delete-kelas/{id}', 'ManageKRSController@deleteKelas');

Route::get('/dashboard/admin-nim-mbr', 'ManageNIMMBRController@index');
Route::post('/dashboard/admin-nim-mbr/import', 'ManageNIMMBRController@importExcel');


// staff
Route::get('/dashboard/staff-profil', 'PegawaiController@profile');
Route::get('/dashboard/staff-data-mhs', 'DataMHSController@index');
Route::get('/dashboard/staff-data-maba', 'DataMabaController@index');
Route::get('/dashboard/staff-download-maba', 'DataMabaController@download');

Route::get('/dashboard/staff-data-pplk', 'DataPPLKController@index');
Route::get('/dashboard/staff-data-pplk/download', 'DataPPLKController@download');


// alur pengisian data maba
Route::get('/dashboard/maba-profile', 'MabaController@profile');
Route::post('/dashboard/maba-profile', 'MabaController@saveProfile');

Route::get('/dashboard/maba-orangtua', 'MabaController@orangTua');
Route::post('/dashboard/maba-orangtua', 'MabaController@saveOrangTua');

Route::get('/dashboard/maba-pilihkelas', 'MabaController@pilihKelas');
Route::post('/dashboard/maba-pilihkelas', 'MabaController@savePilihKelas');
Route::post('/dashboard/maba-token', 'MabaController@tokenisasi');

Route::get('/dashboard/maba-search-kecamatan', 'MabaController@searchKecamatan');


// Routes.php
Route::post('/api/get-token', 'Api\AuthController@getToken');
Route::get('/api/mahasiswa', 'Api\MahasiswaController@index');
Route::get('/api/kelas', 'Api\KelasController@index');
Route::get('/api/maba', 'Api\MabaController@index');
Route::get('/api/krs', 'Api\ApiKrsController@index');
Route::get('/api/mk', 'Api\ApiMkController@index');



