<?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!
|
*/



#Auth Routes
Route::group(['middleware' => 'auth'], function() {
/**********************- To be shared by all 3 payroll items -********************/
#Dashboard
Route::get('/kinetic', 'DashboardController@index');

Route::post('/allowances/employees/save_selected_employees', 'AllowancesController@save_selected_employees');
Route::post('/allowances/employees/filter_employees', 'AllowancesController@filter_employees');
Route::post('/allowances/employees/update_group_members', 'AllowancesController@update_group_members');
Route::post('/allowances/employees/delete_group', 'AllowancesController@delete_group');

/**********************- To be shared by all 3 payroll items -********************/

#Allowances
Route::get('/allowances/edit_group/{group_id}', 'AllowancesController@edit_group');
Route::get('/allowances/employees/{allowance}', 'AllowancesController@add_employees');
Route::resource('/allowances', 'AllowancesController');
Route::post('/allowances/destroy', 'AllowancesController@destroy');

#Range
Route::get('/ranges/edit/{range_id}', 'RangesController@edit');
Route::resource('/ranges', 'RangesController');
Route::post('/ranges/destroy', 'RangesController@destroy');

#Relief
Route::get('/relief/edit_group/{group_id}', 'ReliefController@edit_group');
Route::get('/relief/employees/{relief}', 'ReliefController@add_employees');
Route::resource('/relief', 'ReliefController');
Route::post('/relief/destroy', 'ReliefController@destroy');

#Deductions
Route::get('/deductions/edit_group/{group_id}', 'DeductionsController@edit_group');
Route::get('/deductions/employees/{deduction}', 'DeductionsController@add_employees');
Route::resource('/deductions', 'DeductionsController');
Route::post('/deductions/destroy', 'DeductionsController@destroy');


#ProcessPayrollController
Route::post('/process_payroll/process', 'ProcessPayrollController@process_payroll');
Route::resource('/process_payroll', 'ProcessPayrollController');

#PayslipController
Route::get('/payslip', 'PayslipController@index');
Route::get('/payslip/view_payslip', 'PayslipController@view_payslip');

#EmployeesController
Route::resource('/employees','EmployeeController')->middleware('admin');
Route::get('/export','EmployeeController@export')->name('export');
<<<<<<< 8c98d41a67e0ec45e1fd64b04b779360352c1dcf
Route::post('/employees/import', 'EmployeeController@import')->name('import');

=======
Route::post('/import', 'EmployeeController@import')->name('import');
Route::get('/personal/{id}','EmployeeController@personal_info')->name('personal');
Route::post('/personal/{id}/store','EmployeeController@store_personal_info')->name('store_personal');
// Route::get('/personal/{id}','EmployeeController@show_personal_info')->name('show_personal');
Route::get('/personal/{id}/edit','EmployeeController@edit_personal_info')->name('edit_personal');
Route::post('/personal/{id}/update','EmployeeController@update_personal_info')->name('update_personal');
Route::get('/contact/{id}','EmployeeController@contact')->name('contact');
Route::post('/contact/{id}/store','EmployeeController@store_contact')->name('store_contact');
Route::get('/contact/{id}/edit','EmployeeController@edit_contact')->name('edit_contact');
Route::post('/contact/{id}/update','EmployeeController@update_contact')->name('update_contact');
Route::get('/salary/{id}','EmployeeController@salary')->name('salary');
Route::post('/salary/{id}/store','EmployeeController@store_salary')->name('store_salary');
Route::get('/salary/{id}/edit','EmployeeController@edit_salary')->name('edit_salary');
Route::post('/salary/{id}/update','EmployeeController@update_contact')->name('update_salary');
>>>>>>> Storing employee info

#PayfrequencyController
Route::resource('/payfrequency', 'PayfrequencyController');
#DepartmentController
Route::resource('/departments', 'DepartmentController');
#BusinessUnitController
Route::resource('/branches', 'BranchController');

#RolesController
Route::resource('/roles', 'RolesController');
#ReportingManagerController
Route::resource('/managers', 'ReportingManagerController');
#JobTitleController
Route::resource('/jobtitle', 'JobTitleController');
#EmploymentStatusController
Route::resource('/status', 'EmploymentStatusController');
#EmergencyController
Route::resource('emergency','EmergencyController');
#DependantController
Route::resource('dependants','DependantController');
#CertificationController
Route::resource('certification','CertificationController');

});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('admin/routes', 'HomeController@admin')->middleware('admin');
Route::get('manager/routes', 'HomeController@manager')->middleware('admin');


Route::resource('businessunit','BusinessunitController');
