<?php

use App\Http\Controllers\Admin\AdminController;
use App\Http\Controllers\RegistrasiController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| 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::get('/individu', [RegistrasiController::class,'create'])->name('user.create');
Route::get('/kelompok', [RegistrasiController::class,'group_create'])->name('group.create');
Route::get('/regenerateVa/{id}', [RegistrasiController::class,'regenerateVa'])->name('regenerateVa');
// Route::get('/', function(Request $request){
//     return view('penutupan');
// });
Route::get('/', function(Request $request){
    return view('pre-register');
})->name('pre-register');

Route::post('/kegiatan-kelompok', [RegistrasiController::class,'group_kegiatan'])->name('group.kegiatan');

Route::post('/store', [RegistrasiController::class,'store'])->name('user.store');
Route::post('/preview', [RegistrasiController::class,'preview'])->name('user.preview');

Route::get('/home', [AdminController::class,'index'])->name('admin.home');

Route::get('/user', [AdminController::class, 'index_user'])->name('admin.index_user');
Route::post('/createuser', [AdminController::class, 'store_user'])->name('admin.create_user');
Route::put('/updateuser/{id}', [AdminController::class, 'update_user'])->name('admin.update_user');
Route::get('/deleteuser/{id}', [AdminController::class, 'delete_user'])->name('admin.delete_user');

Route::get('/kegiatan', [AdminController::class, 'index_kegiatan'])->name('admin.index_kegiatan');
Route::post('/createkegiatan', [AdminController::class, 'store_kegiatan'])->name('admin.create_kegiatan');
Route::put('/updatekegiatan/{id}', [AdminController::class, 'update_kegiatan'])->name('admin.update_kegiatan');
Route::get('/deletekegiatan/{id}', [AdminController::class, 'delete_kegiatan'])->name('admin.delete_kegiatan');

Route::get('/konferensi', [AdminController::class, 'index_konferensi'])->name('admin.index_konferensi');
Route::post('/createkonferensi', [AdminController::class, 'store_konferensi'])->name('admin.create_konferensi');
Route::put('/updatekonferensi/{id}', [AdminController::class, 'update_konferensi'])->name('admin.update_konferensi');
Route::get('/deletekonferensi/{id}', [AdminController::class, 'delete_konferensi'])->name('admin.delete_konferensi');

Route::get('/peserta', [AdminController::class, 'index_peserta'])->name('admin.index_peserta');
Route::get('/download_peserta', [AdminController::class, 'download_peserta'])->name('admin.download_peserta');
Route::get('/delete_peserta/{id}', [AdminController::class, 'delete_peserta'])->name('admin.delete_peserta');

Route::post('/add-kegiatan', [RegistrasiController::class, 'addFormKegiatan'])->name('registrasi.form-kegiatan.add');
Route::post('/add-anggota', [RegistrasiController::class, 'addFormAnggota'])->name('registrasi.form-anggota.add');
Route::get('check-invoice', function(Request $request){
    return view('email.invoice');
});
Route::get('test/email', [RegistrasiController::class, 'testEmail']);
Route::get('check/regis/{va}', [RegistrasiController::class, 'checkRegistrasi']);

Route::get('/contact', [RegistrasiController::class,'contact'])->name('user.contact');
