<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });

Route::get('/', 'DosenController@formLogin');
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

Route::get('/form-daftar', 'DosenController@formDaftar');
Route::post('/simpan-daftar', 'DosenController@simpanDaftar');
Route::get('dosen/beranda', 'DosenController@beranda');

// Route::get('dosen/profil', 'DosenController@profil');
Route::get('dosen/profil/{id}','DosenController@profil');  
Route::put('dosen/update-profil/{id}','DosenController@updateProfil'); 

Route::get('/form-login', 'DosenController@formLogin');
Route::post('/proses-login', 'DosenController@prosesLogin');

// Route::post('/simpan-syarat', 'DosenController@simpanSyarat');
// Route::get('dosen/hapus-syarat/{id}', 'DosenController@hapusSyarat');
Route::get('logout','DosenController@logout');

//Route Untuk Halaman Judul Penelitian (Dosen)
Route::get('dosen/judulpenelitian','PenelitianController@judul');
Route::post('/simpan-judulpenelitian', 'PenelitianController@simpanJudul');
Route::get('dosen/hapus-judul/{id}', 'PenelitianController@hapusJudul');


Route::get('dosen/proposal','PenelitianController@proposal');
Route::post('/simpan-proposal', 'PenelitianController@simpanProposal');
Route::get('dosen/edit-proposal/{id}','PenelitianController@editProposal');  
Route::put('dosen/update-proposal/{id}','PenelitianController@updateProposal'); 
Route::get('dosen/hapus-proposal/{id}', 'PenelitianController@hapusProposal');

Route::get('dosen/laporan','PenelitianController@laporan');
Route::post('/simpan-laporan', 'PenelitianController@simpanLaporan');
Route::get('dosen/edit-laporan/{id}','PenelitianController@editLaporan');  
Route::put('dosen/update-laporan/{id}','PenelitianController@updateLaporan'); 
Route::get('dosen/hapus-laporan/{id}', 'PenelitianController@hapusLaporan');

Route::prefix('admin')->middleware('auth')->group(function() {	
    Route::get('user/index','AdminUserController@index');
    Route::get('user/tambah','AdminUserController@tambah');
    Route::post('user/simpan','AdminUserController@simpan');
    Route::get('user/edit/{id}','AdminUserController@edit');  
    Route::put('user/update/{id}','AdminUserController@update'); 
    Route::get('user/hapus/{id}', 'AdminUserController@hapus');
    Route::get('user/cari','AdminUserController@cari');
    Route::get('user/detail/{id}','AdminUserController@detail');
    
    //Route Untuk Halaman Judul Penelitian (Dosen)
    Route::get('jadwal/index','AdminJadwalController@index');
    Route::post('/simpan-jadwal', 'AdminJadwalController@simpanJadwal');
    Route::get('jadwal/edit/{id}','AdminJadwalController@edit');  
    Route::put('jadwal/update/{id}','AdminJadwalController@update'); 

    Route::get('terapjadwal','AdminJadwalController@terapan');
    Route::get('terapjadwal/tambah/{id}','AdminJadwalController@terapanTambah');
    Route::put('terapjadwal/simpan/{id}','AdminJadwalController@updateTerapan'); 

    //route untuk menu judul penelitian pada admin
    Route::get('judulpenelitian','AdminPenelitianController@judulpenelitian');
    Route::get('judulpenelitian/detail/{id}', 'AdminPenelitianController@detailJudulpenelitian');
    Route::get('judulpenelitian/update-status/{id}', 'AdminPenelitianController@statusJudulpenelitian');

    //Route Untuk Menu Proposal Pada Admin
    Route::get('proposal','AdminPenelitianController@proposal');
    Route::get('proposal/detail/{id}', 'AdminPenelitianController@detailProposal');
    Route::get('proposal/update-status/{id}', 'AdminPenelitianController@statusProposal');

    //Route Untuk Menu Proposal Pada Admin
    Route::get('laporan','AdminPenelitianController@laporan');
    Route::get('laporan/detail/{id}', 'AdminPenelitianController@detailLaporan');
    Route::get('laporan/update-status/{id}', 'AdminPenelitianController@statusLaporan');

   

    Route::get('akunadmin','AdminAkunController@akunAdmin');
    Route::get('akunadmin/tambah','AdminAkunController@tambahAdmin');
    Route::post('akunadmin/simpan','AdminAkunController@simpanAdmin');
    Route::get('akunadmin/edit/{id}','AdminAkunController@editAdmin');  
    Route::put('akunadmin/update/{id}','AdminAkunController@updateAdmin'); 
    Route::get('akunadmin/hapus/{id}', 'AdminAkunController@hapusAdmin');

    Route::get('akun/dosen','AdminAkunController@akunDosen');
    Route::get('akun/dosen/tambah','AdminAkunController@tambahDosen');
    Route::post('akun/dosen/simpan','AdminAkunController@simpanDosen');
    Route::get('akun/dosen/edit/{id}','AdminAkunController@editDosen');  
    Route::put('akun/dosen/update/{id}','AdminAkunController@updateDosen'); 
    Route::get('akun/dosen/hapus/{id}', 'AdminAkunController@hapusDosen');

    Route::get('akses','AdminAksesController@akses');
});