<?php

use App\Http\Controllers\User\ViewController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\ViewsController;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\BasicController;
use App\Http\Controllers\Admin\BondController;
use App\Http\Controllers\Admin\DepositController;
use App\Http\Controllers\Admin\DiamondController;
use App\Http\Controllers\Admin\DiamondPayoutController;
use App\Http\Controllers\Admin\GoldController;
use App\Http\Controllers\Admin\GoldPayoutController;
use App\Http\Controllers\Admin\ManualController;
use App\Http\Controllers\Admin\SilverController;
use App\Http\Controllers\Admin\UserManagementController;
use App\Http\Controllers\User\UserAuthController;

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

Route::get('/logs', [BasicController::class, 'logs'])->name('logs');
Route::get('/logs_clear', [BasicController::class, 'logs_clear'])->name('logs_clear');
Route::get('/logs_replace', [BasicController::class, 'logs_replace'])->name('logs_replace');
Route::get('/check_time', [BasicController::class, 'checkTime'])->name('check_time');
Route::get('/optimizeAndAnalyzeTables', [BasicController::class, 'optimizeAndAnalyzeTables'])->name('optimizeAndAnalyzeTables');
Route::get('/file_db_backup', [BasicController::class, 'file_db_backup']);
Route::get('/clear_cache', [BasicController::class, 'clear_cache']);
Route::get('/migrate', [BasicController::class, 'migrate']);
Route::get('/db_seed', [BasicController::class, 'db_seed']);
// Route::get('/privacy_policy', [BasicController::class, 'privacy_policy'])->name('privacy_policy');
// Route::get('/terms_conditions', [BasicController::class, 'terms_conditions'])->name('terms_conditions');
Route::get('/delete_user_account', [BasicController::class, 'delete_user_account'])->name('delete_user_account');

Route::prefix('admin')->name('admin.')->group(function () {

    Route::get('/generate_user_cash_reports', [ManualController::class, 'generate_user_cash_reports'])->name('generate_user_cash_reports');


    Route::get('/login', [ViewsController::class, 'login'])->name('login');
    Route::post('/login_form', [AuthController::class, 'login_form'])->name('login_form');


    Route::middleware(['checkadmin'])->group(function () {
        Route::get('/dashboard', [ViewsController::class, 'dashboard'])->name('dashboard');
        Route::get('/logout_form', [AuthController::class, 'logout_form'])->name('logout_form');

        //User Management
        Route::get('/user_management', [UserManagementController::class, 'user_management'])->name('user_management');
        Route::get('/user_management_data', [UserManagementController::class, 'user_management_data'])->name('user_management_data');
        Route::get('/view_diamond_payout/{user_id}', [UserManagementController::class, 'view_diamond_payout'])->name('view_diamond_payout');
        Route::get('/view_diamond_payout_data/{user_id}', [UserManagementController::class, 'view_diamond_payout_data'])->name('view_diamond_payout_data');
        Route::get('/edit_user', [ViewsController::class, 'edit_user'])->name('edit_user');


        //Silver
        Route::get('/silver_advance', [SilverController::class, 'silver_advance'])->name('silver_advance');
        Route::get('/silver_advance_data', [SilverController::class, 'silver_advance_data'])->name('silver_advance_data');

        //Gold
        Route::get('/gold_advance', [GoldController::class, 'gold_advance'])->name('gold_advance');
        Route::get('/gold_advance_data', [GoldController::class, 'gold_advance_data'])->name('gold_advance_data');
        //Gold->generate income
        Route::get('/gold_generate', [GoldController::class, 'gold_generate'])->name('gold_generate');
        Route::post('/generate_manual_gold_profit', [GoldController::class, 'generate_manual_gold_profit'])->name('generate_manual_gold_profit');
        Route::get('/profit_report_gold', [GoldController::class, 'profit_report_gold'])->name('profit_report_gold');
        Route::get('/profit_report_gold_data', [GoldController::class, 'profit_report_gold_data'])->name('profit_report_gold_data');
        Route::get('/gold_roi_history/{date}', [GoldController::class, 'gold_roi_history'])->name('gold_roi_history');
        Route::get('/gold_roi_history_data/{date}', [GoldController::class, 'gold_roi_history_data'])->name('gold_roi_history_data');
        Route::post('/delete_gold_roi', [GoldController::class, 'delete_gold_roi'])->name('delete_gold_roi');
        //Gold Payout
        Route::get('/gold_payout', [GoldPayoutController::class, 'gold_payout'])->name('gold_payout');
        Route::get('/gold_payout_data', [GoldPayoutController::class, 'gold_payout_data'])->name('gold_payout_data');
        Route::get('/gold_roi_gen_history', [GoldPayoutController::class, 'gold_roi_gen_history'])->name('gold_roi_gen_history');
        Route::get('/gold_roi_gen_history_data', [GoldPayoutController::class, 'gold_roi_gen_history_data'])->name('gold_roi_gen_history_data');

        //Diamond
        Route::get('/diamond_advance', [DiamondController::class, 'diamond_advance'])->name('diamond_advance');
        Route::get('/diamond_advance_data', [DiamondController::class, 'diamond_advance_data'])->name('diamond_advance_data');
        //Diamond->generate income
        Route::get('/diamond_generate', [DiamondController::class, 'diamond_generate'])->name('diamond_generate');
        Route::post('/generate_manual_diamond_profit', [DiamondController::class, 'generate_manual_diamond_profit'])->name('generate_manual_diamond_profit');
        Route::post('/generate_cron_diamond_profit', [DiamondController::class, 'generate_cron_diamond_profit'])->name('generate_cron_diamond_profit');

        //diamond->payout
        Route::get('/diamond_payout', [DiamondPayoutController::class, 'diamond_payout'])->name('diamond_payout');
        Route::get('/diamond_payout_data', [DiamondPayoutController::class, 'diamond_payout_data'])->name('diamond_payout_data');
        Route::get('/diamond_roi_gen_history', [DiamondPayoutController::class, 'diamond_roi_gen_history'])->name('diamond_roi_gen_history');
        Route::get('/diamond_roi_history_data', [DiamondPayoutController::class, 'diamond_roi_history_data'])->name('diamond_roi_history_data');

        Route::get('/diamond_payout_team', [DiamondPayoutController::class, 'diamond_payout_team'])->name('diamond_payout_team');

        //user cash report
        Route::get('/user_cash_report', [UserManagementController::class, 'user_cash_report'])->name('user_cash_report');
        Route::get('/user_cash_report_data', [UserManagementController::class, 'user_cash_report_data'])->name('user_cash_report_data');

        //Load Deposit
        Route::get('/load_deposit', [DepositController::class, 'load_deposit'])->name('load_deposit');
        Route::post('/deposit_form', [DepositController::class, 'deposit_form'])->name('deposit_form');

        Route::get('/load_history', [ViewsController::class, 'load_history'])->name('load_history');

        
        Route::get('/diamond_bdb_generate', [ViewsController::class, 'diamond_bdb_generate'])->name('diamond_bdb_generate');
        Route::get('/silver_roi_history', [ViewsController::class, 'silver_roi_history'])->name('silver_roi_history');
        Route::get('/diamond_roi_history', [ViewsController::class, 'diamond_roi_history'])->name('diamond_roi_history');
        // Route::get('/diamond_bdb_generate', [ViewsController::class, 'diamond_bdb_generate'])->name('diamond_bdb_generate');
        // Route::get('/diamond_bdb_generate', [ViewsController::class, 'diamond_bdb_generate'])->name('diamond_bdb_generate');


        //Bond
        Route::get('/ipl_bond', [BondController::class, 'ipl_bond'])->name('ipl_bond');
        Route::get('/bond_details/{roi_id}', [BondController::class, 'bond_details'])->name('bond_details');
        Route::post('/save_gold_bond', [BondController::class, 'save_gold_bond'])->name('save_gold_bond');
        Route::get('/print_bond', [BondController::class, 'print_bond'])->name('print_bond');



        Route::get('/paid_roi', [ViewsController::class, 'paid_roi'])->name('paid_roi');

        Route::get('/salary_report', [ViewsController::class, 'salary_report'])->name('salary_report');



        Route::get('/profit_report_silver', [ViewsController::class, 'profit_report_silver'])->name('profit_report_silver');

        Route::get('/block_roi_report', [ViewsController::class, 'block_roi_report'])->name('block_roi_report');

        Route::get('/diamond_gen', [ViewsController::class, 'diamond_gen'])->name('diamond_gen');
        Route::get('/salary_gen', [ViewsController::class, 'salary_gen'])->name('salary_gen');
        Route::get('/gold_gen', [ViewsController::class, 'gold_gen'])->name('gold_gen');
        Route::get('/salary_gen', [ViewsController::class, 'salary_gen'])->name('salary_gen');
        Route::get('/silver_gen', [ViewsController::class, 'silver_gen'])->name('silver_gen');
        Route::get('/salary_list', [ViewsController::class, 'salary_list'])->name('salary_list');
        Route::get('/level_gen', [ViewsController::class, 'level_gen'])->name('level_gen');




        //Silver Payout
        Route::get('/silver_payout', [ViewsController::class, 'silver_payout'])->name('silver_payout');
        Route::get('/silver_roi_gen_history', [ViewsController::class, 'silver_roi_gen_history'])->name('silver_roi_gen_history');


        Route::get('/silver_generate', [ViewsController::class, 'silver_generate'])->name('silver_generate');





        Route::get('/diamond_bob_payout', [ViewsController::class, 'diamond_bob_payout'])->name('diamond_bob_payout');
        Route::get('/diamond_bdb_gen_history', [ViewsController::class, 'diamond_bdb_gen_history'])->name('diamond_bdb_gen_history');
        Route::get('/diamond_bdb_payout_team', [ViewsController::class, 'diamond_bdb_payout_team'])->name('diamond_bdb_payout_team');

        Route::get('/diamond_level_gen_history', [ViewsController::class, 'diamond_level_gen_history'])->name('diamond_level_gen_history');
        Route::get('/diamond_level_payout', [ViewsController::class, 'diamond_level_payout'])->name('diamond_level_payout');
        Route::get('/diamond_level_payout_team', [ViewsController::class, 'diamond_level_payout_team'])->name('diamond_level_payout_team');
        Route::get('/diamond_generated_history', [ViewsController::class, 'diamond_generated_history'])->name('diamond_generated_history');
        Route::get('/reset_password', [ViewsController::class, 'reset_password'])->name('reset_password');


        Route::get('/gold_points', [ViewsController::class, 'gold_points'])->name('gold_points');
        Route::get('/wallet_history', [ViewsController::class, 'wallet_history'])->name('wallet_history');

        Route::get('/update_news', [ViewsController::class, 'update_news'])->name('update_news');


        Route::get('/diamond_request', [ViewsController::class, 'diamond_request'])->name('diamond_request');


        Route::get('/diamond_roi_gen', [ViewsController::class, 'diamond_roi_gen'])->name('diamond_roi_gen');


        Route::get('/diamond_bdb_gen', [ViewsController::class, 'diamond_bdb_gen'])->name('diamond_bdb_gen');


        Route::get('/product_wallet', [ViewsController::class, 'product_wallet'])->name('product_wallet');
        Route::get('/monthly_wallet', [ViewsController::class, 'monthly_wallet'])->name('monthly_wallet');
        Route::get('/product_wallet_history', [ViewsController::class, 'product_wallet_history'])->name('product_wallet_history');
        Route::get('/block_roi', [ViewsController::class, 'block_roi'])->name('block_roi');
        Route::get('/green_advance', [ViewsController::class, 'green_advance'])->name('green_advance');
        Route::get('/green_deposit_report', [ViewsController::class, 'green_deposit_report'])->name('green_deposit_report');
        Route::get('/view_application', [ViewsController::class, 'view_application'])->name('view_application');
    });
});


Route::prefix('user')->name('user.')->group(function () {
    Route::get('/login', [ViewController::class, 'login'])->name('login');
    Route::post('/login_form', [UserAuthController::class, 'login_form'])->name('login_form');


    Route::middleware(['checkuser'])->group(function () {
        Route::get('/logout_form', [UserAuthController::class, 'logout_form'])->name('logout_form');

        Route::get('/og3_dashboard', [ViewController::class, 'og3_dashboard'])->name('og3_dashboard');
        Route::get('/salary_report', [ViewController::class, 'salary_report'])->name('salary_report');
        Route::get('/salary', [ViewController::class, 'salary'])->name('salary');
        Route::get('/bdb', [ViewController::class, 'bdb'])->name('bdb');

        Route::get('/dashboard', [ViewController::class, 'dashboard'])->name('dashboard');
        Route::get('/reset_password', [ViewController::class, 'reset_password'])->name('reset_password');
        Route::get('/gold_dashboard', [ViewController::class, 'gold_dashboard'])->name('gold_dashboard');
        Route::get('/gold_deposit', [ViewController::class, 'gold_deposit'])->name('gold_deposit');
        Route::get('/gold_roi_income_report', [ViewController::class, 'gold_roi_income_report'])->name('gold_roi_income_report');
        Route::get('/silver_dashboard', [ViewController::class, 'silver_dashboard'])->name('silver_dashboard');
        Route::get('/silver_deposit', [ViewController::class, 'silver_deposit'])->name('silver_deposit');
        Route::get('/silver_roi_income_report', [ViewController::class, 'silver_roi_income_report'])->name('silver_roi_income_report');
        Route::get('/diamond_dashboard', [ViewController::class, 'diamond_dashboard'])->name('diamond_dashboard');
        Route::get('/diamond_deposit', [ViewController::class, 'diamond_deposit'])->name('diamond_deposit');
        Route::get('/diamond_roi_income_report', [ViewController::class, 'diamond_roi_income_report'])->name('diamond_roi_income_report');
        Route::get('/diamond_level_income', [ViewController::class, 'diamond_level_income'])->name('diamond_level_income');
        Route::get('/direct_team', [ViewController::class, 'direct_team'])->name('direct_team');
        Route::get('/level_team', [ViewController::class, 'level_team'])->name('level_team');
        Route::get('/og24_dashboard', [ViewController::class, 'og24_dashboard'])->name('og24_dashboard');
        Route::get('/vip_dashboard', [ViewController::class, 'vip_dashboard'])->name('vip_dashboard');
        Route::get('/application', [ViewController::class, 'application'])->name('application');
        // Route::get('/og24_dashboard', [ViewController::class, 'og24_dashboard'])->name('og24_dashboard');
        // Route::get('/og24_dashboard', [ViewController::class, 'og24_dashboard'])->name('og24_dashboard');

        Route::get('/product_wallet', [ViewController::class, 'product_wallet'])->name('product_wallet');
    });
});
