<?php

use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| 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 view('welcome');
});


Route::post('/custom/auth', 'LoginController@authenticate');
Route::post('/custom/register', 'CustomAuthController@postRegister');

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

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

		Route::get('/', 'admin\AdminController@dashboard');
		Route::get('orders', 'admin\AdminController@orders');
		Route::get('orders/view/{ck}', 'admin\AdminController@viewOrders');
		Route::get('orders/view/{ck}/print', 'admin\AdminController@printOrder');
		Route::get('create-store', 'admin\AdminController@createStore');

		Route::post('orders/download', 'admin\AdminController@download');

		Route::post('create-store/save', 'admin\AdminController@saveNewStore');
		Route::get('stores-list', 'admin\AdminController@storeList');

		Route::get('view-store/{id}', 'admin\AdminController@viewStore');
		Route::post('store/update', 'admin\AdminController@updateStore');

		Route::post('store/delete/{id}/{url}', 'admin\AdminController@deleteStore');

		Route::get('overlay-pattern', 'admin\AdminController@overlayPattern');
		Route::get('overlay-pattern', 'admin\AdminController@overlayPattern');

		Route::get('reports', 'admin\AdminController@viewReports');
		Route::get('commission', 'admin\AdminController@viewCommission');

		Route::get('clipart-add', 'admin\AdminController@addClipart');
		Route::get('cliparts', 'admin\AdminController@viewClipart');
		Route::get('clipart-categories', 'admin\AdminController@viewClipartCategories');
		Route::post('clipart/save-category', 'admin\AdminController@saveClipartCategory');
		Route::post('clipart/save-svg-clipart', 'admin\AdminController@saveSVGClipart');
		Route::post('clipart/delete-clipart-category', 'admin\AdminController@deleteClipartCategory');
		Route::post('clipart/save-clipart-cat-ordering', 'admin\AdminController@saveClipartCatOrdering');
		Route::post('clipart/update-clipart-category', 'admin\AdminController@updateClipartCategory');
		Route::post('clipart/delete', 'admin\AdminController@deleteClipart');

		Route::get('visualizer/add', 'admin\AdminController@visualizerAdd');
		Route::get('visualizer', 'admin\AdminController@visualizer');
		Route::post('visualizer/request/get-sports-category', 'admin\AdminController@selectSportsCategory');
		Route::get('/get-overlay-pattern', 'admin\AdminController@getOverlayPattern');
		Route::post('/add-new-visualizer/save', 'admin\AdminController@saveNewVisualizer');
		Route::get('/view-visualizer/{id}', 'admin\AdminController@viewVisualizer');
		Route::post('visualizer/delete', 'admin\AdminController@deleteVisualizer');
		Route::post('visualizer/update', 'admin\AdminController@updateVisualizer');


		Route::get('print-files', 'admin\AdminController@printFiles');
		Route::get('print-files/{tempid}', 'admin\AdminController@printFilesDetails');
		Route::post('print-files/delete', 'admin\AdminController@printFilesDelete');
		Route::get('upload-print-file', 'admin\AdminController@uploadPrintFile');
		Route::post('upload-print-file/save', 'admin\AdminController@uploadPrintFileSave');



		Route::get('user-list', 'admin\AdminController@userList');

		Route::post('post/update-user-as-store-owner', 'admin\AdminController@updatUserAsStoreOwner');
		Route::post('post/remove-store-access', 'admin\AdminController@removeStoreAccess');
		Route::post('post/save-new-store-owner', 'admin\AdminController@saveNewStoreOwner');

		Route::post('post/show-store-order-details', 'admin\AdminController@showStoreOrderDetails');

		// Download Routes /////////////////
		Route::get('orders/download/tshirt/{ck}/{id}', 'admin\AdminController@downloadPrintFile_tshirt');
		Route::get('orders/download/hoodie/{ck}/{id}', 'admin\AdminController@downloadPrintFile_hoodie');
		Route::get('orders/download/jersey/{ck}/{id}', 'admin\AdminController@downloadPrintFile_jersey');
		Route::get('orders/download/mask/{ck}/{id}', 'admin\AdminController@downloadPrintFile_mask');
		// End Download Routes /////////////

		Route::get('tax-settings', 'admin\AdminController@taxIndex');
		Route::get('tracking', 'admin\AdminController@trackingIndex');
		Route::post('post/update-hibernate', 'admin\AdminController@updateHibernate');

		Route::post('import', 'admin\AdminController@importExcel')->name('import');



		Route::get('duplicate-store/{id}/{newstore_id}', 'admin\AdminController@duplicateStore');


		Route::get('home-carousel', 'admin\AdminController@homeCarousel');
		Route::get('order-status', 'admin\AdminController@orderStatus');
	});
});



Route::auth();

// Route::get('/home', 'HomeController@index');
