<?php

namespace Config;

// Create a new instance of our RouteCollection class.
$routes = Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}

/*
 * --------------------------------------------------------------------
 * Router Setup
 * --------------------------------------------------------------------
 */
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override(function() {
    return view('front/main_site/404');
});
$routes->setAutoRoute(true);

/*
 * --------------------------------------------------------------------
 * Route Definitions
 * --------------------------------------------------------------------
 */

// We get a performance increase by specifying the default
// route since we don't have to scan directories.
$routes->add('admin-login', 'Auth::login');
$routes->add('admin', 'Auth::login');
$routes->add('login', 'Auth::login');
$routes->post('submit_login', 'Auth::submit_login');
$routes->add('/', 'Home::index');
$routes->add('about-us', 'Home::about_us');
$routes->add('event-details/(:any)', 'Home::event_details/$1');
$routes->add('event', 'Home::all_event');
$routes->add('join-us', 'Home::join_us');
$routes->add('details-blog/(:any)', 'Home::details_blog/$1');
$routes->add('blog-category/(:any)', 'Home::blog_category/$1');
$routes->get('blog', 'Home::all_blog');
$routes->get('blog-details/(:any)', 'Home::blog_details/$1');
$routes->get('case-details/(:any)', 'Home::case_details/$1');
$routes->get('featured-project-details/(:any)', 'Home::featured_project_details/$1');
// $routes->post('submit_donation', 'Home::submit_donation');
$routes->post('submit_donation', 'Home::submit_donation_2');
$routes->post('rozr_pay_verify_donation', 'Home::rozr_pay_verify_donation');
$routes->post('submit_join_us_form', 'Home::submit_join_us_form');
$routes->get('gallery/image', 'Home::all_img_gallery');
$routes->get('gallery/video', 'Home::all_img_video');
$routes->get('donate-now', 'Home::donate_now');
$routes->get('media_corner', 'Home::media_corner');
$routes->get('projects', 'Home::all_projects');
$routes->get('what-we-do', 'Home::what_we_do');
$routes->post('subscriber', 'Home::subscriber');
$routes->get('payment-success', 'Home::payment_success');
$routes->get('download-receipt', 'Home::download_receipt');
$routes->get('contact', 'Home::contact');
$routes->get('joining', 'Home::joining');
$routes->get('p/(:any)', 'Home::extra_page_details/$1');
$routes->get('member/our-core-team', 'Home::our_core_team');
$routes->get('member/our-founders', 'Home::our_founders');


$routes->group('admin', ['filter' => 'auth'], function ($routes) {
    $routes->add('dashboard', 'Admin\Admin::index');
    $routes->add('update_profile', 'Admin\Setting::update_profile');
    $routes->post('update_profile_details', 'Admin\Setting::update_profile_details');
    $routes->get('check_current_password/(:any)', 'Admin\Setting::check_current_password/$1');
    $routes->add('update_password', 'Admin\Setting::update_password');
    $routes->post('update_profile_details_password', 'Admin\Setting::update_profile_details_password');
    $routes->get('logout', 'Admin\Admin::logout');
    $routes->get('update_stock_point', 'Admin\Setting::update_stock_point');
    $routes->post('update_stock_point_data', 'Admin\Setting::update_stock_point_data');
    

    $routes->group('user', function ($routes) {
        $routes->get('role_permission', 'Admin\User::role_permission');
        $routes->post('add_new_role', 'Admin\User::add_new_role');
        $routes->get('edit_permission/(:num)', 'Admin\User::edit_permission/$1');
        $routes->post('update_role_permission/(:num)', 'Admin\User::update_role_permission/$1');
        $routes->delete('delete_role_permission/(:num)', 'Admin\User::delete_role_permission/$1');
        $routes->get('login_user/(:num)', 'Admin\User::login_user/$1');
        $routes->get('get_user_details_by_role/(:any)', 'Admin\User::get_user_details_by_role/$1');
        $routes->get('check_user_gst_by_id/(:any)', 'Admin\User::check_user_gst_by_id/$1');
    });

    $routes->group('email', function ($routes) {
        $routes->get('send_email/(:num)/(:num)', 'Admin\Email::send_email/$1/$2');
        $routes->post('send_new_email', 'Admin\Email::send_new_email');
        $routes->get('sending_email', 'Admin\Email::sending_email');
        $routes->post('send_all_email', 'Admin\Email::send_all_email');
        
    });

    

    $routes->group('report', function ($routes) {
        $routes->get('all_donation_report', 'Admin\Report::all_donation_report');
        $routes->get('all_volunteer_report', 'Admin\Report::all_volunteer_report');
        $routes->get('all_subscribers_report', 'Admin\Report::all_subscribers_report');
    });

    $routes->group('blog', function ($routes) {
        $routes->get('blog_category', 'Admin\Blog::blog_category');
        $routes->post('add_new_category', 'Admin\Blog::add_new_category');
        $routes->add('update_blog_category/(:num)', 'Admin\Blog::update_blog_category/$1');
        $routes->delete('delete_category/(:num)', 'Admin\Blog::delete_category/$1');
        $routes->add('add_new_blog', 'Admin\Blog::add_new_blog');
        $routes->post('new_blog_add', 'Admin\Blog::new_blog_add');
        $routes->get('view_all_blog', 'Admin\Blog::view_all_blog');
        $routes->add('update_blog/(:num)', 'Admin\Blog::update_blog/$1');
        $routes->add('update_blog_new/(:num)', 'Admin\Blog::update_blog_new/$1');
        $routes->delete('delete_blog/(:num)', 'Admin\Blog::delete_blog/$1');
        $routes->get('view_all_comment', 'Admin\Blog::view_all_comment');
        $routes->delete('delete_blog_review/(:num)', 'Admin\Blog::delete_blog_review/$1');
    });
    $routes->group('home_setting', function ($routes) {
        $routes->get('slider/', 'Admin\HomeSetting::get_all_home_slider');
        $routes->add('add_new_slider/', 'Admin\HomeSetting::add_new_slider');
        $routes->post('new_slider_add/', 'Admin\HomeSetting::new_slider_add');
        $routes->get('edit_slider/(:num)', 'Admin\HomeSetting::edit_slider/$1');
        $routes->post('update_slider/(:num)', 'Admin\HomeSetting::update_slider/$1');
        $routes->get('delete_slider/(:num)', 'Admin\HomeSetting::delete_slider/$1');
        $routes->get('change_status/(:num)/(:num)', 'Admin\HomeSetting::change_status/$1/$2');
        $routes->get('pages', 'Admin\HomeSetting::pages');
        $routes->get('delete_page/(:num)', 'Admin\HomeSetting::delete_page/$1');
        $routes->post('update_page/(:num)', 'Admin\HomeSetting::update_page/$1');
        $routes->post('add_new_page', 'Admin\HomeSetting::add_new_page');
        $routes->get('all_banner', 'Admin\HomeSetting::all_banner');
        $routes->get('add_new_banner', 'Admin\HomeSetting::add_new_banner');
        $routes->post('add_banner', 'Admin\HomeSetting::add_banner');
        $routes->get('delete_banner/(:num)', 'Admin\HomeSetting::delete_banner/$1');
        $routes->get('edit_banner/(:num)', 'Admin\HomeSetting::edit_banner/$1');
        $routes->post('update_banner/(:num)', 'Admin\HomeSetting::update_banner/$1');
    });

    $routes->group('main_page_setting', function ($routes) {
        $routes->get('slider/', 'Admin\MainpageSetting::get_all_home_slider');
        $routes->add('add_new_slider/', 'Admin\MainpageSetting::add_new_slider');
        $routes->post('new_slider_add/', 'Admin\MainpageSetting::new_slider_add');
        $routes->get('edit_slider/(:num)', 'Admin\MainpageSetting::edit_slider/$1');
        $routes->post('update_slider/(:num)', 'Admin\MainpageSetting::update_slider/$1');
        $routes->get('delete_slider/(:num)', 'Admin\MainpageSetting::delete_slider/$1');
        $routes->get('change_status/(:num)/(:num)', 'Admin\MainpageSetting::change_status/$1/$2');
        $routes->get('slider_stats', 'Admin\MainpageSetting::get_all_slider_stats');
        $routes->get('add_new_slider_stats', 'Admin\MainpageSetting::add_new_slider_stats');
        $routes->post('new_slider_stats_add/', 'Admin\MainpageSetting::new_slider_stats_add');
        $routes->get('edit_slider_stats/(:num)', 'Admin\MainpageSetting::edit_slider_stats/$1');
        $routes->post('update_slider_stats/(:num)', 'Admin\MainpageSetting::update_slider_stats/$1');
        $routes->get('delete_slider_stats/(:num)', 'Admin\MainpageSetting::delete_slider_stats/$1');
        $routes->get('short_about_us', 'Admin\MainpageSetting::shoart_about_us');
        $routes->post('update_short_description/', 'Admin\MainpageSetting::update_short_description');
        $routes->get('all_testimonials', 'Admin\MainpageSetting::all_testimonials');
        $routes->get('add_new_testimonials', 'Admin\MainpageSetting::add_new_testimonials');
        $routes->post('new_testimonials_add', 'Admin\MainpageSetting::new_testimonials_add');
        $routes->get('edit_testimonials/(:num)', 'Admin\MainpageSetting::edit_testimonials/$1');
        $routes->post('update_testimonials_add/(:num)', 'Admin\MainpageSetting::update_testimonials_add/$1');
        $routes->get('delete_testimonials/(:num)', 'Admin\MainpageSetting::delete_testimonials/$1');
        $routes->get('slide_content', 'Admin\MainpageSetting::slide_content');
        $routes->get('add_new_slide_content', 'Admin\MainpageSetting::add_new_slide_content');
        $routes->post('new_slide_content/', 'Admin\MainpageSetting::new_slide_content');
        $routes->get('edit_slide_content/(:num)', 'Admin\MainpageSetting::edit_slide_content/$1');
        $routes->post('new_slide_content_update/(:num)', 'Admin\MainpageSetting::new_slide_content_update/$1');
        $routes->get('delete_slide_content/(:num)', 'Admin\MainpageSetting::delete_slide_content/$1');
        $routes->get('counting_stats', 'Admin\MainpageSetting::counting_stats');
        $routes->post('update_counting_stats', 'Admin\MainpageSetting::update_counting_stats');
        $routes->get('latest_case', 'Admin\MainpageSetting::latest_case');
        $routes->get('add_new_case', 'Admin\MainpageSetting::add_new_case');
        $routes->post('new_case_add', 'Admin\MainpageSetting::new_case_add');
        $routes->get('edit_case/(:num)', 'Admin\MainpageSetting::edit_case/$1');
        $routes->post('update_case/(:num)', 'Admin\MainpageSetting::update_case/$1');
        $routes->get('delete_case/(:num)', 'Admin\MainpageSetting::delete_case/$1');
        $routes->get('all_event', 'Admin\MainpageSetting::all_event');
        $routes->get('add_new_event', 'Admin\MainpageSetting::add_new_event');
        $routes->post('new_event_add', 'Admin\MainpageSetting::new_event_add');
        $routes->get('edit_event/(:num)', 'Admin\MainpageSetting::edit_event/$1');
        $routes->post('update_event/(:num)', 'Admin\MainpageSetting::update_event/$1');
        $routes->get('delete_event/(:num)', 'Admin\MainpageSetting::delete_event/$1');
        $routes->get('gallery', 'Admin\MainpageSetting::gallery');
        $routes->get('add_gallery_item', 'Admin\MainpageSetting::add_gallery_item');
        $routes->post('add_new_gallery_item', 'Admin\MainpageSetting::add_new_gallery_item');
        $routes->get('edit_gallery/(:num)', 'Admin\MainpageSetting::edit_gallery/$1');
        $routes->post('update_gallery_item/(:num)', 'Admin\MainpageSetting::update_gallery_item/$1');
        $routes->get('delete_gallery/(:num)', 'Admin\MainpageSetting::delete_gallery/$1');
        $routes->get('featured_project', 'Admin\MainpageSetting::featured_project');
        $routes->get('add_new_project', 'Admin\MainpageSetting::add_new_project');
        $routes->post('new_featured_project_add', 'Admin\MainpageSetting::new_featured_project_add');
        $routes->get('edit_featured_project/(:num)', 'Admin\MainpageSetting::edit_featured_project/$1');
        $routes->post('featured_project_update/(:num)', 'Admin\MainpageSetting::featured_project_update/$1');
        $routes->get('delete_featured_project/(:num)', 'Admin\MainpageSetting::delete_featured_project/$1');
        $routes->get('became_a_volunteer', 'Admin\MainpageSetting::became_a_volunteer');
        $routes->post('update_became_a_volunteer/(:any)', 'Admin\MainpageSetting::update_became_a_volunteer/$1');
        $routes->get('heading_sub_heading', 'Admin\MainpageSetting::heading_sub_heading');
        $routes->post('update_heading_sub_heading', 'Admin\MainpageSetting::update_heading_sub_heading');
        $routes->post('update_about_page_overview_en', 'Admin\MainpageSetting::update_about_page_overview_en');
        $routes->post('update_about_page_overview_hi', 'Admin\MainpageSetting::update_about_page_overview_hi');

        $routes->post('add_new_gallery_category', 'Admin\MainpageSetting::add_new_gallery_category');
        $routes->get('delete_gallery_category/(:num)', 'Admin\MainpageSetting::delete_gallery_category/$1');
        $routes->post('update_gallery_category/(:num)', 'Admin\MainpageSetting::update_gallery_category/$1');
        
        $routes->get('media_corner', 'Admin\MainpageSetting::media_corner');
        $routes->post('add_new_media_category', 'Admin\MainpageSetting::add_new_media_category');
        $routes->get('delete_media_category/(:num)', 'Admin\MainpageSetting::delete_media_category/$1');
        $routes->post('update_media_category/(:num)', 'Admin\MainpageSetting::update_media_category/$1');
        $routes->get('delete_media_corner/(:num)', 'Admin\MainpageSetting::delete_media_corner/$1');
        $routes->get('add_media_corner_item', 'Admin\MainpageSetting::add_media_corner_item');
        $routes->post('add_new_media_corner_gallery', 'Admin\MainpageSetting::add_new_media_corner_gallery');
        $routes->get('add_new_brand', 'Admin\MainpageSetting::add_new_brand');
        $routes->post('add_brand', 'Admin\MainpageSetting::add_brand');
        $routes->get('view_all_brand', 'Admin\MainpageSetting::view_all_brand');
        $routes->get('delete_brand/(:num)', 'Admin\MainpageSetting::delete_brand/$1');
        $routes->get('edit_brand/(:num)', 'Admin\MainpageSetting::edit_brand/$1');
        $routes->post('update_brand/(:num)', 'Admin\MainpageSetting::update_brand/$1');

        $routes->get('all_pages', 'Admin\MainpageSetting::all_pages');
        $routes->get('add_new_page', 'Admin\MainpageSetting::add_new_page');
        $routes->post('new_page_add', 'Admin\MainpageSetting::new_page_add');
        $routes->get('edit_page/(:num)', 'Admin\MainpageSetting::edit_page/$1');
        $routes->get('delete_page/(:num)', 'Admin\MainpageSetting::delete_page/$1');
        $routes->post('update_page/(:num)', 'Admin\MainpageSetting::update_page/$1');

        $routes->get('add_new_legal_document', 'Admin\MainpageSetting::add_new_legal_document');
        $routes->post('new_legal_document_add', 'Admin\MainpageSetting::new_legal_document_add');
        $routes->get('edit_legal_document/(:num)', 'Admin\MainpageSetting::edit_legal_document/$1');
        $routes->post('update_legal_document/(:num)', 'Admin\MainpageSetting::update_legal_document/$1');
        $routes->get('delete_legal_document/(:num)', 'Admin\MainpageSetting::delete_legal_document/$1');
        $routes->post('update_section_heading', 'Admin\MainpageSetting::update_section_heading');
    
        $routes->get('menu_name_setting', 'Admin\MainpageSetting::menu_name_setting');
        $routes->post('update_menu_name/(:any)', 'Admin\MainpageSetting::update_menu_name/$1');


        $routes->get('our_all_founders', 'Admin\MainpageSetting::our_all_founders');
        $routes->get('add_new_founder', 'Admin\MainpageSetting::add_new_founder');
        $routes->post('add_founder', 'Admin\MainpageSetting::add_founder');
        $routes->get('edit_founder/(:num)', 'Admin\MainpageSetting::edit_founder/$1');
        $routes->post('update_founder/(:num)', 'Admin\MainpageSetting::update_founder/$1');
        $routes->get('delete_founder/(:num)', 'Admin\MainpageSetting::delete_founder/$1');

        $routes->get('our_core_team', 'Admin\MainpageSetting::our_core_team');
        $routes->get('add_new_core_team', 'Admin\MainpageSetting::add_new_core_team');
        $routes->post('add_core_team', 'Admin\MainpageSetting::add_core_team');
        $routes->get('edit_core_team/(:num)', 'Admin\MainpageSetting::edit_core_team/$1');
        $routes->post('update_core_team/(:num)', 'Admin\MainpageSetting::update_core_team/$1');
        $routes->get('delete_core_team/(:num)', 'Admin\MainpageSetting::delete_core_team/$1');
        
        
    });

   
    $routes->group('contact_message', function ($routes) {
        $routes->add('/', 'Admin\ContactMessage::index');
        $routes->add('delete_message/(:num)', 'Admin\ContactMessage::delete_message/$1');
        $routes->post('send_email/(:num)', 'Admin\ContactMessage::send_email/$1');
    });

    $routes->group('setting', function ($routes) {
        $routes->add('application_setting', 'Admin\Setting::app_setting');
        $routes->put('update_application_setting', 'Admin\Setting::update_application_setting');
        $routes->add('visual_setting', 'Admin\Setting::visual_setting');
        $routes->put('update_visual_setting', 'Admin\Setting::update_visual_setting');
        
        
    });
});

/*
 * --------------------------------------------------------------------
 * Additional Routing
 * --------------------------------------------------------------------
 *
 * There will often be times that you need additional routing and you
 * need it to be able to override any defaults in this file. Environment
 * based routes is one such time. require() additional route files here
 * to make that happen.
 *
 * You will have access to the $routes object within that file without
 * needing to reload it.
 */
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
    require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}
