<?php

use App\Http\Controllers\DashboardController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\OrderController;
use App\Http\Controllers\ReportController;
use App\Http\Controllers\ReviewController;
use App\Http\Controllers\SliderController;
use App\Http\Controllers\AnggotaController;
use App\Http\Controllers\PaymentController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\TentangController;
use App\Http\Controllers\CategoryController;
use App\Http\Controllers\TestimoniController;
use App\Http\Controllers\SubcategoryController;

use App\Http\Controllers\PostingController;

/*
|--------------------------------------------------------------------------
| 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 untuk menampilkan form login
Route::get('/login', [AuthController::class, 'showLoginForm'])->name('login');

// Route untuk proses login
Route::post('/login', [AuthController::class, 'login']);

// Route untuk proses logout
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');


Route::get('/dashboard', [DashboardController::class, 'index']);
Route::get('/bacamasuk', [DashboardController::class, 'bacamasuk']);
Route::get('/bacakeluar', [DashboardController::class, 'bacakeluar']);
Route::get('/bacatotal', [DashboardController::class, 'bacatotal']);




//kategori
Route::get('/anggota',[AnggotaController::class, 'list']);
Route::get('/kategori',[CategoryController::class, 'list']);
Route::get('/subkategori',[SubcategoryController::class, 'list']);
Route::get('/slider',[SliderController::class, 'list']);
Route::get('/barang',[ProductController::class, 'list']);
Route::get('/testimoni',[TestimoniController::class, 'list']);
Route::get('/review',[ReviewController::class, 'list']);
Route::get('/payment',[PaymentController::class, 'list']);

Route::get('/pesanan/baru',[OrderController::class, 'list']);
Route::get('/pesanan/dikonfirmasi',[OrderController::class, 'dikonfirmasi_list']);
Route::get('/pesanan/dikemas',[OrderController::class, 'dikemas_list']);
Route::get('/pesanan/dikirim',[OrderController::class, 'dikirim_list']);
Route::get('/pesanan/diterima',[OrderController::class, 'diterima_list']);
Route::get('/pesanan/selesai',[OrderController::class, 'selesai_list']);
Route::get('/pesanan/selesai',[OrderController::class, 'selesai_list']);

Route::get('/laporan',[ReportController::class, 'index']);
Route::get('/tentang',[TentangController::class, 'index']);
Route::post('/tentang/{about}',[TentangController::class, 'update']);

Route::get('/dashboard',[DashboardController::class,'index']);

//home routes
// Route::get('/',[HomeController::class,'index']);
// Route::get('/products/{category}',[HomeController::class,'products']);
// Route::get('/product/{id}',[HomeController::class,'product']);
// Route::get('/cart',[HomeController::class,'cart']);
// Route::get('/checkout',[HomeController::class,'checkout']);
// Route::get('/orders',[HomeController::class,'orders']);
// Route::get('/about',[HomeController::class,'about']);
// Route::get('/contact',[HomeController::class,'contact']);
// Route::get('/faq',[HomeController::class,'faq']);

// Route::post('/add_to_cart',[HomeController::class,'add_to_cart']);
// Route::get('/delete_from_cart/{cart}',[HomeController::class,'delete_from_cart']);
// Route::get('/get_kota/{id}',[HomeController::class,'get_kota']);
// Route::get('/get_ongkir/{destination}/{weight}',[HomeController::class,'get_ongkir']);
// Route::post('/checkout_orders',[HomeController::class,'checkout_orders']);
// Route::post('/payments',[HomeController::class,'payments']);
// Route::post('/products/search', [HomeController::class, 'searchProducts'])->name('product.search');


Route::get('/postings', [PostingController::class, 'index']);

