<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
 */
Route::get('/', function () {
    return Redirect::to('Home');
});
Route::resource('BackLogin', 'admin\BackLoginController@index');

//vvvvvvvvvvvvvvvvv auth link vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Route::group(['middleware' => ['auth', 'sessiontimeout']], function () {
    Route::get('BackHome', ['as' => 'BackHome', 'uses' => 'admin\BackLoginController@Home']);
    //帳號管理
    Route::resource('BackUserManagement', 'admin\management\BackUserManagementController@index');
    //BackMemberManagement
    Route::resource('BackMemberManagement', 'admin\management\BackMemberManagementController@index');
    //management-role
    Route::resource('BackRole', 'admin\management\role\BackRoleController@index');
    Route::resource('BackRoleControls', 'admin\management\role\BackRoleControlsController@index');
    //程式註冊,選單註冊,後台首頁
    Route::resource('BackProgramRegistration', 'admin\system\BackProgramRegistrationController@index');
    Route::resource('BackAnnouncement', 'admin\system\BackAnnouncementController@index');
    Route::resource('BackMenuClass', 'admin\system\BackMenuClassController@index');

    //取得後台帳號資料
    Route::get('GetUserData', 'admin\management\BackUserManagementController@get_user_data');
    Route::post('SaveUserData', 'admin\management\BackUserManagementController@store_user_data');
    Route::post('UpdateUserData', 'admin\management\BackUserManagementController@update_user_data');
    Route::post('DestroyUserData', 'admin\management\BackUserManagementController@DestroyUserData');
    //網站管理
    //-------- 系統公告
    Route::get('BackSysAnnouncement', 'admin\site_management\BackSysAnnouncementController@index');
    Route::get('BackSysAnnouncementAdd', ['uses' => 'admin\site_management\BackSysAnnouncementController@add']);
    Route::post('BackSysAnnouncementStore', ['as' => 'BackSysAnnouncement.store', 'uses' => 'admin\site_management\BackSysAnnouncementController@store']);
    Route::get('BackSysAnnouncementEdit', ['as' => 'BackSysAnnouncement.Edit', 'uses' => 'admin\site_management\BackSysAnnouncementController@edit']);
    Route::post('BackSysAnnouncementUpdate', ['as' => 'BackSysAnnouncement.update', 'uses' => 'admin\site_management\BackSysAnnouncementController@update']);
    Route::get('BackSysAnnouncementDelete', ['as' => 'BackSysAnnouncement.Delete', 'uses' => 'admin\site_management\BackSysAnnouncementController@delete']);
    //--------起源
    Route::get('BackOrigin', ['as' => 'BackOrigin.index', 'uses' => 'admin\foundation\BackOriginController@index']);
    Route::post('BackOriginUpdate', ['as' => 'BackOrigin.update', 'uses' => 'admin\foundation\BackOriginController@update']);
    Route::post('BackOriginRemoveImg', ['as' => 'BackOrigin.RemoveImg', 'uses' => 'admin\foundation\BackkOriginController@RemoveImg']);
    //-------- 董監事 
    Route::get('BackDirectorsSupervisors',['as'=>'BackDirectorsSupervisors.index','uses'=>'admin\foundation\BackDirectorsSupervisorsController@index'] );
    Route::get('BackDirectorsSupervisorsAdd',['as'=>'BackDirectorsSupervisors.add','uses'=>'admin\foundation\BackDirectorsSupervisorsController@add'] );
    Route::post('BackDirectorsSupervisorsStore',['as'=>'BackDirectorsSupervisors.store','uses'=>'admin\foundation\BackDirectorsSupervisorsController@store'] );
    Route::get('BackDirectorsSupervisorsEdit',['as'=>'BackDirectorsSupervisors.edit','uses'=>'admin\foundation\BackDirectorsSupervisorsController@edit'] );
    Route::post('BackDirectorsSupervisorsUpdate',['as'=>'BackDirectorsSupervisors.update','uses'=>'admin\foundation\BackDirectorsSupervisorsController@update'] );
    Route::get('BackDirectorsSupervisorsDelete',['as'=>'BackDirectorsSupervisors.delete','uses'=>'admin\foundation\BackDirectorsSupervisorsController@delete'] );
    //-------- 紀念文章 
    Route::get('BackWritings',['as'=>'BackWritings.index','uses'=>'admin\foundation\BackWritingsController@index'] );
    Route::get('BackWritingsAdd',['as'=>'BackWritings.add','uses'=>'admin\foundation\BackWritingsController@add'] );
    Route::post('BackWritingsStore',['as'=>'BackWritings.store','uses'=>'admin\foundation\BackWritingsController@store'] );
    Route::get('BackWritingsEdit',['as'=>'BackWritings.edit','uses'=>'admin\foundation\BackWritingsController@edit'] );
    Route::post('BackWritingsUpdate',['as'=>'BackWritings.update','uses'=>'admin\foundation\BackWritingsController@update'] );
    Route::get('BackWritingsDelete',['as'=>'BackWritings.delete','uses'=>'admin\foundation\BackWritingsController@delete'] );
    //-------- 會務介紹
    Route::get('BackAffairs',['as'=>'BackAffairs.index','uses'=>'admin\Affairs\BackAffairsController@index'] );
    Route::get('BackAffairsAdd',['as'=>'BackAffairs.add','uses'=>'admin\Affairs\BackAffairsController@add'] );
    Route::post('BackAffairsStore',['as'=>'BackAffairs.store','uses'=>'admin\Affairs\BackAffairsController@store'] );
    Route::get('BackAffairsEdit',['as'=>'BackAffairs.edit','uses'=>'admin\Affairs\BackAffairsController@edit'] );
    Route::post('BackAffairsUpdate',['as'=>'BackAffairs.update','uses'=>'admin\Affairs\BackAffairsController@update'] );
    Route::get('BackAffairsDelete',['as'=>'BackAffairs.delete','uses'=>'admin\Affairs\BackAffairsController@delete'] ); 
    //-------- 會務分類
    Route::get('BackAffairsClass',['as'=>'BackAffairsClass.index','uses'=>'admin\Affairs\BackAffairsClassController@index'] );
    Route::get('BackAffairsClassAdd',['as'=>'BackAffairsClass.add','uses'=>'admin\Affairs\BackAffairsClassController@add'] );
    Route::post('BackAffairsClassStore',['as'=>'BackAffairsClass.store','uses'=>'admin\Affairs\BackAffairsClassController@store'] );
    Route::get('BackAffairsClassEdit',['as'=>'BackAffairsClass.edit','uses'=>'admin\Affairs\BackAffairsClassController@edit'] );
    Route::post('BackAffairsClassUpdate',['as'=>'BackAffairsClass.update','uses'=>'admin\Affairs\BackAffairsClassController@update'] );
    Route::get('BackAffairsClassDelete',['as'=>'BackAffairsClass.delete','uses'=>'admin\Affairs\BackAffairsClassController@delete'] );
    
    //-------- 下載清單
    Route::get('BackDownload',['as'=>'BackDownload.index','uses'=>'admin\Download\BackDownloadController@index'] );
    Route::get('BackDownloadAdd',['as'=>'BackDownload.add','uses'=>'admin\Download\BackDownloadController@add'] );
    Route::post('BackDownloadStore',['as'=>'BackDownload.store','uses'=>'admin\Download\BackDownloadController@store'] );
    Route::get('BackDownloadEdit',['as'=>'BackDownload.edit','uses'=>'admin\Download\BackDownloadController@edit'] );
    Route::post('BackDownloadUpdate',['as'=>'BackDownload.update','uses'=>'admin\Download\BackDownloadController@update'] );
    Route::get('BackDownloadDelete',['as'=>'BackDownload.delete','uses'=>'admin\Download\BackDownloadController@delete'] ); 
    //-------- 下載分類
    Route::get('BackDownloadClass',['as'=>'BackDownloadClass.index','uses'=>'admin\Download\BackDownloadClassController@index'] );
    Route::get('BackDownloadClassAdd',['as'=>'BackDownloadClass.add','uses'=>'admin\Download\BackDownloadClassController@add'] );
    Route::post('BackDownloadClassStore',['as'=>'BackDownloadClass.store','uses'=>'admin\Download\BackDownloadClassController@store'] );
    Route::get('BackDownloadClassEdit',['as'=>'BackDownloadClass.edit','uses'=>'admin\Download\BackDownloadClassController@edit'] );
    Route::post('BackDownloadClassUpdate',['as'=>'BackDownloadClass.update','uses'=>'admin\Download\BackDownloadClassController@update'] );
    Route::get('BackDownloadClassDelete',['as'=>'BackDownloadClass.delete','uses'=>'admin\Download\BackDownloadClassController@delete'] );
    //-------- 活動類別
    Route::get('BackEventClass',['as'=>'BackEventClass.index','uses'=>'admin\Event\BackEventClassController@index'] );
    Route::get('BackEventClassAdd',['as'=>'BackEventClass.add','uses'=>'admin\Event\BackEventClassController@add'] );
    Route::post('BackEventClassStore',['as'=>'BackEventClass.store','uses'=>'admin\Event\BackEventClassController@store'] );
    Route::get('BackEventClassEdit',['as'=>'BackEventClass.edit','uses'=>'admin\Event\BackEventClassController@edit'] );
    Route::post('BackEventClassUpdate',['as'=>'BackEventClass.update','uses'=>'admin\Event\BackEventClassController@update'] );
    Route::get('BackEventClassDelete',['as'=>'BackEventClass.delete','uses'=>'admin\Event\BackEventClassController@delete'] );
    //-------- 活動
    Route::get('BackEvent',['as'=>'BackEvent.index','uses'=>'admin\Event\BackEventController@index'] );
    Route::get('BackEventAdd',['as'=>'BackEvent.add','uses'=>'admin\Event\BackEventController@add'] );
    Route::post('BackEventStore',['as'=>'BackEvent.store','uses'=>'admin\Event\BackEventController@store'] );
    Route::get('BackEventEdit',['as'=>'BackEvent.edit','uses'=>'admin\Event\BackEventController@edit'] );
    Route::post('BackEventUpdate',['as'=>'BackEvent.update','uses'=>'admin\Event\BackEventController@update'] );
    Route::get('BackEventDelete',['as'=>'BackEvent.delete','uses'=>'admin\Event\BackEventController@delete'] );   
    //--------細節
    Route::get('BackEventRead',['as'=>'BackEventRead.index','uses'=>'admin\Event\BackEventController@Read'] );
    Route::get('BackEventReadDetail',['as'=>'BackEventRead.Detail','uses'=>'admin\Event\BackEventController@ReadDetail'] );
    
    //-------- 活動付款方式
    Route::get('BackEventPay',['as'=>'BackEventPay.index','uses'=>'admin\Event\BackEventPayController@index'] );
    Route::post('BackEventPayUpdate',['as'=>'BackEventPay.update','uses'=>'admin\Event\BackEventPayController@update'] );


    //-------- 首頁輪播圖管理
    Route::get('BackImgRotation', 'admin\site_management\BackImgRotationController@index');
    Route::get('BackImgRotationAdd', ['uses' => 'admin\site_management\BackImgRotationController@add']);
    Route::post('BackImgRotationStore', ['as' => 'BackImgRotation.store', 'uses' => 'admin\site_management\BackImgRotationController@store']);
    Route::get('BackImgRotationEdit', ['as' => 'BackImgRotation.edit', 'uses' => 'admin\site_management\BackImgRotationController@edit']);
    Route::post('BackImgRotationUpdate', ['as' => 'BackImgRotation.update', 'uses' => 'admin\site_management\BackImgRotationController@update']);
    Route::get('BackImgRotationDelete', ['as' => 'BackImgRotation.Delete', 'uses' => 'admin\site_management\BackImgRotationController@delete']);
    //友站連結
    Route::get('BackAccompaniedLink', 'admin\site_management\BackAccompaniedLinkController@index');
    Route::get('BackAccompaniedLinkAdd', ['as'=>'BackAccompaniedLink.add','uses' => 'admin\site_management\BackAccompaniedLinkController@add']);
    Route::post('BackAccompaniedLinkStore', ['as' => 'BackAccompaniedLink.store', 'uses' => 'admin\site_management\BackAccompaniedLinkController@store']);
    Route::get('BackAccompaniedLinkEdit', ['as' => 'BackAccompaniedLink.Edit', 'uses' => 'admin\site_management\BackAccompaniedLinkController@edit']);
    Route::post('BackAccompaniedLinkUpdate', ['as' => 'BackAccompaniedLink.update', 'uses' => 'admin\site_management\BackAccompaniedLinkController@update']);
    Route::get('BackAccompaniedLinkDelete', ['as' => 'BackAccompaniedLink.Delete', 'uses' => 'admin\site_management\BackAccompaniedLinkController@delete']);

    //客戶管理
    //-------- 會員維護
    Route::get('BackMembers', 'admin\members_management\BackMembersController@index');
    Route::get('BackMembersAdd', ['uses' => 'admin\members_management\BackMembersController@add']);
    Route::post('BackMembersStore', ['as' => 'BackMembers.store', 'uses' => 'admin\members_management\BackMembersController@store']);
    Route::post('BackMembersDistrict', 'admin\members_management\BackMembersController@GetDistrict');
    Route::get('BackMembersEdit', ['as' => 'BackMembers.Edit', 'uses' => 'admin\members_management\BackMembersController@edit']);
    Route::post('BackMembersUpdate', ['as' => 'BackMembers.Update', 'uses' => 'admin\members_management\BackMembersController@update']);
    Route::get('BackMembersDelete', ['as' => 'BackMembers.Delete', 'uses' => 'admin\members_management\BackMembersController@delete']);
    //詢問信
    Route::get('BackContact', ['as' => 'BackContact.index', 'uses' => 'admin\contact\BackContactController@index']);
    Route::get('BackContactRead', 'admin\contact\BackContactController@read');
    
    //EasyUI
    Route::group(['prefix' => 'EasyUI'], function () {
        Route::get('/Select', 'admin\EasyUIController@Select');
        //Route::post('', 'admin\EasyUIController@store');
        Route::post('', ['as' => 'EasyUI.store', 'uses' => 'admin\EasyUIController@store']);

        Route::post('/update', 'admin\EasyUIController@update');
        Route::post('/delete', 'admin\EasyUIController@destroy');
        Route::get('/SmartSort', 'admin\EasyUIController@SmartSort');
        Route::post('/disabled', 'admin\EasyUIController@disabled');
    


    });
});
//^^^^^^^^^^^^^^^^^ auth link ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Route::group(['prefix' => 'auth'], function () {
    //註冊
    Route::get('/register', ['as' => 'register.index', 'uses' => 'Auth\AuthController@getregister']);
    Route::post('/register', ['as' => 'register.process', 'uses' => 'Auth\AuthController@Postregister']);
});
//登入
Route::post('Login', ['as' => 'Auth.authenticate', 'uses' => 'Auth\AuthController@authenticate']);
//登出
Route::get('Logout', ['as' => 'BackLogin.Logout', 'uses' => 'admin\BackLoginController@Logout']);

Route::group(['middleware' => ['FooterData']], function () {
    Route::get('Home', ['as' => 'Reception.Index', 'uses' => 'Reception\Reception\ReceptionController@index']);
    Route::get('About', ['as' => 'Reception.About', 'uses' => 'Reception\Reception\ReceptionController@about']);
    Route::get('Service', ['as' => 'Reception.Service', 'uses' => 'Reception\Reception\ReceptionController@service']);
    Route::get('Introduction', ['as' => 'Reception.Introduction', 'uses' => 'Reception\Reception\ReceptionController@introduction']);
    Route::get('Contact', ['as' => 'Reception.Contact', 'uses' => 'Reception\Reception\ReceptionController@contact']);
    Route::post('ContactMail', ['as' => 'Reception.ContactMail', 'uses' => 'Reception\Reception\ReceptionController@contactMail']);
    Route::post('UploadFile', ['as' => 'Reception.UploadFile', 'uses' => 'Reception\Reception\ReceptionController@uploadfile']);
    Route::get('UploadFile', ['as' => 'Reception.UploadFile', 'uses' => 'Reception\Reception\ReceptionController@uploadfile']);
    Route::post('delete_file', ['as' => 'Reception.delete_file', 'uses' => 'Reception\Reception\ReceptionController@delete_file']);
    Route::get('delete_file', ['as' => 'Reception.delete_file', 'uses' => 'Reception\Reception\ReceptionController@delete_file']);

    //前台
    //-----------關於我們
    Route::get('AboutUs', ['as' => 'AboutUs.index', 'uses' => 'Reception\Reception\AboutUsController@index']);

    //-----------線上客服
    Route::get('CustomerService', ['as' => 'Guide.index', 'uses' => 'Reception\Reception\GuideController@CustomerService']);

    //-----------登入
    Route::get('CartLogin', ['as' => 'Login.index', 'uses' => 'Reception\Reception\LoginController@index']);
    Route::post('CartLogin', ['as' => 'Login.index', 'uses' => 'Reception\Reception\LoginController@check']);
    //-----------登入
    Route::get('PageLogin', ['as' => 'Login.PageLogin', 'uses' => 'Reception\Reception\LoginController@PageLogin']);
    Route::post('PageLogin', ['as' => 'Login.PageLogin', 'uses' => 'Reception\Reception\LoginController@Verify']);

    //-----------忘記密碼
    Route::get('ForgetPwd', ['as' => 'Login.ForgetPwd', 'uses' => 'Reception\Reception\LoginController@ForgetPwd']);
    Route::post('ForgetPwd', ['as' => 'Login.ForgetPwd', 'uses' => 'Reception\Reception\LoginController@ResetPwd']);

    //-----------登出
    Route::get('PageLogout', ['as' => 'Login.PageLogout', 'uses' => 'Reception\Reception\LoginController@PageLogout']);

    //-----------檢查 Email
    Route::post('CheckEmail', ['as' => 'CheckOut.CheckEmail', 'uses' => 'Reception\Reception\CheckOutController@CheckEmail']);

    //-----------最新消息
    Route::get('News', ['as' => 'News.index', 'uses' => 'Reception\Reception\NewsController@index']);
    //-----------聯絡我們
    Route::get('Contact', ['as' => 'Contact.index', 'uses' => 'Reception\Reception\ContactsController@index']);
    Route::get('ContactMsg', ['as' => 'Contact.getMsg', 'uses' => 'Reception\Reception\ContactsController@getMsg']);
    Route::post('ContactPost', ['as' => 'Contact.Post', 'uses' => 'Reception\Reception\ContactsController@post']);

});

