<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\ManageProfileController;
use App\Http\Controllers\Admin\ManageCustomerController;
use App\Http\Controllers\Admin\ManageRestrauntController;
use App\Http\Controllers\Admin\ManageSubAdminController;
use App\Http\Controllers\Admin\ManagePassportController;
use App\Http\Controllers\Admin\ManageVouchersController;
use App\Http\Controllers\Admin\ManageContactUsController;
use App\Http\Controllers\Admin\ManageNewsAndArticlesController;
use App\Http\Controllers\Admin\ManageNewsLetterController;
use App\Http\Controllers\Admin\AboutUsController;
use App\Http\Controllers\Admin\TermsController;
use App\Http\Controllers\Admin\FaqController;
use App\Http\Controllers\Admin\PrivacyPolicyController;
use App\Http\Controllers\Admin\ManageReportsController;
use App\Http\Controllers\Admin\ManageFeedbackController;
use App\Http\Controllers\Admin\ManageNotificationsController;
use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\ManageCmsController;
use App\Http\Controllers\Admin\RestaurantAppController;
use App\Http\Controllers\Admin\ManageLocationController;
use App\Http\Controllers\Admin\ManageRulesController;

Route::get('/', [LoginController::class, 'index'])->name('login');
Route::post('/check_login', [LoginController::class, 'login_check']);
Route::get('/forgot_password', [LoginController::class, 'forgot_password']);
Route::post('/send_otp', [LoginController::class, 'add_forgot_password']);
Route::get('/otp', [LoginController::class, 'otp_page']);
Route::post('/otp_verify', [LoginController::class, 'verify_otp']);
Route::get('/password_reset', [LoginController::class, 'reset_password_page']);
Route::post('/password_update', [LoginController::class, 'updatePassword']);
Route::get('/logout', [LoginController::class, 'logout'])->name('logout');


Route::group(['middleware' => ['checkStatus']], function () {


    Route::get('/dashboard', [DashboardController::class, 'showDashboard'])->name('dashboard');

    Route::get('/profile', [ManageProfileController::class, 'index'])->name('profile');
    Route::post('/update_profile', [ManageProfileController::class, 'update_profile'])->name('update.profile');

    //*******************************************************manage users********************************************************
    //*******************************************************manage customer********************************************************
    Route::get('/manage-customer', [ManageCustomerController::class, 'index'])->name('manage.customer');
    Route::get('/manage_customer_restaurant/{id}', [ManageCustomerController::class, 'manageCustomerRestaurants'])->name('customer_restaurant');
    Route::get('/manage_customer_view/{id}', [ManageCustomerController::class, 'view_customer']);
    Route::get('/manage_customer_edit/{id}', [ManageCustomerController::class, 'edit_customer']);
    Route::post('/update_customer', [ManageCustomerController::class, 'update']);
    Route::get('/manage_customer_archive', [ManageCustomerController::class, 'archive_customer'])->name('customer_archive');
    Route::delete('/manage_customer_archive/{id}', [ManageCustomerController::class, 'delete_customer']);
    Route::get('/create-pdf-file/{id}', [ManageCustomerController::class, 'download_pdf']);
    Route::post('/export_selected_customer', [ManageCustomerController::class, 'exportSelectedCustomer'])->name('export-selected-customer');
    Route::post('/manage_customer_unarchive/{id}', [ManageCustomerController::class, 'unarchive_customer']);

    //******************************************************* restraunts APP********************************************************

    // Route::get('/manage-restaurants_app', [RestaurantAppController ::class, 'index'])->name('manage.restaurants_app');
    // Route::get('/restraunt_users', [RestaurantAppController::class, 'index_restraunt_users'])->name('restraunt_users');
    Route::get('/restaurant_users', [RestaurantAppController::class, 'index_restraunt_users'])->name('restraunt_users');
    Route::get('/change_rest_status', [RestaurantAppController::class, 'change_rest_user_status']);

    Route::get('/view_restaurant_users/{id}', [RestaurantAppController::class, 'view_rest'])->name('restaurantViewUsers');
    Route::get('/edit_restaurant_users/{id}', [RestaurantAppController::class, 'edit_Restaurant'])->name('EditRestUsers');
    Route::post('/update_restaurant_users', [RestaurantAppController::class, 'updateRest']);
    Route::delete('/manage_restaurants_archive/{id}', [RestaurantAppController::class, 'delete_restaurants']);
    Route::get('/manage_restaurants_archive', [RestaurantAppController::class, 'archive_restaturant'])->name('archieve.rest');
    Route::post('/manage_restaurants_unarchive/{id}', [RestaurantAppController::class, 'unarchive_rest']);

    Route::post('/delete_restaurant_user/{id}', [RestaurantAppController::class, 'deleteRestaurantsUsers'])->name('deleteRestUser');

    //*******************************************************manage subadmin********************************************************
    Route::get('/manage-sub-admin', [ManageSubAdminController::class, 'index'])->name('manage.subAdmin');
    Route::get('/create_sub_admin', [ManageSubAdminController::class, 'create'])->name('manage.sub_admin_create');
    Route::post('/insert_sub_admin', [ManageSubAdminController::class, 'store_subadmin']);
    Route::delete('/manage_sub_admin/{id}', [ManageSubAdminController::class, 'delete_sub_admin']);
    Route::get('/edit_sub_admin/{id}', [ManageSubAdminController::class, 'edit'])->name('sub_admin_edit');
    Route::post('/update_sub_admin', [ManageSubAdminController::class, 'update_subadmin']);
    Route::get('/change_admin_status', [ManageSubAdminController::class, 'change_admin_status']);
    Route::get('/get_sub_admin_permission', [ManageSubAdminController::class, 'get_sub_admin_permission']);
    //*******************************************************manage passport********************************************************
    Route::get('/manage-passport', [ManagePassportController::class, 'index'])->name('manage.passport');
    //*******************************************************manage voucher********************************************************
    Route::get('/manage-vouchers', [ManageVouchersController::class, 'index'])->name('manage.voucher');
    //*******************************************************manage contact********************************************************
    Route::get('/manage-contact', [ManageContactUsController::class, 'index'])->name('manage.contact');
    Route::post('/send-reply', [ManageContactUsController::class, 'sendReply'])->name('send.reply');
    Route::post('/delete_user/{id}', [ManageContactUsController::class, 'delete_user'])->name('manage.contactus');


    //*******************************************************manage cms********************************************************
    Route::get('/manage-cms', [ManageCmsController::class, 'index'])->name('manage.cms');

    //*******************************************************manage new&article********************************************************
    Route::get('/manage-new-articles', [ManageNewsAndArticlesController::class, 'index'])->name('manage.Newarticles');
    Route::get('/change-article-Status', [ManageNewsAndArticlesController::class, 'change_news_article_Status']);
    Route::get('/manage_edit_news/{id}', [ManageNewsAndArticlesController::class, 'edit'])->name('manage_edit_news');
    Route::post('/manage_update_news', [ManageNewsAndArticlesController::class, 'update'])->name('manage_edit_news');
    Route::delete('/delete_article/{id}', [ManageNewsAndArticlesController::class, 'delete_newsarticle']);
    Route::get('/manage_add_news', [ManageNewsAndArticlesController::class, 'add'])->name('manage_add_news');
    Route::post('/manage_insert_news', [ManageNewsAndArticlesController::class, 'insert']);

    //*******************************************************manage newletter********************************************************

    Route::get('/manage-newsletter', [ManageNewsLetterController::class, 'index'])->name('manage.newLetter');
    //*******************************************************manage aboutus********************************************************
    Route::get('/add_about_us', [AboutUsController::class, 'add'])->name('about_us_add');
    Route::post('/insert_about_us', [AboutUsController::class, 'insert']);

    Route::get('/manage-about-us', [AboutUsController::class, 'index'])->name('manage.aboutUs');
    Route::get('/about_us_edit/{id}', [AboutUsController::class, 'edit'])->name('about_us_edit');
    Route::get('/about_us_rest/{id}', [AboutUsController::class, 'edit_rest'])->name('aboutusRestEdit');
    Route::post('/aboutus_cust_update', [AboutUsController::class, 'update_aboutUS_Cust']);
    Route::post('/aboutus_rest_update', [AboutUsController::class, 'update_aboutUS_Rest']);



    Route::post('/about_us_update', [AboutUsController::class, 'update']);
    Route::delete('/delete_about/{id}', [AboutUsController::class, 'delete_about']);
    Route::get('/change_Status', [AboutUsController::class, 'change_about_Status']);


    //*******************************************************manage terms********************************************************

    Route::get('/terms', [TermsController::class, 'index'])->name('manage.terms');
    Route::get('/terms_edit/{id}', [TermsController::class, 'edit'])->name('terms_edit');
    Route::post('/update_terms', [TermsController::class, 'update']);
    Route::get('/terms_edit_rest/{id}', [TermsController::class, 'editTerms_rest'])->name('terms_edit_rest');
    Route::post('/update_terms_rest', [TermsController::class, 'update_rest']);

    //*******************************************************manage faq********************************************************
    Route::get('/faq', [FaqController::class, 'index'])->name('manage.faq');
    Route::get('/change_faq_Status', [FaqController::class, 'change_faqStatus']);
    Route::delete('/delete_faq/{id}', [FaqController::class, 'delete_faq']);
    Route::post('/update_faq', [FaqController::class, 'update'])->name('manage_edit_faq');
    Route::post('/store_faq', [FaqController::class, 'store'])->name('store_faq');


    //*******************************************************manage privacypolicy********************************************************
    Route::get('/privacy', [PrivacyPolicyController::class, 'index'])->name('manage.privacy');
    Route::get('/privacy_edit/{id}', [PrivacyPolicyController::class, 'edit'])->name('privacy_edit');
    Route::get('/privacy_edit_rest/{id}', [PrivacyPolicyController::class, 'edit_rest'])->name('privacy_edit_rest');
    Route::post('/privacy_policy_update', [PrivacyPolicyController::class, 'update']);
    Route::post('/privacy_policy_update_rest', [PrivacyPolicyController::class, 'update_rest']);


    //*******************************************************manage reports********************************************************
    Route::get('/manage-reports', [ManageReportsController::class, 'index'])->name('manage.reports');
    //*******************************************************manage feedback********************************************************
    Route::get('/manage-feedback', [ManageFeedbackController::class, 'index'])->name('manage.feedback');
    Route::post('/delete_feedback/{id}', [ManageFeedbackController::class, 'delete_feedback'])->name('delete.feedback');
    Route::post('/export_selected_feedback', [ManageFeedbackController::class, 'exportSelectedFeedback'])->name('export-selected-feedback');


    //*******************************************************manage notification********************************************************
    Route::get('/manage-notification', [ManageNotificationsController::class, 'index'])->name('manage.notification');
    Route::get('/manage_add_notifications', [ManageNotificationsController::class, 'add'])->name('manage_add_notifications');
    Route::post('/insert_notification', [ManageNotificationsController::class, 'store_notificaton_data']);
    Route::get('/manage_view_notifications/{id}', [ManageNotificationsController::class, 'view']);



    //*******************************************************manage restraunts********************************************************
    Route::get('/manage-restaurants', [ManageRestrauntController::class, 'index'])->name('manage.restaurants');
    Route::get('/manage_restaurant_add', [ManageRestrauntController::class, 'add'])->name('add_manage_restraunt');
    Route::post('/store_restaurant', [ManageRestrauntController::class, 'store_restaurant']);
    Route::get('/edit_restaurant/{id}', [ManageRestrauntController::class, 'edit_restaurant'])->name('edit_restaurant');
    Route::post('/update_restaurant', [ManageRestrauntController::class, 'update'])->name('update_restaurant');
    Route::get('/manage_view_restaurant/{id}', [ManageRestrauntController::class, 'viewRestaurant'])->name('manage_view_restaurant');
    Route::post('/update_status_of_restaurant', [ManageRestrauntController::class, 'updateRestaurantStatus'])->name('update_status_of_restaurant');
    Route::post('/delete_restaurant/{id}', [ManageRestrauntController::class, 'deleteRestaurant'])->name('delete_restaurant');
    Route::get('/manage_restaurant_archive', [ManageRestrauntController::class, 'archive_restaurant'])->name('restaurant_archive');
    Route::delete('/manage_restaurant_archive/{id}', [ManageRestrauntController::class, 'archive_delete_restaurant']);
    Route::post('/manage_restaurant_unarchive/{id}', [ManageRestrauntController::class, 'unarchive_restaurant'])->name('restaurant_unarchive');
    Route::post('/export_selected_restaurant', [ManageRestrauntController::class, 'exportSelectedRestaurant'])->name('export-selected-restaurant');

    //*******************************************************manage location********************************************************

    Route::get('/manage_location', [ManageLocationController::class, 'index'])->name('manage_location');
    Route::post('/insert_location', [ManageLocationController::class, 'store'])->name('store_location');
    Route::get('/change_location_status', [ManageLocationController::class, 'change_location_status']);
    Route::delete('/delete_location/{id}', [ManageLocationController::class, 'delete_location']);
    Route::post('/update_location', [ManageLocationController::class, 'update']);

    //*******************************************************Rules and regulation********************************************************
    Route::get('/manage_rules', [ManageRulesController::class, 'index'])->name('manage_rules');
    Route::get('/rules_edit/{id}', [ManageRulesController::class, 'edit'])->name('rules_edit');
    Route::post('/update_rules', [ManageRulesController::class, 'update']);


});
