<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|	example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|	http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
|	$route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
|	$route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
|	$route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples:	my-controller/index	-> my_controller/index
|		my-controller/my-method	-> my_controller/my_method
*/
$route['default_controller'] = 'home';
$route['404_override'] = 'home/_404';
$route['translate_uri_dashes'] = TRUE;

$route['^(\w{2})$'] = $route['default_controller'];
$prepended_lang = "(?:[a-zA-Z]{2}/)?"; 

$route[$prepended_lang.'sendMail'] = 'home/enviarCorreo';


$route['admin'] = 'admin/home';
$route['admin/login'] = 'admin/users/login';
$route['admin/login/dologin'] = 'admin/users/dologin';
$route['admin/logout'] = 'admin/users/logout';

$route['admin/home-slider'] = 'admin/homesliders/index';
$route['admin/home-slider/new'] = 'admin/homesliders/new_slide';
$route['admin/home-slider/save'] = 'admin/homesliders/save';
$route['admin/home-slider/activate/(:num)'] = 'admin/homesliders/activate/$1';
$route['admin/home-slider/deactivate/(:num)'] = 'admin/homesliders/deactivate/$1';
$route['admin/home-slider/edit/(:num)'] = 'admin/homesliders/edit/$1';
$route['admin/home-slider/update'] = 'admin/homesliders/update';
$route['admin/home-slider/delete/(:num)'] = 'admin/homesliders/delete/$1';
$route['admin/home-slider/erase'] = 'admin/homesliders/erase';

$route['admin/secondary-slider'] = 'admin/secondarysliders/index';
$route['admin/secondary-slider/new'] = 'admin/secondarysliders/new_slide';
$route['admin/secondary-slider/save'] = 'admin/secondarysliders/save';
$route['admin/secondary-slider/activate/(:num)'] = 'admin/secondarysliders/activate/$1';
$route['admin/secondary-slider/deactivate/(:num)'] = 'admin/secondarysliders/deactivate/$1';
$route['admin/secondary-slider/edit/(:num)'] = 'admin/secondarysliders/edit/$1';
$route['admin/secondary-slider/update'] = 'admin/secondarysliders/update';
$route['admin/secondary-slider/delete/(:num)'] = 'admin/secondarysliders/delete/$1';
$route['admin/secondary-slider/erase'] = 'admin/secondarysliders/erase';

$route['admin/contact-info'] = 'admin/contactinfo/edit';
$route['admin/contact-info/update'] = 'admin/contactinfo/update';

$route['admin/general-info'] = 'admin/generalinfo/edit';
$route['admin/general-info/update'] = 'admin/generalinfo/update';

$route['admin/benefits'] = 'admin/benefits/index';
$route['admin/benefits/edit/(:num)'] = 'admin/benefits/edit/$1';
$route['admin/benefits/update/(:num)'] = 'admin/benefits/update/$1';

$route['admin/services'] = 'admin/services/index';
$route['admin/services/edit/(:num)'] = 'admin/services/edit/$1';
$route['admin/services/update/(:num)'] = 'admin/services/update/$1';
$route['admin/services/activate/(:num)'] = 'admin/services/activate/$1';
$route['admin/services/deactivate/(:num)'] = 'admin/services/deactivate/$1';

$route['admin/users'] = 'admin/users/index';
$route['admin/users/new'] = 'admin/users/new_user';
$route['admin/users/save'] = 'admin/users/save';
$route['admin/users/activate/(:num)'] = 'admin/users/activate/$1';
$route['admin/users/deactivate/(:num)'] = 'admin/users/deactivate/$1';
$route['admin/users/edit/(:num)'] = 'admin/users/edit/$1';
$route['admin/users/update/(:num)'] = 'admin/users/update/$1';

$route['admin/profile'] = 'admin/users/profile/';
$route['admin/users/updateprofile'] = 'admin/users/updateprofile/';
$route['admin/changepassword'] = 'admin/users/changepassword/';
$route['admin/updatepassword'] = 'admin/users/updatepassword/';

//$route['admin/(:any)'] = 'admin/$1';
