<?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:
|
|	https://codeigniter.com/userguide3/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'] = 'auth/login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

// Auth Routes
$route['login'] = 'auth/login';
$route['logout'] = 'auth/logout';
$route['register'] = 'auth/register';

// Admin Routes
$route['admin'] = 'admin/dashboard';
$route['admin/dashboard'] = 'admin/dashboard';
$route['admin/users'] = 'admin/users';
$route['admin/campaigns'] = 'admin/campaigns';
$route['admin/message-schedules'] = 'admin/message_schedules';
$route['admin/message-batch-status/(:num)'] = 'admin/message_batch_update_status/$1';
$route['admin/delete-schedule/(:num)'] = 'admin/delete_schedule/$1';
$route['admin/master-data'] = 'admin/master_data';
$route['admin/master-data-ajax'] = 'admin/master_data_ajax';
$route['admin/master-data-upload-large'] = 'admin/master_data_upload_large';
$route['admin/master_data_count'] = 'admin/master_data_count';
$route['admin/master_data_export_batch'] = 'admin/master_data_export_batch';
$route['admin/reports'] = 'admin/reports';

// User Routes
$route['user'] = 'user/dashboard';
$route['user/dashboard'] = 'user/dashboard';
$route['user/campaigns'] = 'user/campaigns';
$route['user/campaign-view/(:num)'] = 'user/campaign_view/$1';
$route['user/campaign_sends/(:num)/(:num)'] = 'user/campaign_sends/$1/$2';
$route['user/get_batch_sends_data/(:num)/(:num)'] = 'user/get_batch_sends_data/$1/$2';
$route['user/send-logs'] = 'user/send_logs';
$route['user/send-logs/(:num)'] = 'user/send_logs/$1';
$route['user/reports'] = 'user/reports';
$route['user/send_message'] = 'user/send_message';
$route['user/send_all_messages'] = 'user/send_all_messages';
$route['user/get_next_data'] = 'user/get_next_data';
$route['user/get_batch_sends'] = 'user/get_batch_sends';
$route['user/profile'] = 'user/profile';
$route['user/update-profile'] = 'user/update_profile';

// Super Admin Routes
$route['superadmin'] = 'superadmin/dashboard';
$route['superadmin/dashboard'] = 'superadmin/dashboard';
$route['superadmin/auth'] = 'superadmin/auth';
$route['superadmin/auth/login'] = 'superadmin/auth/login';
$route['superadmin/auth/do_login'] = 'superadmin/auth/do_login';
$route['superadmin/auth/logout'] = 'superadmin/auth/logout';
$route['superadmin/portals'] = 'superadmin/portals';
$route['superadmin/portals/create'] = 'superadmin/portals/create';
$route['superadmin/portals/store'] = 'superadmin/portals/store';
$route['superadmin/portals/edit/(:num)'] = 'superadmin/portals/edit/$1';
$route['superadmin/portals/update/(:num)'] = 'superadmin/portals/update/$1';
$route['superadmin/portals/view/(:num)'] = 'superadmin/portals/view/$1';
$route['superadmin/portals/delete/(:num)'] = 'superadmin/portals/delete/$1';
$route['superadmin/portals/toggle_status/(:num)/(:any)'] = 'superadmin/portals/toggle_status/$1/$2';
$route['superadmin/users'] = 'superadmin/users';
$route['superadmin/campaigns'] = 'superadmin/campaigns';
$route['superadmin/reports'] = 'superadmin/reports';
$route['superadmin/settings'] = 'superadmin/settings';
$route['superadmin/settings/password'] = 'superadmin/settings/password';
$route['superadmin/settings/update_profile'] = 'superadmin/settings/update_profile';
$route['superadmin/settings/update_password'] = 'superadmin/settings/update_password';
$route['superadmin/settings/add_admin'] = 'superadmin/settings/add_admin';
$route['superadmin/settings/delete_admin/(:num)'] = 'superadmin/settings/delete_admin/$1';
