<?php

use Illuminate\Support\Facades\Route;
use Backend\BillGenerateController;
use Backend\FloorController;
use Backend\BusinessTypeController;
use Backend\ServiceChargeController;
use Backend\ExpenseCategoryController;
use Backend\ShopController;
use Backend\ExpenseController;
use Backend\ExpenseReceiptController;
use Backend\PushNotificationController;
use Backend\userRole\RoleController;
use Backend\userRole\UserController;
use Backend\BlogController;
use Backend\MemberController;




//All the frontend route list...
Route::get('/','FrontendController@index')->name('homepage');
Route::post('add-appoinment-data', 	[App\Http\Controllers\FrontendController::class, 'saveAppoinmentData'])->name('add-appoinment-data');
Route::get('access-denied', 		[App\Http\Controllers\FrontendController::class, 'accessDenied'])->name('access.denied');
Route::get('privacy/policy', 		[App\Http\Controllers\FrontendController::class, 'privacyPolicy'])->name('privacy-policy');

Auth::routes();

Route::get('/login',       								[App\Http\Controllers\Auth\LoginController::class, 'getLoginPageForAdmin'])->name('login');
Route::get('/admin-login',       						[App\Http\Controllers\Auth\LoginController::class, 'getLoginPage'])->name('admin.login');
Route::post('/admin-login',   							[App\Http\Controllers\Auth\LoginController::class, 'login'])->name('login');

//All the backend route list...
Route::group(['middleware'=>['auth']],function(){
	
	Route::get('/admin/dashboard', 						[App\Http\Controllers\Backend\AdminController::class, 'adminDashboard'])->name('admin.home');
	Route::get('/admin/dashboard', 						[App\Http\Controllers\Backend\AdminController::class, 'adminDashboard'])->name('admin.dashboard');
	Route::get('/logout', 								[App\Http\Controllers\Backend\AdminController::class, 'adminLogout'])->name('admin.logout');

	//UserRolePermission System Controller...
	Route::resource('users', UserController::class);
	Route::get('user-active/{id}', 		[App\Http\Controllers\Backend\userRole\UserController::class, 'userActive'])->name('user-active');
    Route::get('user-inactive/{id}', 	[App\Http\Controllers\Backend\userRole\UserController::class, 'userInactive'])->name('user-inactive');
    Route::get('user-delete/{id}', 		[App\Http\Controllers\Backend\userRole\UserController::class, 'destroy'])->name('user-delete');
    Route::post('user-password-update/{id}', [App\Http\Controllers\Backend\userRole\UserController::class, 'userPassword'])->name('user-password-update');
	Route::resource('roles', RoleController::class);

	//Bill Generate Controller...
	Route::resource('bill-generate',    BillGenerateController::class);
	Route::get('bill-generate-details/{id}',    [App\Http\Controllers\Backend\BillGenerateController::class, 'detailsBillGenerate'])->name('bill-generate-details');
	Route::get('bill-generate-delete/{id}',     [App\Http\Controllers\Backend\BillGenerateController::class, 'destroy'])->name('bill-generate-delete');
	//Shop Bill Payment
	Route::post('add-shop-payment',     		[App\Http\Controllers\Backend\BillGenerateController::class, 'addShopBillPayment'])->name('add-shop-payment');
	Route::get('shop-payment-invoice/{id}',     [App\Http\Controllers\Backend\BillGenerateController::class, 'getShopPaymentInvoice'])->name('shop-payment-invoice');
	
	//Others Controller...
	//Floor
	Route::resource('floor', FloorController::class);
	Route::get('floor-active/{id}',             [App\Http\Controllers\Backend\FloorController::class, 'floorActive'])->name('floor-active');
	Route::get('floor-inactive/{id}',           [App\Http\Controllers\Backend\FloorController::class, 'floorInactive'])->name('floor-inactive');
	Route::get('floor-delete/{id}',           	[App\Http\Controllers\Backend\FloorController::class, 'destroy'])->name('floor-delete');
	//Floor
	Route::resource('business-type', BusinessTypeController::class);
	Route::get('business-type-active/{id}',      [App\Http\Controllers\Backend\BusinessTypeController::class, 'businessTypeActive'])->name('business-type-active');
	Route::get('business-type-inactive/{id}',    [App\Http\Controllers\Backend\BusinessTypeController::class, 'businessTypeInactive'])->name('business-type-inactive');
	Route::get('business-type-delete/{id}',    	 [App\Http\Controllers\Backend\BusinessTypeController::class, 'destroy'])->name('business-type-delete');
	//ServiceCharge
	Route::resource('service-charge', ServiceChargeController::class);
	Route::get('service-charge-active/{id}',      [App\Http\Controllers\Backend\ServiceChargeController::class, 'serviceChargeActive'])->name('service-charge-active');
	Route::get('service-charge-inactive/{id}',    [App\Http\Controllers\Backend\ServiceChargeController::class, 'serviceChargeInactive'])->name('service-charge-inactive');
	Route::get('service-charge-delete/{id}',      [App\Http\Controllers\Backend\ServiceChargeController::class, 'destroy'])->name('service-charge-delete');
	//Shop
	Route::resource('shop', ShopController::class);
	Route::get('shop-active/{id}',                [App\Http\Controllers\Backend\ShopController::class, 'shopActive'])->name('shop-active');
	Route::get('shop-inactive/{id}',              [App\Http\Controllers\Backend\ShopController::class, 'shopInactive'])->name('shop-inactive');
	Route::get('shop-delete/{id}',                [App\Http\Controllers\Backend\ShopController::class, 'destroy'])->name('shop-delete');
	//Profile
    Route::get('shop-profile/{id}',   			  [App\Http\Controllers\Backend\ShopDetailsController::class, 'shopProfile'])->name('shop-profile');
    Route::post('add-due-bill-payment-shop-wise',  [App\Http\Controllers\Backend\ShopDetailsController::class, 'addDueBillPaymentShopWise'])->name('add-due-bill-payment-shop-wise');
    Route::get('get-shop-due-payment-invoice/{id}', [App\Http\Controllers\Backend\ShopDetailsController::class, 'getShopDuePaymentInvoice'])->name('get-shop-due-payment-invoice');

	//For Blog Controller Section...
	Route::resource('blog', BlogController::class);
	Route::get('blog-active/{id}', 						[App\Http\Controllers\Backend\BlogController::class, 'blogActive'])->name('blog.active');
    Route::get('blog-inactive/{id}', 					[App\Http\Controllers\Backend\BlogController::class, 'blogInactive'])->name('blog.inactive');
	Route::get('active-blog-list', 						[App\Http\Controllers\Backend\BlogController::class, 'activeList'])->name('active-blog-list');
	Route::get('inactive-blog-list', 					[App\Http\Controllers\Backend\BlogController::class, 'inActiveList'])->name('inactive-blog-list');
	Route::get('/blog/delete/{id}', 					[App\Http\Controllers\Backend\BlogController::class, 'destroy'])->name('blog.delete');
	
	//Member Controller
	Route::resource('member', MemberController::class);
	Route::get('member-active/{id}', 			[App\Http\Controllers\Backend\MemberController::class, 'memberActive'])->name('member-active');
    Route::get('member-inactive/{id}', 			[App\Http\Controllers\Backend\MemberController::class, 'memberInactive'])->name('member-inactive');
	Route::get('member-delete/{id}', 			[App\Http\Controllers\Backend\MemberController::class, 'destroy'])->name('member-delete');
	Route::get('/member-profile/{id}', 			[App\Http\Controllers\Backend\MemberController::class, 'getMemberProfile'])->name('member-profile');
	Route::get('/member-profile-update/{id}', 	[App\Http\Controllers\Backend\MemberController::class, 'getMemberProfile'])->name('member-profile.update');


	//Expense Category Controller...
	Route::resource('expense-category', ExpenseCategoryController::class);
	Route::get('active-expense-category-list', 			[App\Http\Controllers\Backend\ExpenseCategoryController::class, 'activeList'])->name('active-expense-category-list');
	Route::get('inactive-expense-category-list', 		[App\Http\Controllers\Backend\ExpenseCategoryController::class, 'inActiveList'])->name('inactive-expense-category-list');
	Route::get('expense-category-delete/{id}', 			[App\Http\Controllers\Backend\ExpenseCategoryController::class, 'destroy'])->name('expense-category.delete');
	Route::get('expense-category-active/{id}', 			[App\Http\Controllers\Backend\ExpenseCategoryController::class, 'expenseCategoryActive'])->name('expense-category-active');
    Route::get('expense-category-inactive/{id}', 		[App\Http\Controllers\Backend\ExpenseCategoryController::class, 'expenseCategoryInactive'])->name('expense-category-inactive');
	
	//Expense Controller...
	Route::resource('expense', ExpenseController::class);
	Route::get('active-expense-list', 					[App\Http\Controllers\Backend\ExpenseController::class, 'activeList'])->name('active-expense-list');
	Route::get('inactive-expense-list', 				[App\Http\Controllers\Backend\ExpenseController::class, 'inActiveList'])->name('inactive-expense-list');
	Route::get('expense-delete/{id}', 					[App\Http\Controllers\Backend\ExpenseController::class, 'destroy'])->name('expense.delete');
	Route::get('expense-active/{id}', 					[App\Http\Controllers\Backend\ExpenseController::class, 'expenseActive'])->name('expense-active');
    Route::get('expense-inactive/{id}', 				[App\Http\Controllers\Backend\ExpenseController::class, 'expenseInactive'])->name('expense-inactive');
	
	//Expense Receipt Controller...
	Route::resource('expense-receipt', ExpenseReceiptController::class);
	Route::post('get-all-expense-with-category-id', 	[App\Http\Controllers\Backend\ExpenseReceiptController::class, 'getExpenseWithCategory'])->name('get-all-expense-with-category-id');
	Route::post('expense-receipt-update', 				[App\Http\Controllers\Backend\ExpenseReceiptController::class, 'update'])->name('expense-receipt.update');
	Route::post('expense-receipt-delete', 				[App\Http\Controllers\Backend\ExpenseReceiptController::class, 'removeExpenseService'])->name('expense-receipt.delete');
	Route::post('save-all-expense-receipt', 			[App\Http\Controllers\Backend\ExpenseReceiptController::class, 'saveAllExpenseReceipt'])->name('save-all-expense-receipt');
	Route::get('get-all-expense-receipt/{id}', 			[App\Http\Controllers\Backend\ExpenseReceiptController::class, 'getAllExpenseReceipt'])->name('get-all-expense-receipt');
	
	//Admin Profile Route is Here...
	Route::get('/admin/profile', 						[App\Http\Controllers\Backend\ProfileController::class, 'index'])->name('admin.profile');
	Route::post('/admin/profile/update/{id}', 			[App\Http\Controllers\Backend\ProfileController::class, 'adminUpdate'])->name('admin.profile.update');
	Route::get('/admin/security', 						[App\Http\Controllers\Backend\ProfileController::class, 'adminSecurity'])->name('admin.security');
	Route::post('/admin/security/update', 				[App\Http\Controllers\Backend\ProfileController::class, 'adminSecurityUpdate'])->name('admin.security.update');

	//For Push Notification Controller...
	Route::resource('push-notification', PushNotificationController::class);
	Route::get('/push-notification-edit/{id}', 			[App\Http\Controllers\Backend\PushNotificationController::class, 'edit'])->name('push-notification-edit');
	Route::get('/push-notification-send/{id}', 			[App\Http\Controllers\Backend\PushNotificationController::class, 'pushNotificationSend'])->name('push-notification-send');
	Route::get('/push-notification/delete/{id}', 		[App\Http\Controllers\Backend\PushNotificationController::class, 'destroy'])->name('push-notification.delete');
	//Direct
	Route::get('push-notification-direct', 				[App\Http\Controllers\Backend\PushNotificationController::class, 'pushNotificationDirect'])->name('push-notification-direct');
	Route::get('push-notification-direct-create', 		[App\Http\Controllers\Backend\PushNotificationController::class, 'pushNotificationDirectCreate'])->name('push-notification-direct-create');
	Route::post('push-notification-direct-store', 		[App\Http\Controllers\Backend\PushNotificationController::class, 'pushNotificationDirectStore'])->name('push-notification-direct-store');
	Route::get('push-notification-direct-delete/{id}', 	[App\Http\Controllers\Backend\PushNotificationController::class, 'pushNotificationDirectDelete'])->name('push-notification-direct-delete');

	//All the report route list...
	Route::get('shop-wise-invoice-report', 			[App\Http\Controllers\Backend\report\ShopInvoiceController::class, 'shopWiseInvoiceReport'])->name('shop-wise-invoice-report');
	Route::post('shop-wise-invoice-report', 		[App\Http\Controllers\Backend\report\ShopInvoiceController::class, 'selectedShopWiseInvoiceReport'])->name('shop-wise-invoice-report');
	//Expense
	Route::get('expense-daily-report', 			[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'dailyReport'])->name('expense-daily-report');
	Route::post('expense-daily-report', 		[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'dailyReportWithDate'])->name('expense-daily-report');
	Route::get('expense-monthly-report', 		[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'monthlyExpenseReport'])->name('expense-monthly-report');
	Route::post('expense-monthly-report', 		[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'selectedMonthExpenseReport'])->name('expense-monthly-report');
	Route::get('expense-between-report', 		[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'betweenExpenseReport'])->name('expense-between-report');
	Route::post('expense-between-report', 		[App\Http\Controllers\Backend\report\ExpenseReportController::class, 'selectedBetweenExpenseReport'])->name('expense-between-report');

	//To Invoice Print...
	Route::get('download-shop-payment-invoice/{id}', 		[App\Http\Controllers\Backend\PrintInvoiceController::class, 'downloadShopPaymentInvoice'])->name('download-shop-payment-invoice');
	Route::get('print-shop-payment-invoice/{id}', 			[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printShopPaymentInvoice'])->name('print-shop-payment-invoice');
	Route::get('download-shop-due-payment-invoice/{id}', 	[App\Http\Controllers\Backend\PrintInvoiceController::class, 'downloadShopDuePaymentInvoice'])->name('download-shop-due-payment-invoice');
	Route::get('print-shop-due-payment-invoice/{id}', 		[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printShopDuePaymentInvoice'])->name('print-shop-due-payment-invoice');
	Route::get('print-shop-wise-invoice-report/{year}/{shop_id}', 		[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printShopWiseInvoice'])->name('print-shop-wise-invoice-report');
	//Expense
	Route::get('print-all-expense-receipt/{id}', 						[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printAllExpenseReceipt'])->name('print-all-expense-receipt');
	Route::get('print-expense-daily-report/{selected_date}',			[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printEDR'])->name('print-expense-daily-report');
	Route::get('print-expense-monthly-report/{year}/{month}',			[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printEMR'])->name('print-expense-monthly-report');
	Route::get('print-expense-between-report/{start_date}/{end_date}',	[App\Http\Controllers\Backend\PrintInvoiceController::class, 'printEBR'])->name('print-expense-between-report');
	
	//Setting & Other Route is Here...
	Route::get('/setting', 								[App\Http\Controllers\Backend\SettingController::class, 'index'])->name('setting');
	Route::post('/logo/save', 							[App\Http\Controllers\Backend\SettingController::class, 'store'])->name('logo.store');
	Route::post('/logo/update/{id}', 					[App\Http\Controllers\Backend\SettingController::class, 'update'])->name('logo.update');
	Route::post('/footer-text-submit/{id}', 			[App\Http\Controllers\Backend\SettingController::class, 'footerTextSubmit'])->name('footer-text-submit');
	Route::post('/invoice-logo/save', 					[App\Http\Controllers\Backend\SettingController::class, 'invoiceLogoSave'])->name('invoice-logo.store');
	Route::post('/invoice-logo/update/{id}', 			[App\Http\Controllers\Backend\SettingController::class, 'invoiceLogoUpdate'])->name('invoice-logo.update');
	
});

Route::fallback(function () {
    return view('error.404');
});


