<?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!
|
 */
//if($_SERVER['REMOTE_ADDR']=='103.236.135.34'){
//	config(['app.debug' => true]);
//}

Route::any('/upgrade/org','OrgController@index');	

Route::group(['middleware' => 'check_node'], function () {
	//Route::get('/{nid}', function ($id) {})->where(['id' => '[0-9]+']);
    Route::get('/node/{nid}/{name?}/{title?}', function ($id) {})->where(['id' => '[0-9]+']);
    Route::get('/{nid}/article/{name?}', function ($id) {})->where(['id' => '[0-9]+']);    
	Route::get('/{nid}/volume/{number?}', function ($id) {})->where(['id' => '[0-9]+']);
    Route::get('/{nid}/chapter/{name?}', function ($id, $name = null) {})->where(['id' => '[0-9]+']);	
	Route::get('/{nid}/journal/{name?}', function ($id) {})->where(['id' => '[0-9]+']);

    /*Route::get('{nid}/{name?}', function ($id, $name = null)
{})->where(['id' => '[0-9]+', 'name' => '[a-z]+']);*/

});


Auth::routes();
/*
@   Back end routes for Administrative purpose only with middle ware permissions

 */
Route::group(['prefix' => 'admin', 'middleware' => 'admin'], function () {

    Route::get('{id}/lockscreen', 'UserController@lockscreen')->name('lockscreen');
    // Route::post('{id}/lockscreen', 'UserController@postLockscreen')->name('lockscreen');

    Route::get('/dashboard', 'HomeController@AdminDashboard')->name('admin.dashboard');

    /*
    @   User module routes with middle ware permissions

     */
    Route::resource('/users', 'UserController', ['middleware' => 'accessPermission:users']);
    Route::get('/users/{userid}/permissions', 'UserController@AssignRole', ['middleware' => 'accessPermission:permissions'])->name('users.permissions');
    Route::put('/users/{userid}/permissions/add', 'UserController@AddRolePermission', ['middleware' => 'accessPermission:permissions']);
    Route::any('/get_institution_with_ajax', 'UserController@GetInstitutionWithAjax', ['middleware' => 'accessPermission:permissions'])->name('get_institution_with_ajax');

    /*
    @   Create Site Data routes with middle ware permissions
     */

    Route::resource('/pharmacy_collection', 'PharmacyCollectionController', ['middleware' => 'accessPermission:pharmacy_collection']);
    Route::resource('/subject', 'SubjectController', ['middleware' => 'accessPermission:subject']);
    Route::resource('/journals', 'JournalController', ['middleware' => 'accessPermission:journal']);
    Route::post('/managemultilang', 'JournalController@manageMultilang', ['middleware' => 'accessPermission:journal']);
    Route::any('/journalsection', 'JournalController@ManageJournalSection', ['middleware' => 'accessPermission:journal']);
    Route::resource('/ebook', 'EbookController', ['middleware' => 'accessPermission:ebook']);
    Route::resource('/volumes', 'VolumeController', ['middleware' => 'accessPermission:volume']);
    Route::resource('/ebook_volume', 'EbookVolumeController', ['middleware' => 'accessPermission:ebook_volume']);
    Route::resource('/issue', 'IssueController', ['middleware' => 'accessPermission:issue']);

    /**************************************************************************************************
    *   MUTI-LANGUAGE ARTICLE ROUTE
    ***************************************************************************************************/

    // to delete language against article
    Route::delete('/article/language/delete/{language_id}', 'ArticleController@destroyArticleLanguage', ['middleware' => 'accessPermission:article'])->name('article.language.destroy');
    // ANGULER MULTI-LANGUAGE AUTHOR TOUTE
    Route::post('/multilanguage/authors','ArticleController@getMultLangAuthors',['middleware' => 'accessPermission:article']);

    // ANGULER MULTI-LANGUAGE AUTHOR AFFILIATION

    Route::post('/multilanguage/authors/affiliation','ArticleController@getMultLangAuthorsAffiliation',['middleware' => 'accessPermission:article']);




    /******************************************************************************************************************/
    Route::resource('/articles', 'ArticleController', ['middleware' => 'accessPermission:article']);
    Route::resource('/jmscontent', 'JMSContentController', ['middleware' => 'accessPermission:JMSContent']);
	Route::resource('/recenttrend', 'RecentTrendController', ['middleware' => 'accessPermission:RecentTrend']);
    Route::resource('/indexing_agencies', 'IndexingController', ['middleware' => 'accessPermission:IndexingAgencies']);
    Route::resource('/press_release', 'PressReleaseController', ['middleware' => 'accessPermission:PressRelease']);
    Route::get('/article_generate_sgml/{article_id}','ArticleController@article_GetSGML',['middleware' => 'accessPermission:article']);
    Route::resource('/chapters', 'ChapterController', ['middleware' => 'accessPermission:chapter']);
    Route::get('/chapter_generate_sgml/{chapter_id}','ChapterController@chapter_GetSGML',['middleware' => 'accessPermission:chapter']);

    Route::resource('/affiliation', 'AffiliationController');


   Route::resource('/banner', 'BannerController', ['middleware' => 'accessPermission:banner']);
   Route::resource('/shareable', 'ShareableController', ['middleware' => 'accessPermission:shareable_link']);
   Route::any('/shareable-link-generate', 'ShareableController@GenerateShareableLink', ['middleware' => 'accessPermission:shareable']);

   Route::resource('/discipline', 'DisciplineController', ['middleware' => 'accessPermission:discipline']);

   Route::any('/discipline-article', 'DisciplineController@DisciplineArticle', ['middleware' => 'accessPermission:discipline'])->name('discipline-article');
   
   Route::any('/discipline-article-add', 'DisciplineController@DisciplineArticleForm', ['middleware' => 'accessPermission:discipline'])->name('discipline-article-add');

   Route::any('/add-discipline-article', 'DisciplineController@AddDisciplineArticle', ['middleware' => 'accessPermission:discipline'])->name('add-discipline-article');

   Route::any('/discipline-article-edit/{id?}', 'DisciplineController@DiscipineArticleEdit', ['middleware' => 'accessPermission:discipline'])->name('discipline-article-edit');

   Route::any('/update-discipline-article/{id?}', 'DisciplineController@DisciplineArticleUpdate', ['middleware' => 'accessPermission:discipline'])->name('update-discipline-article');

   Route::any('/delete-discipline-article/{id?}', 'DisciplineController@DisciplineArticleDelete', ['middleware' => 'accessPermission:discipline'])->name('delete-discipline-article');

   Route::any('/discipline-access', 'DisciplineController@DisciplineAccess', ['middleware' => 'accessPermission:discipline'])->name('discipline-access');

   Route::any('/discipline-access-form', 'DisciplineController@DisciplineAccessForm', ['middleware' => 'accessPermission:discipline'])->name('discipline-access-form');

   Route::any('/discipline-access-add', 'DisciplineController@DisciplineAccessAdd', ['middleware' => 'accessPermission:discipline'])->name('discipline-access-add');

   Route::any('/discipline-access-edit/{id?}', 'DisciplineController@DisciplineAccessEdit', ['middleware' => 'accessPermission:discipline'])->name('discipline-access-edit');

   Route::any('/discipline-access-update/{id?}', 'DisciplineController@DiscipineAccessUpdate', ['middleware' => 'accessPermission:discipline'])->name('discipline-access-update');

   Route::any('/discipline-access-delete/{id?}', 'DisciplineController@DiscipineAccessDelete', ['middleware' => 'accessPermission:discipline'])->name('discipline-access-delete');

    //--------------------Delete Uploaded File---------------------------------------
    Route::any('/DeleteJournalFile/{id}/{file_type}', 'JournalController@DeleteJournalFile')->name('DeleteJournalFile');
    Route::any('/DeleteEbookFile/{id}/{file_type}', 'EbookController@DeleteEbookFile')->name('DeleteEbookFile');
    Route::any('/DeleteArticleFile/{id}/{file_type}', 'ArticleController@DeleteArticleFile')->name('DeleteArticleFile');
    Route::any('/DeleteChapterFile/{id}/{file_type}', 'ChapterController@DeleteChapterFile')->name('DeleteChapterFile');
    Route::any('/DeleteEbookVolumeFile/{id}/{file_type}', 'EbookVolumeController@DeleteEbookVolumeFile')->name('DeleteEbookVolumeFile');
    
    Route::any('/content-report/{type}/{content_id?}','ContentReportController@Report',['middleware' => 'accessPermission:ContentReport'])->name('contentreport');
    /*
    @   Meta Data routes with middle ware permissions

     */
    Route::any('metadata/article/{journal_id?}/{volume_id?}/{issue_id?}/{article_id?}/{type?}/{is_epub?}', 'MetaDataController@getArticleMetaData', ['middleware' => 'accessPermission:metadata']);
    Route::any('metadata/issue/{journal_id?}/{volume_id?}/{issue_id?}/{type?}', 'MetaDataController@getIssueMetaData', ['middleware' => 'accessPermission:metadata']);
    Route::any('metadata/ebook/{ebook_id?}/{volume_id?}/{type?}', 'MetaDataController@getEbookMetaData', ['middleware' => 'accessPermission:metadata']);
    Route::any('metadata/ebooks/bentsponix', 'MetaDataController@getEbookBentsponixMetaData', ['middleware' => 'accessPermission:metadata']);

    /*
    @   Content Access routes with middle ware permissions

     */
    Route::resource('/content_access_volume', 'VolumeAccessController', ['middleware' => 'accessPermission:content_access']);
    Route::resource('/content_access_issue', 'IssueAccessController', ['middleware' => 'accessPermission:content_access']);
    Route::resource('/content_access_article', 'ArticleAccessController', ['middleware' => 'accessPermission:content_access']);
    Route::resource('/content_access_chapter', 'ChapterAccessController', ['middleware' => 'accessPermission:content_access']);
    
    Route::resource('user_access', 'UserAccessRequestController', ['middleware' => 'accessPermission:user_access']);
    
  
    Route::any('/useraccess/{page?}', 'UserAccessController@user_access', ['middleware' => 'accessPermission:user_access']);

    Route::any('/web_form_report/{report?}/{type?}', 'ArticleController@WebFormReport')->name('web_form_report');
    /*
    @   Bundle Offers

     */
    Route::resource('/bundle_offer', 'BundleOfferController', ['middleware' => 'accessPermission:bundle_offer']);
    
    Route::any('/bundle_offer_report/{bundle_id?}', 'BundleOfferController@BundleOfferOrderReports')->name('bundle_offer_report');

    /*
    @   Revenu Report routes with middle ware permissions

     */
    Route::group(['middleware' => 'accessPermission:revenue_report'], function () {
        Route::any('/revenue_report/journal', 'RevenueReportController@journal_report')->name('revenue_report.journal_report');
        Route::any('/revenue_report/journal_volume', 'RevenueReportController@journal_volume_report')->name('revenue_report.journal_volume_report');
        Route::any('/revenue_report/issue', 'RevenueReportController@issue_report')->name('revenue_report.issue_report');
        Route::any('/revenue_report/article', 'RevenueReportController@article_report')->name('revenue_report.article_report');
        Route::any('/revenue_report/ebook_volume', 'RevenueReportController@ebook_volume_report')->name('revenue_report.ebook_volume_report');
        Route::any('/revenue_report/chapter', 'RevenueReportController@chapter_report')->name('revenue_report.chapter_report');
    });
    /*
    @   Create Order routes with middle ware permissions
     */
    Route::any('/order/{action}/{id?}', 'OrdersController@Order', ['middleware' => 'accessPermission:orders'])->name('admin.order');

    /*
    @   Reports routes with middle ware permissions

     */
    Route::any('/report/{action}', 'ReportController@Report', ['middleware' => 'accessPermission:report'])->name('admin.report');
    /*
    @   Marc routes with middle ware permissions

     */
    Route::any('/marcdata/{action}/{id?}', 'MarcDataController@MarcData', ['middleware' => 'accessPermission:marcdata'])->name('admin.marcdata');

    /*

    /*
    @   KBart routes with middle ware permissions

     */
    Route::any('/kbart/{action}/{id?}', 'KBartController@KBart', ['middleware' => 'accessPermission:kbart'])->name('admin.kbart');

    /*

    @   Campaign routes with middle ware permissions

     */
    Route::group(['middleware' => 'accessPermission:campaign'], function () {
        Route::resource('/campaign', 'CampaignController');
        Route::any('/campaign-discount-code', 'CampaignController@SearchCode')->name('campaign.codesearch');
        Route::get('/campaign/export/{id}', 'CampaignController@ExportCampaign')->name('campaign.export');
        Route::any('/campaign/activesuspend', 'CampaignController@UpdateCampaignStatus')->name('campaign.status');
    });

    /*
    @   IP base webservice Access routes with middle ware permissions

     */
    Route::group(['middleware' => 'accessPermission:ipaccess'], function () {
        Route::resource('/ipaccess', 'IPAccessController');
        Route::any('/ipaccess/activesuspend', 'IPAccessController@UpdateIPAccessStatus')->name('ipaccess.status');
        Route::any('/ipaccess-cidrtorange', 'IPAccessController@CidrToRange')->name('ipaccess.cidrtorange');
    });

    /*
    @   Disease Management routes with middle ware permissions

     */
    Route::resource('/disease', 'DiseaseController', ['middleware' => 'accessPermission:disease']);

    /*
    @   Counter Reports routes with middle ware permissions

     */
    //Release 4
    Route::get('/counter_report', 'CounterReportController@index', ['middleware' => 'accessPermission:counter_report']);
    Route::post('/counter_report/export', 'CounterReportController@Export', ['middleware' => 'accessPermission:counter_report'])->name('counter_report.export');
    
    // Release 5 
    Route::get('/counter_report/R5', 'CounterReportR5Controller@index', ['middleware' => 'accessPermission:counter_report']);
    Route::post('/counter_report/R5/export', 'CounterReportR5Controller@Export', ['middleware' => 'accessPermission:counter_report'])->name('counter_reportr5.export');
    /*
    @   Consortia routes with middle ware permissions

     */
    Route::group(['middleware' => 'accessPermission:consortia'], function () {
        Route::resource('/consortia', 'ConsortiaController');
        Route::get('/consortia/OrganizationsList/{id}', 'ConsortiaController@ConsortiaOrganizationsList')->name('consortia.orglist');
    });

    /*
    @   Marketing Custom Reports routes with middle ware permissions

    */
    Route::any('/marketing-report/shareable_link_report', 'MarketingReportController@ShareableLink', ['middleware' => 'accessPermission:Shareable_link_report'])->name('shareable_link_report');

    Route::any('/marketing-report/domain_access_report', 'MarketingReportController@DomainAccess', ['middleware' => 'accessPermission:domain_access_report'])->name('domain_access_report');

    Route::any('/marketing-report/free_openaccess_article_report', 'MarketingReportController@FreeorOpenAccessArticle', ['middleware' => 'accessPermission:FreeorOpenAccessArticle'])->name('free_openaccess_article_report');

    Route::any('/marketing-report/downloads_with_article_doi', 'MarketingReportController@DownloadswithArticleDOI', ['middleware' => 'accessPermission:DownloadswithArticleDOI'])->name('downloads_with_article_doi');

    Route::get('/CheckUser/{user}', 'CounterReportController@CheckUser');    

    Route::get('/campaign/export/{id}', 'CampaignController@ExportCampaign')->name('campaign.export');

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

        Route::get('/clear-cache', function() {
        Artisan::call('config:cache');
        Artisan::call('config:clear');
        Artisan::call('cache:clear');
        Artisan::call('view:clear');
        return redirect()->back();
        }); 

        Route::get('/clear-route', function() {

        Artisan::call('route:clear');
        Artisan::call('route:cache');
        return redirect()->back();

        }); 
		Route::get('/update-session/expire',function(){	
			$path = storage_path().'/framework/sessions/';			
			foreach(scandir($path) as $file)
			{
				if(strlen($file) > 10)
				{
					if(strtotime("-5 days") >= stat($path.'/'.$file)["mtime"])
					{
						unlink($path.'/'.$file);	
					}
				}
			}
		});
		
    });
});

/*
@   Front end routes
 */
Route::group(['middleware' => 'adminip_check'], function () {
    Route::get('/benthamsecurelogin/adminlogin', 'HomeController@ShowAdminLogin')->name('admin');
    Route::get('/benthamsecurelogin/managerlogin', 'HomeController@ShowAdminLogin')->name('managerlogin');
});

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

    Route::get('/', function () {
        return view('welcome');
    });
    Route::any('/home/{pages?}/{id?}/{content?}', 'HomeController@index')->name('home');

    Route::any('/member/{pages?}/{id?}', 'HomeController@MemberManuscript')->name('member');

	Route::get('/recenttrend/{param?}', 'RecentTrendController@recentTrendList')->name('recentTrendList');
	Route::get('/recenttrenddetail/{id?}', 'RecentTrendController@recentTrendDetail')->name('recentTrendDetail');

    Route::get('/indexing-agencies', 'IndexingController@BrowsebyJournalIndexing')->name('indexing_agencies');

    Route::get('/indexing-agencies-books', 'IndexingController@BrowsebyEbookIndexing')->name('indexing_agencies_books');

    Route::get('/indexing_agencies_list/{id?}/{journal_id?}', 'IndexingController@IndexingAgenciesList')->name('indexing_agencies_list');

    Route::get('/indexing_agencies_bookslist/{id?}/{ebook_volume_id?}', 'IndexingController@IndexingAgenciesBookList')->name('indexing_agencies_bookslist');

    Route::get('/press-release', 'PressReleaseController@PressReleaseList')->name('press-release');

    Route::get('/press-release-detail/{id?}', 'PressReleaseController@PressReleaseDetail')->name('press_release_detail');

    Route::get('/about-us', function () {
        return view('about_us');
    });
    Route::get('/order-subscription', function () {
        return view('ordering');
    });
    Route::get('/privacy-policy', function () {
        return view('privacy_policy');
    });
    Route::get('/video.html', function () {
    return view('video');
    
	});
    Route::get('/contact-us', function () {
        return view('contact_us');
    });
    Route::get('/manuscript-transfer-facility', function () {
        return view('manuscript_transfer');
    });
    Route::get('/kudos', function () {
        return view('kudos');
    });
    Route::get('/article-ref', function () {
        return view('article_ref');
    });

    Route::get('/help/{page_name?}', function ($page_name = null) {
        return view('help',with(['page_name'=>$page_name]) );
    });

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

    Route::get('/terms-and-conditions', function () {
        return view('terms-conditions');
    });

    Route::get('/how-maximize-visibility-published-articles', function () {
        return view('promote_articles');
    });

    Route::any('feedback/{param?}', 'HomeController@FeedBack')->name('feedbeck');
    
    Route::get('171002/crossmark', 'HomeController@CrossMark')->name('crossmark');

    Route::get('activate/{userId}/{activationCode}', 'FrontEndController@getActivate')->name('activate');
    Route::get('/userlogin', 'HomeController@ShowUserLogin')->name('user');	
    Route::any('/updateprofile', 'HomeController@UpdateProfile')->name('profile');

    Route::get('/terms/{content_id?}/{param?}/{content?}/{file_type?}', 'HomeController@Terms')->name('terms');
    Route::get('/termstrial/{access_type?}/{content_id?}/{param?}/{content?}/{file_type?}', 'HomeController@TermsTrial')->name('termstrial');

    /*
    @   Journal listing
    Route::get('/downlaod_file/{article_id}/{file_type}', 'ArticleController@DownlodFile')->name('download_file');
     */

    Route::any('/bypublication/{alphabet?}', 'JournalController@GetJournalList')->name('bypublication');
    Route::any('/call-for-papers', 'JournalController@GetCallForPapers')->name('callforpapers');
    Route::any('/call-for-papers-detail/{id?}/{param?}', 'JournalController@GetCallForPapersDetail')->name('callforpapers-detail');
    Route::any('/browse-by-subscribe/{alphabet?}', 'JournalController@GetJournalList')->name('browsebysubscribe');
    Route::get('/browse_by_subject', 'SubjectController@browse_by_subject');
    Route::get('/browse_by_ebook_subject', 'SubjectController@browse_by_ebook_subject');
    Route::get('/subject/{subject_id}', 'SubjectController@DisplaySubject');
    Route::get('/ebook_subject/{subject_id}', 'SubjectController@DisplayEbookSubject');

    Route::get('/browse-by-pharmacy-collection', 'PharmacyCollectionController@browse_by_pharmacy_collection');
    Route::get('/browse-by-ebook-collection', 'PharmacyCollectionController@browse_by_ebook_pharmacy_collection');
    Route::get('/pharmacy-collection/{pc_id}', 'PharmacyCollectionController@DisplayPharmacyCollection');
    Route::get('/ebook-pharmacy-collection/{pc_id}', 'PharmacyCollectionController@DisplayEbookPharmacyCollection');
    Route::any('/journal/{journal_id}/{page_name?}/{id?}/{subscribe?}', 'JournalController@GetJournalDetails')->name('journal');
    
    Route::any('/call-for-section-editor', 'JournalController@SectionEditorForm')->name('call_for_section_editor');

    Route::post('/get_volumes_with_ajax', 'JournalController@GetVolumesWithAjax')->name('get_volumes_with_ajax');
    Route::any('/get_issues_with_ajax', 'JournalController@GetIssuesWithAjax')->name('get_issues_with_ajax');
    Route::post('/get_articles_with_ajax', 'JournalController@GetArticlesWithAjax')->name('get_articles_with_ajax');

    Route::any('/library-recommendation', 'JournalController@LibraryRecommendation')->name('library_recommendation');
    
    Route::any('/become-institutional-member', 'JournalController@BecomeInstitutionalMember')->name('become-institutional-member');

    Route::any('/read-publish-collaboration', 'JournalController@ReadPublishCollaboration')->name('read-publish-collaboration');

    Route::any('/order/{type}/{id?}', 'ArticleController@EprintReprintOrder')->name('print-order');
    Route::post('/become-ebm-rev-form', 'JournalController@Become_EBM_Review')->name('become-ebm-rev-form');
    Route::post('/proposal', 'JournalController@Proposal')->name('proposal');

    Route::any('/trial-requests/{society?}/{id?}', 'JournalController@TrialRequest')->name('trial_requests');
    Route::any('/free-online-subscription-offer', 'JournalController@FreeOnlineSubscriptionOffer')->name('free-online-subscription-offer');
    Route::get('/author-compliance/{subtitle}', 'AuthorComplianceController@AuthorCompliance');
    Route::any('/alert-subscription', 'AlertSubscriptionController@index')->name('alert-subscription');

    //=========================Journal Subscription Start================================= //
    Route::any('/subscription/{code}', 'JournalController@SubscriptionRedirect');
    Route::any('/subscribe-to-this-journal/{journal_id}', 'JournalController@SubscriptionRequest')->name('subscription_request');
    Route::any('/subscription-request-migs-response/{subscrition_order_id}', 'JournalController@SubscriptionRequestMigsResponse')->name('subscription_request_migs_response');
    Route::any('/subscription-request-paypal-response', 'JournalController@SubscriptionRequestPaypalResponse')->name('subscription_request_paypal_response');

    //=========================Issue Start================================= //

    Route::any('/issue/{issue_id}/{type?}', 'IssueController@GetIssueDetails')->name('issue');
    Route::any('/content/{issue_id}/{type?}', 'IssueController@GetIssueDetails')->name('content');
    Route::any('/purchase_full_issue/{issue_id}', 'IssueController@PurchaseFullIssue')->name('purchase_full_issue');

    // Master Card Response
    Route::any('/purchase_issue_migs_response/{inquiry_id}', 'IssueController@PurchaseIssueMigsResponse')->name('purchase_issue_migs_response');

    //=========================Issue End================================= //

    Route::any('/article/{article_id}/{param?}', 'ArticleController@GetArticleDetails')->name('article');

    Route::any('/link/{shareable_link}', 'ShareableController@GetShareableArticle');
    //Route::any('/discipline/{link}', 'DisciplineController@GetDisciplineAccessArticles');

    Route::any('/discipline/{code}/{email}', 'DisciplineController@GetDisciplineAccess');
    Route::any('/discipline/{code}/{email}/{article_id}', 'DisciplineController@GetDisciplineAccessArticles');

 
    Route::any('/full-text-inquiry/{article_id}', 'ArticleController@FullTextInquiry')->name('purchase_full_text_inquiry');
    Route::any('/full-text-inquiry-migs-response/{inquiry_id}', 'ArticleController@FullTextInquiryMigsResponse')->name('purchase_full_text_inquiry_migs_response');
    Route::any('/full-text-inquiry-paypal-response', 'ArticleController@FullTextInquiryPaypalResponse')->name('purchase_full_text_inquiry_paypal_response');

    Route::any('/rental-request/{article_id}', 'ArticleController@RentalRequest')->name('rental_request');
    Route::any('/rental-request-migs-response/{rental_order_id}', 'ArticleController@RentalRequestMigsResponse')->name('rental_request_migs_response');
    Route::any('/rental-request-paypal-response', 'ArticleController@RentalRequestPaypalResponse')->name('rental_request_paypal_response');
    Route::any('/rental-order-update/{rental_order_id}/{article_id}', 'ArticleController@RentalAccessComplete')->name('rental_order_update');

    Route::any('/bundle-offer-order/{action?}/{bundle_id?}', 'BundleOfferController@BundleOfferOrder')->name('bundle_offer_order');


    Route::get('/readpdf/{param}', 'ArticleController@ReadPDF')->name('readpdf');
    Route::get('/readrentalpdf/{param}', 'ArticleController@ReadPDF')->name('readrentalpdf');
    Route::get('/viewhtml/{param}', 'ArticleController@ViewHtml')->name('readhtml');
    Route::any('/download_file', 'ArticleController@DownlodFile')->name('download_article');
    Route::any('/download_bundle_file', 'ArticleController@DownlodBundleFile')->name('download_bundle_file');
    //Route::get('/track_list/{journal_id}/{track_id}','JournalController@GetTracklist')->name('tracklist');
    Route::post('/citation', 'ArticleController@ExportCitation')->name('citation');
    Route::any('/benthamscience/downloadfile/{param}', 'BenthamController@DownloadBenthamFile')->name('download_bentham_article');
    /*
    @   Ebook listing

     */
    Route::any('/bybook/{letter?}', 'EbookVolumeController@GetEbookVolumeList')->name('bybook');
    Route::any('/browse-ebook-subscribe', 'EbookVolumeController@GetEbookVolumeList')->name('browseebooksubscribe');
    Route::get('/ebook_volume/{id}/{page_name?}/{param?}', 'EbookVolumeController@GetEbookVolumeDetails')->name('ebook_volume');
    Route::any('/download_volume_file', 'EbookVolumeController@download_volume_file')->name('download_volume_file');
    Route::any('/download_volume_bundle_file', 'EbookVolumeController@download_volume_bundle_file')->name('download_volume_bundle_file');
    Route::any('/DownloadFlyer/{filepath}', 'EbookVolumeController@DownloadFlyer')->name('DownloadFlyer');
    Route::get('/readebookpdf/{param}', 'EbookVolumeController@ReadEbookPDF')->name('readebookpdf');

    Route::get('/forthcoming/{letter?}', 'EbookVolumeController@GetEbookForthcoming');

    /*======================= Ebook Forms Start ===========================*/

    Route::any('/order_ebook/{ebook_volume_id}/{promo_code?}', 'EbookVolumeController@EbookOrderForm')->name('order_form');
    //Route::any('/validate_promo_code/{ebook_volume_id}','EbookVolumeController@validate_promo_code')->name('validate_promo_code');
    Route::post('preview_order_ebook/{ebook_volume_id}', 'EbookVolumeController@EbookOrderFormPreview')->name('preview_order_form');
    Route::post('submit_order_ebook/{ebook_volume_id}', 'EbookVolumeController@EbookOrderFormSubmit')->name('submit_order_form');

    Route::any('/order_print_version/{ebook_volume_id}/{copy}/{promo_code?}/{pre_order_id?}', 'EbookVolumeController@OrderPrintVersion')->name('order_print_version');
    Route::post('/preview_order_print_version/{ebook_volume_id}/{copy}', 'EbookVolumeController@OrderPrintVersionPreview')->name('preview_order_print_version');
    Route::post('/submit_order_print_version/{ebook_volume_id}/{copy}', 'EbookVolumeController@OrderPrintVersionSubmit')->name('submit_order_print_version');

    Route::any('/pre_order/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderForm')->name('pre_order_form');
    Route::post('/preview_pre_order/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderPreview')->name('preview_pre_order');
    Route::post('/submit_pre_order/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderSubmit')->name('submit_pre_order');
    //================================== eBook Pre Order Payment ==================================
    Route::any('/pre_order_payment/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderPaymentForm')->name('pre_order_payment_form');
    Route::post('preview_pre_order_payment/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderPaymentFormPreview')->name('preview_pre_order_payment_form');
    Route::post('submit_pre_order_payment/{ebook_volume_id}', 'EbookVolumeController@EbookPreOrderPaymentFormSubmit')->name('submit_pre_order_payment_form');
   
    Route::any('/ebookPreOrderFormMigsResponse/{order_id}', 'EbookVolumeController@EbookPreOrderFormMigsResponse')->name('ebookPreOrderFormMigsResponse');
    
    /*======================= eBook Pre Order Payment End =============================*/

    /*======================= PAYPAL =============================*/
    Route::get('/payment_with_paypal/{poid}', 'EbookVolumeController@paymentWithPaypal')->name('payment_with_paypal');
    Route::any('/ebookPrintVersionPaypalResponse', 'EbookVolumeController@OrderPrintVersionPaypalResponse')->name('ebookPrintVersionPaypalResponse');
    Route::any('/ebookOrderPaypalResponse', 'EbookVolumeController@EbookOrderPaypalResponse')->name('ebookOrderPaypalResponse');
    
    /*======================= MasterCard =============================*/
    Route::any('/orderPrintVersionMigsResponse/{order_id}', 'EbookVolumeController@OrderPrintVersionMigsResponse')->name('orderPrintVersionMigsResponse');
    Route::any('/ebookOrderFormMigsResponse/{order_id}', 'EbookVolumeController@EbookOrderFormMigsResponse')->name('ebookOrderFormMigsResponse');
    

    Route::get('/read-chapter/{chapter_id}/{view_type}', 'ChapterController@GetReadChapterDetails')->name('read-chapter');
    Route::get('/chapter/{id}/{param?}', 'ChapterController@GetChapterDetails')->name('chapter');
    //Route::get('/chapter/video/{node_id}', 'ChapterController@GetChapterVideo')->name('chapter_video');
    Route::get('/video/{node_id}/{cid?}', 'ChapterController@GetChapterVideo')->name('chapter_video');
    Route::any('/chapter_download_file', 'ChapterController@ChapterDownlodFile')->name('ebook_download_chapter');
    Route::any('/chapter_download_bundle_file', 'ChapterController@ChapterDownlodBundleFile')->name('chapter_download_bundle_file');
    Route::get('/readchapterpdf/{param}', 'ChapterController@ReadChapterPDF')->name('readchapterpdf');
    /*
    @   Disease wise article routing
     */
    Route::get('/alldiseases/{disease_id?}/{disease?}', 'DiseaseController@AllDiseases')->name('alldiseases');
    Route::get('/bydisease/{disease_id?}/{disease_name?}/{search_within?}/{list_type?}', 'DiseaseController@ArtcileListByDisease')->name('bydisease');
    Route::get('/rss-disease/{disease_id?}/{disease_name?}/{search_within?}/{list_type?}', 'DiseaseController@RSSDiseaseWiseArticle')->name('rssdisease');

    Route::any('/search/{searchvalue?}', 'SearchController@getSearch')->name('advancesearch');

    /*
    @   Shopping Cart
     */
    Route::any('/promo-content/{content_type}/{content_id}/{code}/{pre_order_id?}', 'PromoContentController@index')->name('promo-content');
    Route::any('/promo-content/proceed', 'PromoContentController@PromoPaymentProceed');
    
    Route::resource('/cart', 'CartController');
    Route::any('/cart/promo-code', 'CartController@PromoCode')->name('promo_code');
    Route::any('/cart/checkout/review', 'CartController@checkout');
    Route::any('/cart/proceed', 'CartController@PaymentProceed');
    Route::any('/cart/paypal/complete/{order_id?}', 'CartController@PaypalReturn');
    Route::any('/cart/migs/complete/{order_id?}', 'CartController@MigsReturn');
    Route::any('/download-purchased-items', 'CartController@DownloadPurchasedItem')->name('downloadpurchaseitem');
    Route::post('/counter_report/export', 'CounterReportController@Export')->name('counter_report.userexport');
    Route::post('/counter_report/R5/export', 'CounterReportR5Controller@Export')->name('counter_report5.userexport');

    /*
    @ RSS Feed routes
     */
    Route::get('/rss/xml/{page?}/{id?}', 'FeedController@index');

    /* Mark Item*/

    Route::resource('/marklist', 'MarkListController');

    /*
    @ Rating routes
     */
    Route::any('/cart-rating', 'CartController@Rating')->name('cartrating');


    Route::get('/Image/{param}', 'HomeController@RenderImage');

    /* Openathens OIDC Login*/
    Route::any('/openathens/splogin/{sessionVar?}', 'BenthamController@OpenAthensLogin')->name('openathenslogin');

    Route::get('openathens/login/{site?}', 'BenthamController@OpenathensWSLogin');
    Route::any('/wayfinder/{param?}', 'BenthamController@WayFinder');
    Route::any('/deeplink/{param?}', 'BenthamController@Deeplinking');
//--Imran ------------
    Route::get('get-country-list/{param?}','AuthorComplianceController@getCountryList');
    Route::get('get-state-list/{param?}','AuthorComplianceController@getStateList');
    Route::get('get-city-list/{param?}','AuthorComplianceController@getCityList');
    Route::get('get-institude-list/{param?}','AuthorComplianceController@getInstitudeList');
    
    Route::get('free-online-samples','JournalController@FreeOnlineSamples');
	Route::get('journal-subscriptions/{rateyear?}','JournalController@journalSubscriptionsRate');
    
    Route::get('/journals-catalog', function () {
        return view('journals-catalog');
    });
    Route::get('/books-catalog', function () {
        return view('books-catalog');
    });
    
    Route::any('webinars/', 'HomeController@Webinars')->name('webinars');
    Route::any('/webinarsPaypalResponse', 'HomeController@WebinarPaypalResponse')->name('webinarsPaypalResponse');


    Route::get('/fabricating-stating-false-information', function () {
        return view('false_Information');
    });
    Route::get('/increase-visibility-article', function () {
        return view('increase_visibility');
    });
    Route::get('/allegations-from-whistleblowers', function () {
        return view('allegations_from_whistleblowers');
    });
    Route::get('/endorsements', function () {
        return view('endorsements');
    });
    Route::get('/author-comments', function () {
    return view('author_comments');
    });
    Route::get('/open-access-plus', function () {
    return view('open_access_plus');
    });
    Route::get('/faq-reprint', function () {
    return view('faq_reprint');
    });
    Route::get('/journal-impacting-science', function () {
    return view('journal_impacting_science');
    });
    Route::get('/jounral-impacting-science', function () {
    return redirect('/journal-impacting-science');
    });
    Route::get('/read-publish', function () {
    return view('read_publish');
    });
    Route::get('/corporate-sales', function () {
    return view('corporate_sales');
    });
    Route::get('/processing-cycle', function () {
    return view('processing_cycle');
    });
    Route::get('/promotional-services', function () {
    return view('promotional_services');
    });
    Route::get('/language-editing', function () {
    return view('language_editing');
    });
    Route::get('/advertising-policy', function () {
        return view('advertising_policy');
    });
    Route::get('/advertise-with-us', function () {
        return view('advertise_us');
    });
    Route::get('/guest-editor-guidelines', function () {
        return view('guest_editor_guidelines');
    });
    Route::get('/research-misconduct', function () {
        return view('research_misconduct');
    });
	Route::get('/forthcoming-thematic-issues', function () {
        return view('forthcoming_thematic_issues');
    });
	Route::get('/media-partners', function () {
        return view('media_partners');
    });
    
    Route::get('/self-archiving-policies', function () {
        return view('archiving-policies');
    });

    Route::get('/reviewers-guidelines', function () {
        return view('reviewers_guidelines');
    });
    /*
	Route::get('/press-release', function () {
        return view('press_release');
    });
    */
	Route::get('/ebook-news', function () {
        return view('ebook_news');
    });
	Route::get('/subscriptions-pricing-ordering', function () {
        return view('subscriptions_pricing_ordering');
    });
	
	Route::get('/pages/{page_name?}', function ($page_name = null) {
        return view('pages',with(['page_name'=>$page_name]) );
    });
	
    Route::get('/recent-trends/{param?}', function ($param = null) {
        return view('recent_trends_detail',with(['param'=>$param]) );
    });

  Route::any('/checkmyip', 'CheckIPController@index');

 Route::any('/call-for-section-editor', 'JournalController@SectionEditorForm')->name('call_for_section_editor');


});

    //==================Direct Download===============
    Route::any('/direct-download/{content_id}/{link}/{name}/{email}', 'ArticleController@DirectDownload');
    Route::any('/direct-download-chapter/{content_id}/{link}/{name}/{email}', 'ChapterController@DirectDownload');
    Route::any('/direct-download-ebook-volume/{content_id}/{link}/{name}/{email}', 'EbookVolumeController@DirectDownload');
	Route::any('/related-articles', 'ArticleController@getRelatedArticles');
	

Route::get('/epub-inquiry-form/{id}', function ($id) {
  return redirect('/full-text-inquiry/'.$id);
});
Route::get('/user', function () {
  return redirect('/login');
});
Route::get('/404', function () {
  return abort(404);
});
Route::get('/{nid}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');
Route::get('/{nid}/volume{no}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');
Route::get('/purchase-ebook/{nid}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');
Route::get('/purchase-chapter/{nid}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');
Route::get('/order-print-version/{nid}/{name?}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');

Route::get('/order-ebook/{nid}', function ($id) {
  return redirect('/node/'.$id);
})->where('id', '[^0-9]+');

Route::any('/customecaptcha/refresh', 'BenthamController@CustomRefreshCaptcha');


/********************************************************************************************************
 * 
 *                      CUSTOMER RELATION MANAGMENT ROUTE         
 * 
 *********************************************************************************************************/ 
 Route::group([
        'prefix' => 'crm',
        'middleware' => 'agent',
        'as' => 'crm.',
    ],function(){
        Route::any('/dashboard', 'CRMController@index')->name('dashboard');

        Route::get('/risk', 'CRMController@risk')->name('risk');
        Route::get('/opportunity', 'CRMController@opportunity')->name('opportunity');
        Route::get('/opportunity/detail/{agent}/{user_id}/{year}', 'CRMController@opportunityDetail')->name('opportunity.detail');
        Route::get('/potential/{agent?}/{user_id?}/{year?}/{journal_id?}', 'CRMController@potential')->name('potential');
        Route::get('/bycountryuser/{country}', 'CRMController@bycountryuser')->name('bycountryuser');
        Route::get('/combinereport/{param}/{year}/{eurekausername}', 'CRMController@combineReport')->name('combinereport');
		Route::get('/combinereport/getmodeldata', 'CRMController@getModelData')->name('combinereport.getmodeldata');
        Route::post('/combinereport/excel', 'CRMController@excelCombineReport')->name('combinereport.excel');
        Route::post('/allusage/excel', 'CRMController@excelAllUsage')->name('allusage.excel');
        Route::post('/alldenial/excel', 'CRMController@excelAllDenial')->name('alldenial.excel');
        Route::get('/agent/authors/{param}/{flag?}', 'CRMController@agentAuthor')->name('agent.authors');
        Route::get('/user/subscribejournal/{param}', 'CRMController@subscription')->name('user.subscribejournal');

        
    });

    // MARC Report

    Route::post('user/marcdata/journal', 'MarcDataController@getJournalMarcDataByUser', ['middleware' => 'accessPermission:marcdata'])->name('user.marcdata.journal');

    Route::get('user/marcdata/subscribejournal/{param}', 'MarcDataController@getSubscribeJournalMarcData', ['middleware' => 'accessPermission:marcdata'])->name('user.marcdata.subscribejournal');

    Route::post('user/marcdata/ebook', 'MarcDataController@getEbookMarcDataByUser', ['middleware' => 'accessPermission:marcdata'])->name('user.marcdata.ebook');

    Route::get('user/marcdata/subscribeebook/{param}', 'MarcDataController@getSubscribeEbookMarcData', ['middleware' => 'accessPermission:marcdata'])->name('user.marcdata.subscribeebook');

    // KBART Report
    
    Route::post('user/kbart/journal', 'KBartController@getUserjournalKbart', ['middleware' => 'accessPermission:kbart'])->name('user.kbart.journal');
    Route::post('user/kbart/ebook', 'KBartController@getUserEbookKbart', ['middleware' => 'accessPermission:kbart'])->name('user.kbart.ebook');

