<?php

/*
|--------------------------------------------------------------------------
| 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('/test',function(){
	echo __DIR__;
});

Route::get('/','PageController@showIndex');
Route::get('/clients','PageController@showClients');
Route::get('/gallery','GalleryController@showGallery');
Route::get('/post-requirements','PageController@showRequirements');
Route::post('/post-requirements','PageController@postRequirements');

// About
Route::get('/about/about-us', function(){
	return view('about.aboutus');
});
Route::get('/about/company-profile',function(){
	return view('about.companyprofile');
});
Route::get('/about/message-from-chairperson',function(){
	return view('about.messagefromchairperson');
});
Route::get('/about/message-from-vice-chairperson',function(){
	return view('about.messagefromvicechairperson');
});
Route::get('/about/message-from-md',function(){
	return view('about.messagefrommd');
});
Route::get('/about/board-of-directors',function(){
	return view('about.board');
});

// Recruiting
Route::get('/recruiting/legal-documents', function () {
	return redirect('/about/legal-documents');
});
Route::get('/about/legal-documents', function () {
	return view('recruiting.legaldocuments');
});
Route::get('/recruiting/sample-documents', function () {
	return view('recruiting.sampledocuments');
});
Route::get('/recruiting/recruitment-process', function () {
	return view('recruiting.recruitmentprocess');
});
Route::get('/recruiting/required-documents', function () {
	return view('recruiting.requireddocuments');
});
Route::get('/recruiting/documentation', function () {
	return view('recruiting.documentation');
});
Route::get('/recruiting/terms-and-conditions', function () {
	return view('recruiting.terms-and-conditions');
});

// Contact Us
Route::get('/contact-us', function () {
	return view('contactus');
});
Route::post('/contact-us','EmailController@sendContactMail');

// Categories Route

Route::get('/category','JobCategoryController@showJobCategories');
Route::get('/category/{slug}','JobCategoryController@showJobCategory');

// Jobs Route
Route::get('/jobs','JobController@showJobs');
Route::get('/jobs/search','JobController@searchJob');
Route::get('/jobs/{slug}','JobController@showJob');
Route::put('/jobs','JobController@addJob')->middleware('auth');
Route::put('/jobs/apply','JobApplicationController@addApplication');

// Admin Panel
Route::get('/admin', 'PageController@showAdminPanel')->name('home')->middleware('auth');
Route::get('/admin/job','JobController@showJobsForAdmin')->middleware('auth');
Route::patch('/admin/job','JobController@editJob')->middleware('auth');
Route::delete('/admin/job','JobController@deleteJob')->middleware('auth');
Route::get('/admin/job/add','JobController@showAddJob')->middleware('auth');
Route::put('/admin/job/add','JobController@addJob')->middleware('auth');
Route::get('/admin/company','CompanyController@showCompaniesForAdmin')->middleware('auth');
Route::delete('/admin/company','CompanyController@deleteCompany')->middleware('auth');
Route::patch('/admin/company','CompanyController@editCompany')->middleware('auth');
Route::get('/admin/company/add','CompanyController@showAddCompany')->middleware('auth');
Route::put('/admin/company/add','CompanyController@addCompany')->middleware('auth');
Route::get('/admin/gallery','GalleryController@showGalleryForAdmin')->middleware('auth');
Route::delete('/admin/gallery','GalleryController@deleteFromGallery')->middleware('auth');
Route::get('/admin/gallery/add','GalleryController@showAddToGallery')->middleware('auth');
Route::put('/admin/gallery/add','GalleryController@addToGallery')->middleware('auth');
Route::get('/admin/gallery/add/video','GalleryController@showAddVideoToGallery')->middleware('auth');
Route::put('/admin/gallery/add/video','GalleryController@addVideoToGallery')->middleware('auth');
Route::get('/admin/category','JobCategoryController@showJobCategoriesForAdmin')->middleware('auth');
Route::get('/admin/category/add','JobCategoryController@showAddJobCategory')->middleware('auth');
Route::put('/admin/category/add','JobCategoryController@addJobCategory')->middleware('auth');
Route::delete('/admin/category','JobCategoryController@deleteCategory')->middleware('auth');
Route::patch('/admin/category','JobCategoryController@editCategory')->middleware('auth');

//Auth::routes();

// Authentication Routes...
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');

// Registration Routes...
//Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::get('register', function(){
	return redirect('/login');
})->name('register');
//Route::post('register', 'Auth\RegisterController@register');

// Password Reset Routes...
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset');

Route::get('/test-mail',function(){
	
});