<?php

namespace Config;

// Create a new instance of our RouteCollection class.
$routes = Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}


/*
 * --------------------------------------------------------------------
 * Router Setup
 * --------------------------------------------------------------------
 */
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
$routes->setAutoRoute(true);

//WEB ROUTER ------------------------------------------------------
//------------------------------------------------------------------
$routes->get('/', 'Home::index');
$routes->get('lang/{locale}', 'Language::index');
$routes->get('viewmode/(:alpha)', 'Viewmode::index/$1');

//API ROUTER ------------------------------------------------------
//------------------------------------------------------------------
$routes->get('api/', 'Api::index');
$routes->get('api/status', 'Api::status');
$routes->post('api/signIn', 'Api::signIn');

//API ROUTER USER ------------------------------------------------------
//------------------------------------------------------------------
$routes->get('api/user/', 'Api::user/all');
$routes->get('api/user/(:segment)', 'Api::user/id/$1');
$routes->post('api/user/', 'Api::user/add');
$routes->put('api/user/(:segment)', 'Api::user/edit/$1');
$routes->delete('api/user/(:segment)', 'Api::user/delete/$1');


/*
 * --------------------------------------------------------------------
 * Route Definitions
 * --------------------------------------------------------------------
 */

$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoList']);
    $routes->get('index', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoIndex']);
    $routes->get('list', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoList2']);
    $routes->get('add', 'Tarifaacabado::add', ['as' => 'newTarifaAcabado']);
    $routes->post('add', 'Tarifaacabado::add', ['as' => 'createTarifaAcabado']);
    $routes->post('create', 'Tarifaacabado::create', ['as' => 'ajaxCreateTarifaAcabado']);
    $routes->put('(:num)/update', 'Tarifaacabado::update/$1', ['as' => 'ajaxUpdateTarifaAcabado']);
    $routes->post('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'updateTarifaAcabado']);
    $routes->get('delete/(:num)', 'Tarifaacabado::delete/$1', ['as' => 'deleteTarifaAcabado']);
    $routes->post('datatable', 'Tarifaacabado::datatable', ['as' => 'dataTableOfTarifasAcabado']);
    $routes->post('allmenuitems', 'Tarifaacabado::allItemsSelect', ['as' => 'select2ItemsOfTarifasAcabado']);
    $routes->post('menuitems', 'Tarifaacabado::menuItems', ['as' => 'menuItemsOfTarifasAcabado']);
});
$routes->resource('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaacabado', 'except' => 'show,new,create,update']);


$routes->group('users', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Users::index', ['as' => 'userList']);
    $routes->get('index', 'Users::index', ['as' => 'userIndex']);
    $routes->get('list', 'Users::index', ['as' => 'userList2']);
    $routes->get('add', 'Users::add', ['as' => 'newUser']);
    $routes->post('add', 'Users::add', ['as' => 'createUser']);
    $routes->get('edit/(:num)', 'Users::edit/$1', ['as' => 'editUser']);
    $routes->post('edit/(:num)', 'Users::edit/$1', ['as' => 'updateUser']);
    $routes->get('delete/(:num)', 'Users::delete/$1', ['as' => 'deleteUser']);
    $routes->post('allmenuitems', 'Users::allItemsSelect', ['as' => 'select2ItemsOfUsers']);
    $routes->post('menuitems', 'Users::menuItems', ['as' => 'menuItemsOfUsers']);
});

$routes->group('group', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Group::index', ['as' => 'userGroupList']);
    $routes->get('index', 'Group::index', ['as' => 'groupIndex']);
    $routes->post('edit/(:num)', 'Group::edit/$1', ['as' => 'updateGroup']);
    $routes->get('edit/(:num)', 'Group::edit/$1', ['as' => 'editGroup']);
    $routes->get('delete/(:num)', 'Group::delete/$1', ['as' => 'deleteGroup']);
    $routes->get('add', 'Group::add', ['as' => 'newGroup']);
    $routes->post('add', 'Group::add', ['as' => 'createGroup']);
});

$routes->group('tarifapreimpresion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList']);
    $routes->get('index', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionIndex']);
    $routes->get('list', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList2']);
    $routes->get('add', 'Tarifapreimpresion::add', ['as' => 'newTarifapreimpresion']);
    $routes->post('add', 'Tarifapreimpresion::add', ['as' => 'createTarifapreimpresion']);
    $routes->get('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'editTarifapreimpresion']);
    $routes->post('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'updateTarifapreimpresion']);
    $routes->get('delete/(:num)', 'Tarifapreimpresion::delete/$1', ['as' => 'deleteTarifapreimpresion']);
    $routes->post('allmenuitems', 'Tarifapreimpresion::allItemsSelect', ['as' => 'select2ItemsOfTarifaspreimpresion']);
    $routes->post('menuitems', 'Tarifapreimpresion::menuItems', ['as' => 'menuItemsOfTarifaspreimpresion']);
});


$routes->group('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifasmanipulado::index', ['as' => 'tarifaManipuladoList']);
    $routes->get('add', 'Tarifasmanipulado::add', ['as' => 'newTarifaManipulado']);
    $routes->post('add', 'Tarifasmanipulado::add', ['as' => 'createTarifaManipulado']);
    $routes->post('create', 'Tarifasmanipulado::create', ['as' => 'ajaxCreateTarifaManipulado']);
    $routes->put('(:num)/update', 'Tarifasmanipulado::update/$1', ['as' => 'ajaxUpdateTarifaManipulado']);
    $routes->post('edit/(:num)', 'Tarifasmanipulado::edit/$1', ['as' => 'updateTarifaManipulado']);
    $routes->get('delete/(:num)', 'Tarifasmanipulado::delete/$1', ['as' => 'deleteTarifaManipulado']);
    $routes->post('datatable', 'Tarifasmanipulado::datatable', ['as' => 'dataTableOfTarifasManipulado']);
    $routes->post('allmenuitems', 'Tarifasmanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasManipulado']);
    $routes->post('menuitems', 'Tarifasmanipulado::menuItems', ['as' => 'menuItemsOfTarifasManipulado']);
});
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasmanipulado', 'except' => 'show,new,create,update']);


$routes->group('tarifamanipuladolineas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifamanipuladolineas::index', ['as' => 'tarifaManipuladoLineaList']);
    $routes->get('add', 'Tarifamanipuladolineas::add', ['as' => 'newTarifaManipuladoLinea']);
    $routes->post('add', 'Tarifamanipuladolineas::add', ['as' => 'createTarifaManipuladoLinea']);
    $routes->post('create', 'Tarifamanipuladolineas::create', ['as' => 'ajaxCreateTarifaManipuladoLinea']);
    $routes->put('(:num)/update', 'Tarifamanipuladolineas::update/$1', ['as' => 'ajaxUpdateTarifaManipuladoLinea']);
    $routes->post('(:num)/edit', 'Tarifamanipuladolineas::edit/$1', ['as' => 'updateTarifaManipuladoLinea']);
    $routes->post('datatable', 'Tarifamanipuladolineas::datatable', ['as' => 'dataTableOfTarifaManipuladoLineas']);
    $routes->post('datatable_editor', 'Tarifamanipuladolineas::datatable_editor', ['as' => 'editorOfTarifaManipuladoLineas']);
    $routes->post('allmenuitems', 'Tarifamanipuladolineas::allItemsSelect', ['as' => 'select2ItemsOfTarifaManipuladoLineas']);
    $routes->post('menuitems', 'Tarifamanipuladolineas::menuItems', ['as' => 'menuItemsOfTarifaManipuladoLineas']);
});
$routes->resource('tarifamanipuladolineas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifamanipuladolineas', 'except' => 'show,new,create,update']);


$routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Tipologias::index', ['as' => 'tipologiaLibrosList']);
    $routes->get('index', 'Tipologias::index', ['as' => 'tipologiaLibrosIndex']);
    $routes->get('list', 'Tipologias::index', ['as' => 'tipologiaLibrosList2']);
    $routes->get('add', 'Tipologias::add', ['as' => 'newTipologiaLibros']);
    $routes->post('add', 'Tipologias::add', ['as' => 'createTipologiaLibros']);
    $routes->get('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'editTipologiaLibros']);
    $routes->post('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'updateTipologiaLibros']);
    $routes->get('delete/(:num)', 'Tipologias::delete/$1', ['as' => 'deleteTipologiaLibros']);
    $routes->post('allmenuitems', 'Tipologias::allItemsSelect', ['as' => 'select2ItemsOfTipologiasLibros']);
    $routes->post('menuitems', 'Tipologias::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
});

$routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Imposiciones::index', ['as' => 'imposicionList']);
    $routes->get('add', 'Imposiciones::add', ['as' => 'newImposicion']);
    $routes->post('add', 'Imposiciones::add', ['as' => 'createImposicion']);
    $routes->post('create', 'Imposiciones::create', ['as' => 'ajaxCreateImposicion']);
    $routes->put('(:num)/update', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
    $routes->post('(:num)/edit', 'Imposiciones::edit/$1', ['as' => 'updateImposicion']);
    $routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
    $routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
    $routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
});
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);

$routes->group('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Papelesgenericos::index', ['as' => 'papelGenericoList']);
    $routes->delete('', 'Papelesgenericos::index', ['as' => 'papelGenericoList2']);
    $routes->get('add', 'Papelesgenericos::add', ['as' => 'newPapelGenerico']);
    $routes->post('add', 'Papelesgenericos::add', ['as' => 'createPapelGenerico']);
    $routes->post('create', 'Papelesgenericos::create', ['as' => 'ajaxCreatePapelGenerico']);
    $routes->put('(:num)/update', 'Papelesgenericos::update/$1', ['as' => 'ajaxUpdatePapelGenerico']);
    $routes->post('edit/(:num)', 'Papelesgenericos::edit/$1', ['as' => 'updatePapelGenerico']);
    $routes->post('datatable', 'Papelesgenericos::datatable', ['as' => 'dataTableOfPapelesGenericos']);
    $routes->post('allmenuitems', 'Papelesgenericos::allItemsSelect', ['as' => 'select2ItemsOfPapelesGenericos']);
    $routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
});
$routes->resource('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesgenericos', 'except' => 'show,new,create,update']);

$routes->group('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Papelesimpresion::index', ['as' => 'papelImpresionList']);
    $routes->get('add', 'Papelesimpresion::add', ['as' => 'newPapelImpresion']);
    $routes->post('add', 'Papelesimpresion::add', ['as' => 'createPapelImpresion']);
    $routes->post('create', 'Papelesimpresion::create', ['as' => 'ajaxCreatePapelImpresion']);
    $routes->put('(:num)/update', 'Papelesimpresion::update/$1', ['as' => 'ajaxUpdatePapelImpresion']);
    $routes->post('edit/(:num)', 'Papelesimpresion::edit/$1', ['as' => 'updatePapelImpresion']);
    $routes->post('datatable', 'Papelesimpresion::datatable', ['as' => 'dataTableOfPapelesImpresion']);
    $routes->post('allmenuitems', 'Papelesimpresion::allItemsSelect', ['as' => 'select2ItemsOfPapelesImpresion']);
    $routes->post('menuitems', 'Papelesimpresion::menuItems', ['as' => 'menuItemsOfPapelesImpresion']);
});
$routes->resource('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesimpresion', 'except' => 'show,new,create,update']);

$routes->group('papelimpresiontipologias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('add', 'Papelimpresiontipologias::add', ['as' => 'newPapelImpresionTipologia']);
    $routes->post('add', 'Papelimpresiontipologias::add', ['as' => 'createPapelImpresionTipologia']);
    $routes->post('datatable_editor', 'Papelimpresiontipologias::datatable_editor', ['as' => 'editorOfConsumoTintas']);
    $routes->get('edit/(:num)', 'Papelimpresiontipologias::edit/$1', ['as' => 'editPapelImpresionTipologia']);
    $routes->post('edit/(:num)', 'Papelimpresiontipologias::edit/$1', ['as' => 'updatePapelImpresionTipologia']);
    $routes->get('delete/(:num)', 'Papelimpresiontipologias::delete/$1', ['as' => 'deletePapelImpresionTipologia']);
});


$routes->group('papelesimpresionmargenes', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->post('datatable', 'Papelimpresionmargenes::datatable', ['as' => 'dataTableOfPapelImpresionMargen']);
    $routes->post('datatable_editor', 'Papelimpresionmargenes::datatable_editor', ['as' => 'editorOfPapelImpresionMargenes']);
    $routes->get('delete/(:num)', 'Papelimpresionmargenes::delete/$1', ['as' => 'deletePapelImpresionMargen']);
});
$routes->resource('papelesimpresionmargenes', ['namespace'  => 'App\Controllers\Configuracion', 'controller' => 'Papelimpresionmargenes', 'except' => 'show,new,create,update']);


$routes->group('tarifaacabadolineas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifaacabadolineas::index', ['as' => 'tarifaAcabadoLineaList']);
    $routes->get('add', 'Tarifaacabadolineas::add', ['as' => 'newTarifaAcabadoLinea']);
    $routes->post('add', 'Tarifaacabadolineas::add', ['as' => 'createTarifaAcabadoLinea']);
    $routes->post('create', 'Tarifaacabadolineas::create', ['as' => 'ajaxCreateTarifaAcabadoLinea']);
    $routes->put('(:num)/update', 'Tarifaacabadolineas::update/$1', ['as' => 'ajaxUpdateTarifaAcabadoLinea']);
    $routes->post('(:num)/edit', 'Tarifaacabadolineas::edit/$1', ['as' => 'updateTarifaAcabadoLinea']);
    $routes->post('datatable', 'Tarifaacabadolineas::datatable', ['as' => 'dataTableOfTarifaAcabadoLineas']);
    $routes->post('datatable_editor', 'Tarifaacabadolineas::datatable_editor', ['as' => 'editorOfTarifaAcabadoLineas']);
    $routes->post('allmenuitems', 'Tarifaacabadolineas::allItemsSelect', ['as' => 'select2ItemsOfTarifaAcabadoLineas']);
    $routes->post('menuitems', 'Tarifaacabadolineas::menuItems', ['as' => 'menuItemsOfTarifaAcabadoLineas']);
    $routes->get('delete/(:num)', 'Tarifaacabadolineas::delete/$1', ['as' => 'deleteTarifaAcabadoLinea']);
});
$routes->resource('tarifaacabadolineas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaacabadolineas', 'except' => 'show,new,create,update']);


$routes->group('maquinas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Maquinas::index', ['as' => 'maquinaList']);
    $routes->get('add', 'Maquinas::add', ['as' => 'newMaquina']);
    $routes->post('add', 'Maquinas::add', ['as' => 'createMaquina']);
    $routes->post('create', 'Maquinas::create', ['as' => 'ajaxCreateMaquina']);
    $routes->put('update/(:num)', 'Maquinas::update/$1', ['as' => 'ajaxUpdateMaquina']);
    $routes->post('edit/(:num)', 'Maquinas::edit/$1', ['as' => 'updateMaquina']);
    $routes->post('datatable', 'Maquinas::datatable', ['as' => 'dataTableOfMaquinas']);
    $routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
    $routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
});
$routes->resource('maquinas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinas', 'except' => 'show,new,create,update']);


$routes->group('maquinastarifasimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Maquinastarifasimpresion::index', ['as' => 'maquinasTarifaImpresionList']);
    $routes->get('add', 'Maquinastarifasimpresion::add', ['as' => 'newMaquinasTarifaImpresion']);
    $routes->post('add', 'Maquinastarifasimpresion::add', ['as' => 'createMaquinasTarifaImpresion']);
    $routes->post('create', 'Maquinastarifasimpresion::create', ['as' => 'ajaxCreateMaquinasTarifaImpresion']);
    $routes->put('(:num)/update', 'Maquinastarifasimpresion::update/$1', ['as' => 'ajaxUpdateMaquinasTarifaImpresion']);
    $routes->post('(:num)/edit', 'Maquinastarifasimpresion::edit/$1', ['as' => 'updateMaquinasTarifaImpresion']);
    $routes->post('datatable_editor', 'Maquinastarifasimpresion::datatable_editor', ['as' => 'editorOfMaquinasTarifaImpresion']);
    $routes->post('datatable', 'Maquinastarifasimpresion::datatable', ['as' => 'dataTableOfMaquinasTarifasImpresion']);
    $routes->post('allmenuitems', 'Maquinastarifasimpresion::allItemsSelect', ['as' => 'select2ItemsOfMaquinasTarifasImpresion']);
    $routes->post('menuitems', 'Maquinastarifasimpresion::menuItems', ['as' => 'menuItemsOfMaquinasTarifasImpresion']);
});
$routes->resource('maquinastarifasimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinastarifasimpresion', 'except' => 'show,new,create,update']);

$routes->group('maquinaspapelesimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->post('datatable', 'Maquinaspapelesimpresion::datatable', ['as' => 'dataTableOfMaquinasPapelesImpresion']);
    $routes->post('datatable_2', 'Maquinaspapelesimpresion::datatable_2', ['as' => 'dataTableOfPapelesImpresionMaquinas']);
    $routes->post('datatable_editor', 'Maquinaspapelesimpresion::datatable_editor', ['as' => 'editorOfMaquinasPapelImpresion']);
    $routes->post('datatable_editor_2', 'Maquinaspapelesimpresion::datatable_editor_2', ['as' => 'editorOfPapelImpresionMaquinas']);
    $routes->post('updateTableOnChange', 'Maquinaspapelesimpresion::updateTableOnChange', ['as' => 'updateMaquinaPapelOnTarifasChange']);
});
$routes->resource('maquinastarifasimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinastarifasimpresion', 'except' => 'show,new,create,update']);


$routes->group('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Maquinasdefecto::index', ['as' => 'maquinaPorDefectoList']);
    $routes->get('add', 'Maquinasdefecto::add', ['as' => 'newMaquinaPorDefecto']);
    $routes->post('add', 'Maquinasdefecto::add', ['as' => 'createMaquinaPorDefecto']);
    $routes->post('create', 'Maquinasdefecto::create', ['as' => 'ajaxCreateMaquinaPorDefecto']);
    $routes->put('(:num)/update', 'Maquinasdefecto::update/$1', ['as' => 'ajaxUpdateMaquinaPorDefecto']);
    $routes->post('edit/(:num)', 'Maquinasdefecto::edit/$1', ['as' => 'updateMaquinaPorDefecto']);
    $routes->post('datatable', 'Maquinasdefecto::datatable', ['as' => 'dataTableOfMaquinasPorDefecto']);
    $routes->post('allmenuitems', 'Maquinasdefecto::allItemsSelect', ['as' => 'select2ItemsOfMaquinasPorDefecto']);
    $routes->post('menuitems', 'Maquinasdefecto::menuItems', ['as' => 'menuItemsOfMaquinasPorDefecto']);
});
$routes->resource('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinasdefecto', 'except' => 'show,new,create,update']);


$routes->group('profile', ['namespace' => 'App\Controllers'], function ($routes) {
    $routes->get('', 'Profile::index', ['as' => 'profileList']);
    $routes->get('index', 'Profile::index', ['as' => 'profileIndex']);
    $routes->get('list', 'Profile::index', ['as' => 'profileList2']);
    //        $routes->get('add', 'Profile::add', ['as' => 'newProfile']);
    //        $routes->post('add', 'Profile::add', ['as' => 'createProfile']);
    //        $routes->get('edit/(:num)', 'Profile::edit/$1', ['as' => 'editTipologiaLibros']);
    //        $routes->post('edit/(:num)', 'Profile::edit/$1', ['as' => 'updateTipologiaLibros']);
    //        $routes->get('delete/(:num)', 'Profile::delete/$1', ['as' => 'deleteTipologiaLibros']);
    //        $routes->post('allmenuitems', 'Profile::allItemsSelect', ['as' => 'select2ItemsOfTipologiasLibros']);
    //        $routes->post('menuitems', 'Profile::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
});


$routes->group('comunidades-autonomas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Comunidadesautonomas::index', ['as' => 'comunidadAutonomaList']);
    $routes->get('add', 'Comunidadesautonomas::add', ['as' => 'newComunidadAutonoma']);
    $routes->post('add', 'Comunidadesautonomas::add', ['as' => 'createComunidadAutonoma']);
    $routes->post('create', 'Comunidadesautonomas::create', ['as' => 'ajaxCreateComunidadAutonoma']);
    $routes->put('(:num)/update', 'Comunidadesautonomas::update/$1', ['as' => 'ajaxUpdateComunidadAutonoma']);
    $routes->post('(:num)/edit', 'Comunidadesautonomas::edit/$1', ['as' => 'updateComunidadAutonoma']);
    $routes->post('datatable', 'Comunidadesautonomas::datatable', ['as' => 'dataTableOfComunidadesAutonomas']);
    $routes->post('allmenuitems', 'Comunidadesautonomas::allItemsSelect', ['as' => 'select2ItemsOfComunidadesAutonomas']);
    $routes->post('menuitems', 'Comunidadesautonomas::menuItems', ['as' => 'menuItemsOfComunidadesAutonomas']);
});
$routes->resource('comunidades-autonomas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Comunidadesautonomas', 'except' => 'show,new,create,update']);


$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Paises::index', ['as' => 'paisList']);
    $routes->get('add', 'Paises::add', ['as' => 'newPais']);
    $routes->post('add', 'Paises::add', ['as' => 'createPais']);
    $routes->post('create', 'Paises::create', ['as' => 'ajaxCreatePais']);
    $routes->put('(:num)/update', 'Paises::update/$1', ['as' => 'ajaxUpdatePais']);
    $routes->post('(:num)/edit', 'Paises::edit/$1', ['as' => 'updatePais']);
    $routes->post('datatable', 'Paises::datatable', ['as' => 'dataTableOfPaises']);
    $routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
    $routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
});
$routes->resource('paises', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Paises', 'except' => 'show,new,create,update']);


$routes->group('provincias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Provincias::index', ['as' => 'provinciaList']);
    $routes->get('add', 'Provincias::add', ['as' => 'newProvincia']);
    $routes->post('add', 'Provincias::add', ['as' => 'createProvincia']);
    $routes->post('create', 'Provincias::create', ['as' => 'ajaxCreateProvincia']);
    $routes->put('(:num)/update', 'Provincias::update/$1', ['as' => 'ajaxUpdateProvincia']);
    $routes->post('(:num)/edit', 'Provincias::edit/$1', ['as' => 'updateProvincia']);
    $routes->post('datatable', 'Provincias::datatable', ['as' => 'dataTableOfProvincias']);
    $routes->post('allmenuitems', 'Provincias::allItemsSelect', ['as' => 'select2ItemsOfProvincias']);
    $routes->post('menuitems', 'Provincias::menuItems', ['as' => 'menuItemsOfProvincias']);
});
$routes->resource('provincias', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Provincias', 'except' => 'show,new,create,update']);


$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
    $routes->get('', 'Cliente::index', ['as' => 'clienteList']);
    $routes->get('add', 'Cliente::add', ['as' => 'newCliente']);
    $routes->post('add', 'Cliente::add', ['as' => 'createCliente']);
    $routes->post('create', 'Cliente::create', ['as' => 'ajaxCreateCliente']);
    $routes->put('(:num)/update', 'Cliente::update/$1', ['as' => 'ajaxUpdateCliente']);
    $routes->post('(:num)/edit', 'Cliente::edit/$1', ['as' => 'updateCliente']);
    $routes->get('delete/(:num)', 'Cliente::delete/$1', ['as' => 'deleteCliente']);
    $routes->post('datatable', 'Cliente::datatable', ['as' => 'dataTableOfClientes']);
    $routes->post('allmenuitems', 'Cliente::allItemsSelect', ['as' => 'select2ItemsOfClientes']);
    $routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
});
$routes->resource('cliente', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Cliente', 'except' => 'show,new,create,update']);

$routes->group('formas-pagos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
    $routes->get('', 'Formaspagos::index', ['as' => 'formaDePagoList']);
    $routes->get('add', 'Formaspagos::add', ['as' => 'newFormaDePago']);
    $routes->post('add', 'Formaspagos::add', ['as' => 'createFormaDePago']);
    $routes->post('create', 'Formaspagos::create', ['as' => 'ajaxCreateFormaDePago']);
    $routes->put('(:num)/update', 'Formaspagos::update/$1', ['as' => 'ajaxUpdateFormaDePago']);
    $routes->post('(:num)/edit', 'Formaspagos::edit/$1', ['as' => 'updateFormaDePago']);
    $routes->post('datatable', 'Formaspagos::datatable', ['as' => 'dataTableOfFormasDePagos']);
    $routes->post('allmenuitems', 'Formaspagos::allItemsSelect', ['as' => 'select2ItemsOfFormasDePagos']);
    $routes->post('menuitems', 'Formaspagos::menuItems', ['as' => 'menuItemsOfFormasDePagos']);
});
$routes->resource('formas-pagos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Formaspagos', 'except' => 'show,new,create,update']);

$routes->group('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifasencuadernacion::index', ['as' => 'tarifaEncuadernacionList']);
    $routes->get('add', 'Tarifasencuadernacion::add', ['as' => 'newTarifaEncuadernacion']);
    $routes->post('add', 'Tarifasencuadernacion::add', ['as' => 'createTarifaEncuadernacion']);
    $routes->post('create', 'Tarifasencuadernacion::create', ['as' => 'ajaxCreateTarifaEncuadernacion']);
    $routes->put('(:num)/update', 'Tarifasencuadernacion::update/$1', ['as' => 'ajaxUpdateTarifaEncuadernacion']);
    $routes->post('edit/(:num)', 'Tarifasencuadernacion::edit/$1', ['as' => 'updateTarifaEncuadernacion']);
    $routes->get('delete/(:num)', 'Tarifasencuadernacion::delete/$1', ['as' => 'deleteTarifaEncuadernacion']);
    $routes->post('datatable', 'Tarifasencuadernacion::datatable', ['as' => 'dataTableOfTarifasEncuadernacion']);
    $routes->post('allmenuitems', 'Tarifasencuadernacion::allItemsSelect', ['as' => 'select2ItemsOfTarifasEncuadernacion']);
    $routes->post('menuitems', 'Tarifasencuadernacion::menuItems', ['as' => 'menuItemsOfTarifasEncuadernacion']);
});
$routes->resource('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasencuadernacion', 'except' => 'show,new,create,update']);


$routes->group('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifaencuadernacionlineas::index', ['as' => 'tarifaEncuadernacionLineaList']);
    $routes->get('add', 'Tarifaencuadernacionlineas::add', ['as' => 'newTarifaEncuadernacionLinea']);
    $routes->post('add', 'Tarifaencuadernacionlineas::add', ['as' => 'createTarifaEncuadernacionLinea']);
    $routes->post('create', 'Tarifaencuadernacionlineas::create', ['as' => 'ajaxCreateTarifaEncuadernacionLinea']);
    $routes->put('(:num)/update', 'Tarifaencuadernacionlineas::update/$1', ['as' => 'ajaxUpdateTarifaEncuadernacionLinea']);
    $routes->post('(:num)/edit', 'Tarifaencuadernacionlineas::edit/$1', ['as' => 'updateTarifaEncuadernacionLinea']);
    $routes->post('datatable', 'Tarifaencuadernacionlineas::datatable', ['as' => 'dataTableOfTarifaEncuadernacionLineas']);
    $routes->post('datatable_editor', 'Tarifaencuadernacionlineas::datatable_editor', ['as' => 'editorOfTarifaEncuadernacionLineas']);
    $routes->post('allmenuitems', 'Tarifaencuadernacionlineas::allItemsSelect', ['as' => 'select2ItemsOfTarifaEncuadernacionLineas']);
    $routes->post('menuitems', 'Tarifaencuadernacionlineas::menuItems', ['as' => 'menuItemsOfTarifaEncuadernacionLineas']);
});
$routes->resource('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaencuadernacionlineas', 'except' => 'show,new,create,update']);


$routes->group('tarifaencuadernaciontiradas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->post('datatable', 'Tarifaencuadernaciontiradas::datatable', ['as' => 'dataTableOfTarifaEncuadernacionTiradas']);
    $routes->post('datatable_editor', 'Tarifaencuadernaciontiradas::datatable_editor', ['as' => 'editorOfTarifaEncuadernacionTiradas']);
    $routes->post('menuitems', 'Tarifaencuadernaciontiradas::menuItems', ['as' => 'menuItemsOfTarifaencuadernaciontiradas']);
});
$routes->resource('tarifaencuadernaciontiradas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaencuadernaciontiradas', 'except' => 'show,new,create,update']);


$routes->group('tarifasenvios', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->get('', 'Tarifasenvios::index', ['as' => 'tarifaEnvioList']);
    $routes->get('add', 'Tarifasenvios::add', ['as' => 'newTarifaEnvio']);
    $routes->post('add', 'Tarifasenvios::add', ['as' => 'createTarifaEnvio']);
    $routes->post('create', 'Tarifasenvios::create', ['as' => 'ajaxCreateTarifaEnvio']);
    $routes->put('(:num)/update', 'Tarifasenvios::update/$1', ['as' => 'ajaxUpdateTarifaEnvio']);
    $routes->post('(:num)/edit', 'Tarifasenvios::edit/$1', ['as' => 'updateTarifaEnvio']);
    $routes->post('datatable', 'Tarifasenvios::datatable', ['as' => 'dataTableOfTarifaEnvio']);
    $routes->post('allmenuitems', 'Tarifasenvios::allItemsSelect', ['as' => 'select2ItemsOfTarifaEnvio']);
    $routes->post('menuitems', 'Tarifasenvios::menuItems', ['as' => 'menuItemsOfTarifaEnvio']);
});
$routes->resource('tarifasenvios', ['namespace'  => 'App\Controllers\Tarifas', 'controller' => 'Tarifasenvios', 'except' => 'show,new,create,update']);


$routes->group('tarifasenviosprecios', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->post('datatable', 'Tarifasenvioserecios::datatable', ['as' => 'dataTableOfTarifasEnvioPrecios']);
    $routes->post('datatable_editor', 'Tarifasenvioserecios::datatable_editor', ['as' => 'editorOfTarifasEnvioPrecios']);
});
$routes->resource('tarifasenviosprecios', ['namespace'  => 'App\Controllers\Tarifas', 'controller' => 'Tarifasenvioserecios', 'except' => 'show,new,create,update']);


$routes->group('tarifasenvioszonas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
    $routes->post('datatable', 'Tarifasenvioszonas::datatable', ['as' => 'dataTableOfTarifasEnvioZonas']);
    $routes->post('datatable_editor', 'Tarifasenvioszonas::datatable_editor', ['as' => 'editorOfTarifasEnvioZonas']);
});
$routes->resource('tarifasenvioszonas', ['namespace'  => 'App\Controllers\Tarifas', 'controller' => 'Tarifasenvioszonas', 'except' => 'show,new,create,update']);


$routes->group('proveedores', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
    $routes->get('', 'Proveedores::index', ['as' => 'proveedorList']);
    $routes->get('add', 'Proveedores::add', ['as' => 'newProveedor']);
    $routes->post('add', 'Proveedores::add', ['as' => 'createProveedor']);
    $routes->post('create', 'Proveedores::create', ['as' => 'ajaxCreateProveedor']);
    $routes->put('(:num)/update', 'Proveedores::update/$1', ['as' => 'ajaxUpdateProveedor']);
    $routes->post('edit/(:num)', 'Proveedores::edit/$1', ['as' => 'updateProveedor']);
    $routes->post('datatable', 'Proveedores::datatable', ['as' => 'dataTableOfProveedores']);
    $routes->post('allmenuitems', 'Proveedores::allItemsSelect', ['as' => 'select2ItemsOfProveedores']);
    $routes->post('menuitems', 'Proveedores::menuItems', ['as' => 'menuItemsOfProveedores']);
});
$routes->resource('proveedores', ['namespace' => 'App\Controllers\Compras', 'controller' => 'Proveedores', 'except' => 'show,new,create,update']);

$routes->group('proveedorestipos', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
    $routes->post('menuitems', 'ProveedoresTipos::menuItems', ['as' => 'menuItemsOfProveedoresTipos']);
});

$routes->resource('proveedorestipos', ['namespace' => 'App\Controllers\Compras', 'controller' => 'ProveedoresTipos', 'except' => 'show,new,create,update']);

$routes->group('clientecontactos', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
    $routes->get('', 'Clientecontactos::index', ['as' => 'ClienteContactosList']);
    $routes->get('add', 'Clientecontactos::add', ['as' => 'newClienteContactos']);
    $routes->post('add', 'Clientecontactos::add', ['as' => 'createClienteContactos']);
    $routes->post('create', 'Clientecontactos::create', ['as' => 'ajaxCreateClienteContactos']);
    $routes->put('(:num)/update', 'Clientecontactos::update/$1', ['as' => 'ajaxUpdateClienteContactos']);
    $routes->post('(:num)/edit', 'Clientecontactos::edit/$1', ['as' => 'updateClienteContactos']);
    $routes->post('datatable', 'Clientecontactos::datatable', ['as' => 'dataTableOfClienteContactos']);
    $routes->post('datatable_editor', 'Clientecontactos::datatable_editor', ['as' => 'editorOfClienteContactos']);
    $routes->post('allmenuitems', 'Clientecontactos::allItemsSelect', ['as' => 'select2ItemsOfClienteContactos']);
    $routes->post('menuitems', 'Clientecontactos::menuItems', ['as' => 'menuItemsOfClienteContactos']);
});
$routes->resource('ClienteContactos', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'ClienteContactos', 'except' => 'show,new,create,update']);

/*
 * --------------------------------------------------------------------
 * Additional Routing
 * --------------------------------------------------------------------
 *
 * There will often be times that you need additional routing and you
 * need it to be able to override any defaults in this file. Environment
 * based routes is one such time. require() additional route files here
 * to make that happen.
 *
 * You will have access to the $routes object within that file without
 * needing to reload it.
 */
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
    require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}
