<?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('/', function () {
    return view('welcome');
});

0204040805

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
*/
//Route::post('ipstore', 'NetworkOperatorsController@ipStore');

Route::get('testemail', 'UtilityController@EmailTest');

Route::get('testmap', 'UtilityController@maptest');

Route::get('login', 'LoginController@getLoginPage');

Route::post('login', 'LoginController@handleLogin');
Route::get('logout', 'LoginController@handle_logout');


Route::post('account/register', 'LoginController@registerAccount');

Route::get('ussd/dashboard', 'UssdDashboardController@index');


Route::group(['middleware' => ['checklogin']], function(){
	//Route::get('/', 'MeetingReportsController@showDetails');

	Route::get('dashboard/get_events', 'DashboardController@getEvents');
	Route::get('/', 'DashboardController@index');

	//Route::get('dashboard', 'MeetingReportsController@showDetails');
	Route::get('dashboard', 'DashboardController@index');
	Route::get('reportdetails/{id}', 'MeetingReportsController@showDetails');

	Route::get('mnos/all', 'NetworkOperatorsController@getMnosJson');
	Route::post('mnos/ip_store', 'NetworkOperatorsController@ipStore');
	Route::post('mnos/finance_store', 'NetworkOperatorsController@financeStore');
	Route::post('mnos/finance_update', 'NetworkOperatorsController@financeUpdate');

	Route::get('mnos/get_payment/{id}', 'NetworkOperatorsController@getSinglePayment');
	Route::get('mnos/downloadfile/{id}', 'NetworkOperatorsController@getMnoFile');
	Route::post('mnos/notes_update', 'NetworkOperatorsController@notesUpdate');
	Route::post('mnos/notes_store', 'NetworkOperatorsController@notesStore');
	Route::resource('mnos', 'NetworkOperatorsController');

	Route::resource('services', 'ServicesController');

	Route::get('generaldocuments/list/{category}', 'GeneralDocumentsController@listcategory');
	Route::get('generaldocuments/list/json/{category}', 'GeneralDocumentsController@getDocumentsCategoryJson');
	
	Route::get('generaldocuments/download/{id}', 'GeneralDocumentsController@getDocument');
	Route::get('generaldocuments/all', 'GeneralDocumentsController@getDocumentsJson');
	
	Route::resource('generaldocuments', 'GeneralDocumentsController');

	Route::get('senderids/all', 'SenderIdController@getSenderIdsJson');
	Route::resource('senderids', 'SenderIdController');

	Route::get('staffmembers/all', 'StaffMembersController@getstaffMemberssJson');
	Route::resource('staffmembers', 'StaffMembersController');
	


	Route::get('clients/downloadfile/{id}', 'ClientsController@getClientFile');
	Route::post('clients/shortcode_store', 'ClientsController@shortcodeStore');
	Route::post('clients/notes_update', 'ClientsController@notesUpdate');
	Route::post('clients/notes_store', 'ClientsController@notesStore');
	Route::post('clients/finance_store', 'ClientsController@financeStore');
	Route::post('clients/finance_update', 'ClientsController@financeUpdate');
	
	Route::get('clients/get_payment/{id}', 'ClientsController@getPayment');
	Route::get('clients/get_note/{id}', 'ClientsController@getSingleNote');
	Route::get('clients/create-notes', 'ClientsController@createNotes');
	Route::get('clients/shortcodes', 'ClientsController@getShortCodes');
	
	Route::get('clients/readonly/{id}', 'ClientsController@showReadonly');
	Route::get('clients/all', 'ClientsController@getClientJson');
	Route::post('clients/raw', 'ClientsController@getClientJsonRawJs');
	Route::get('clients/indexrawjs', 'ClientsController@indexRawJs');
	Route::get('clients/indextabulator', 'ClientsController@indexTabulator');
	Route::get('clients/servicesedit/{id}', 'ClientsController@editservice')->name('clients.editservice');
	Route::get('clients/services/{id}', 'ClientsController@showservices')->name('clients.services');
	Route::resource('clients', 'ClientsController');

	Route::get('reports/search', 'MeetingReportsController@search');
	Route::post('reports/samcomment', 'MeetingReportsController@store_sam_comment');
	Route::resource('reports', 'MeetingReportsController');

	Route::resource('systemusers', 'SystemUsersController');

	Route::get('infrastructure/createdirect/{id}', 'ClickInfrastructureController@create_direct');
	Route::get('infrastructure/editdirect/{id}', 'ClickInfrastructureController@edit_direct');

	Route::post('infrastructure/storedirect', 'ClickInfrastructureController@store_direct');
	Route::post('infrastructure/updatedirect', 'ClickInfrastructureController@update_direct');

	Route::get('infrastructure/revealpassword/{id}', 'ClickInfrastructureController@reveal_password');
	Route::post('infrastructure/updateserver', 'ClickInfrastructureController@updateserver');
	
	Route::post('infrastructure/storeserver', 'ClickInfrastructureController@storeserver');
	Route::get('infrastructure/all', 'ClickInfrastructureController@getServerListJson');

	Route::get('infrastructure/create', 'ClickInfrastructureController@create');

	Route::get('infrastructure/server-list', 'ClickInfrastructureController@server_list');
	Route::get('infrastructure/editserver-list/{id}', 'ClickInfrastructureController@edit_server');

	Route::get('officelocations/download/{id}', 'OfficeLocationsController@getDocument');
	Route::post('officelocations/filesupdate', 'OfficeLocationsController@filesUpdate');
	Route::post('officelocations/filestore', 'OfficeLocationsController@fileStore');
	Route::get('officelocations/createfiles/{id}', 'OfficeLocationsController@createfiles');
	Route::get('officelocations/allfiles', 'OfficeLocationsController@getBranchFilesJson');
	Route::get('officelocations/editfile/{id}', 'OfficeLocationsController@show_edit_files_form');
	Route::get('officelocations/showfiles/{id}', 'OfficeLocationsController@showfiles');

	Route::resource('officelocations', 'OfficeLocationsController');

	Route::get('infrastructure/domains', 'ClickInfrastructureController@domains');
	Route::get('infrastructure/servers', 'ClickInfrastructureController@servers');

	Route::get('infrastructure/create', 'ClickInfrastructureController@create');

	Route::resource('ussdclients', 'UssdClientsPaymentsController');

	Route::get('clickapps/shortcodes', 'ClickAppsController@getShortCodes');

	Route::resource('clickapps', 'ClickAppsController');
	
	Route::get('clientpaymentreports/all', 'ClientPaymentReportsController@getClientPaymentsJson');
	Route::get('clientpaymentreports', 'ClientPaymentReportsController@index');

	Route::get('mnopaymentreports/all', 'MnoPaymentsController@getMnoPaymentsJson');
	Route::get('mnopaymentreports', 'MnoPaymentsController@index');

	Route::resource('marketreport', 'MarketerReportController');
});

