<?php

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 within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/','MainController@index');

//navigating to projects
Route::get('projects','MainController@project_index');

//navigating to contact us
Route::get('contacts','MainController@contact_index');

//navigating to gallery
Route::get('photo_gallery','MainController@gallery_index');

//navigating to membership
Route::get('membership','MainController@membership_index');

//navigating to membership
Route::get('about','MainController@about_index');

//navigating to strategic
Route::get('strategic','MainController@strategic_index');

//navigating to proceeding
Route::get('proceeding','MainController@proceeding_index');

//navigating to directory
Route::get('directory','MainController@directory_index');

//subscribed users
Route::resource('subscribed','backend\SubscribedController');

//comments
Route::resource('comments','backend\CommentController');

//online registration
Route::resource('member_registration','backend\MemberRegistrationController');

//Privacy Policy
Route::get('privacy','MainController@privacy_index');

//questions answers
Route::get('faq','MainController@faq_index');

//Online services
Route::resource('online_services','backend\OnlineServiceController');

//route to handle abstract conference
Route::get('conference_abstract','backend\ConferenceAbstractController@abstract_index');
Route::post('conference_abstract/store','backend\ConferenceAbstractController@abstract_store')->name('conference_abstract.store');

//member record update
Route::resource('membership_record_update','backend\MembershipRecordUpdateController');
Route::post('membership_record_update','backend\MembershipRecordUpdateController@store')->name('membership_record_update.store');
Route::post('membership_record_update/check','backend\MembershipRecordUpdateController@check_status')->name('membership_record_update.check_status');

//Member Payment
Route::resource('member_payment','backend\MemberPaymentController');

Auth::routes();

Route::get('/admin',function(){
    return redirect('login');
});


Route::group(['middleware' => ['auth']], function () {
    
    Route::get('/home', 'HomeController@index')->name('home');

    //social network 
    Route::resource('social_network','backend\SocialNetworkController');
    Route::post('social_network/store','backend\SocialNetworkController@store')->name('social_network.store');
    Route::post('social_network/edit','backend\SocialNetworkController@update')->name('social_network.update');

    //contact detail
    Route::resource('contact_detail','backend\ContactDetailController');
    Route::post('contact_detail/store','backend\ContactDetailController@store')->name('contact_detail.store');
    Route::post('contact_detail/edit','backend\ContactDetailController@update')->name('contact_detail.update');

    //privacy policy
    Route::resource('privacy_policy','backend\PrivacyPolicyController');
    Route::post('privacy_policy/store','backend\PrivacyPolicyController@store')->name('privacy_policy.store');
    Route::post('privacy_policy/edit','backend\PrivacyPolicyController@update')->name('privacy_policy.update');

    //projects conducted
    Route::resource('all_project','backend\ProjectController');
    Route::post('all_project/store','backend\ProjectController@store')->name('all_project.store');
    Route::post('all_project/edit','backend\ProjectController@update')->name('all_project.update');
    Route::get('all_project/destroy/{id}','backend\ProjectController@destroy');
    Route::get('current_project','backend\ProjectController@current_project');
    Route::get('past_project','backend\ProjectController@past_project');

    //membership types
    Route::resource('membership_types','backend\MembershipTypeController');
    Route::post('membership_types/store','backend\MembershipTypeController@store')->name('membership_types.store');
    Route::post('membership_types/edit','backend\MembershipTypeController@update')->name('membership_types.update');
    Route::get('membership_types/destroy/{id}','backend\MembershipTypeController@destroy');

    //Events Category
    Route::resource('events_category','backend\EventsCategoryController');
    Route::post('events_category/edit','backend\EventsCategoryController@update')->name('events_category.update');
    Route::get('events_category/destroy/{id}','backend\EventsCategoryController@destroy');

    //Events Manage Controller
    Route::resource('manage_events','backend\EventManageController');
    Route::post('manage_events/edit','backend\EventManageController@update')->name('manage_events.update');
    Route::get('manage_events/destroy/{id}','backend\EventManageController@destroy');

    //About General Controller
    Route::resource('about_general','backend\AboutGeneralController');
    Route::post('about_general/edit','backend\AboutGeneralController@update')->name('about_general.update');
    Route::get('about_general/destroy/{id}','backend\AboutGeneralController@destroy');

    //About Management Controller
    Route::resource('about_management','backend\AboutManagementController');
    Route::post('about_management/edit','backend\AboutManagementController@update')->name('about_management.update');
    Route::get('about_management/destroy/{id}','backend\AboutManagementController@destroy');

    //Question Controller
    Route::resource('questions_answers','backend\QuestionController');
    Route::post('questions_answers/edit','backend\QuestionController@update')->name('questions_answers.update');
    Route::get('questions_answers/destroy/{id}','backend\QuestionController@destroy');

    //Gallery Controller
    Route::resource('gallery','backend\GalleryController');
    Route::post('gallery/edit','backend\GalleryController@update')->name('gallery.update');
    Route::get('gallery/destroy/{id}','backend\GalleryController@destroy');

    //Slider Controller
    Route::resource('slider','backend\SliderController');
    Route::post('slider/edit','backend\SliderController@update')->name('slider.update');
    Route::get('slider/destroy/{id}','backend\SliderController@destroy');

    //publication strategic
    Route::resource('admin_strategic','backend\PublicationStrategicController');
    Route::post('admin_strategic/post','backend\PublicationStrategicController@update')->name('admin_strategic.strategic_update');
    Route::get('admin_strategic/destroy/{id}','backend\PublicationStrategicController@destroy');

    //publication proceeding
    Route::resource('admin_proceeding','backend\PublicationProceedingController');
    Route::post('admin_proceeding/post','backend\PublicationProceedingController@update')->name('admin_proceeding.proceeding_update');
    Route::get('admin_proceeding/destroy/{id}','backend\PublicationProceedingController@destroy');

    //publication directory
    Route::resource('admin_directory','backend\PublicationDirectoryController');
    Route::post('admin_directory/post','backend\PublicationDirectoryController@update')->name('admin_directory.directory_update');
    Route::get('admin_directory/destroy/{id}','backend\PublicationDirectoryController@destroy');

    //welcome message
    Route::resource('welcome','backend\WelcomeMessageController');
    Route::post('welcome/edit','backend\WelcomeMessageController@update')->name('welcome.update');

    //subscribed users
    Route::get('subscribed/destroy/{id}','backend\SubscribedController@destroy');
    Route::get('subscribed/approve/{id}','backend\SubscribedController@approve');
    Route::get('subscribed/block/{id}','backend\SubscribedController@block');

    //deleting comments
    Route::get('comments/destroy/{id}','backend\CommentController@destroy');
    Route::post('comments/post','backend\CommentController@previewed')->name('comments.previewed');

    //member registration
    Route::post('member_registration/edit','backend\MemberRegistrationController@update')->name('member_registration.update');
    Route::post('member_registration/approve','backend\MemberRegistrationController@approve')->name('member_registration.approve');
    Route::get('member_registration/destroy/{id}','backend\MemberRegistrationController@destroy');

    //member payments
    Route::post('member_payment/edit','backend\MemberPaymentController@update')->name('member_payment.update');
    Route::get('member_payment/approve/{id}','backend\MemberPaymentController@approve');
    Route::get('member_payment/destroy/{id}','backend\MemberPaymentController@destroy');

    //Affiliates
    Route::resource('admin_affiliates','backend\AffiliateController');
    Route::post('admin_affiliates/edit','backend\AffiliateController@update')->name('admin_affiliates.update');
    Route::get('admin_affiliates/destroy/{id}','backend\AffiliateController@destroy');

    //profile controller
    Route::resource('admin_profile','backend\AdminProfileController');
    Route::post('admin_profile/edit','backend\AdminProfileController@update')->name('admin_profile.update');

    //payment modules
    Route::resource('payment_modules','backend\PaymentModuleController');
    Route::post('payment_modules/edit','backend\PaymentModuleController@update')->name('payment_modules.update');
    Route::get('payment_modules/destroy/{id}','backend\PaymentModuleController@destroy');

    //report controller
    Route::get('report','backend\ReportController@index');
    Route::post('report','backend\ReportController@processing')->name('report.processing');

    //online services
    Route::get('online_services/destroy/{id}','backend\OnlineServiceController@destroy');

    //membership record update
    Route::post('membership_record_update/edit','backend\MembershipRecordUpdateController@update')->name('membership_record_update.update_data');
    Route::get('membership_record_update/destroy/{id}','backend\MembershipRecordUpdateController@destroy');

    //function to handle the submission of conference abstract
    Route::get('admin_conference_abstract','backend\ConferenceAbstractController@admin_conference_abstract');
    Route::get('admin_conference_abstract/edit/{id}','backend\ConferenceAbstractController@admin_conference_abstract_edit');
    Route::post('admin_conference_abstract/update','backend\ConferenceAbstractController@admin_conference_abstract_update')->name('admin_conference_abstract.update');
    Route::get('admin_conference_abstract/destroy/{id}','backend\ConferenceAbstractController@admin_conference_abstract_destroy');
    Route::get('admin_conference_abstract/preview/{id}','backend\ConferenceAbstractController@admin_conference_abstract_preview');
});

 //routes not available
    Route::get('{path}','MainController@index')->where( 'path', '([A-z\d\-/_.]+)?' );
