<?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'] = "Login";
$route ['scaffolding_trigger'] = "";

$route['api/addToCart'] = 'carts/shopping_cart/addToCartAPI';
$route['api/removeFromCart'] = 'carts/shopping_cart/removeFromCartAPI';
$route['myCart/(:num)/(:any)'] = "carts/shopping_cart/showMyCheckout/0/$1/$2";
$route['myCheckout/(:num)/(:any)'] = "carts/shopping_cart/showMyCheckout/1/$1/$2";

$route['reports'] = "reports/reports";

$route['carts/gift_certificate/gift_card/([a-fA-F\d]{32})'] = "gift_certificate/show_card_send_form/$1";
$route['carts/gift_certificate/gift_card_categorywise/(:any)'] = "gift_certificate/show_card_send_form_categorywise/$1/$2";
$route['carts/gift_certificate/save_gift_card'] = 'gift_certificate/save_temp_recipient';
$route['support'] = 'welcome/support';

//your custom routes here
$route['affiliate/confirmation'] = "affiliatePanel/affiliate_signup/confirmation";
$route['affLogin/(:num)'] = "affiliatePanel/affiliate_login/showLogin/$1";
$route['affSignUp/(:num)'] = "affiliatePanel/affiliate_signup/showSignUpForm/$1";
$route['aff/([a-fA-F\d]{32})'] = "affiliateAdmin/affiliate_media/affiliateStandardLink/$1";
$route['shipLogin/(:any)'] = "process_shipping/third_party_shipping_login/showLogin/$1";
//$route['affProgram/(/^[a-zA-Z0-9_.\&@!*]+$/)/(:num)'] = "affiliateAdmin/affiliate_media/programSpecificAffiliateLink/$1/$2";  

$route['affProgram/(:any)/(:num)'] = "affiliateAdmin/affiliate_media/programSpecificAffiliateLink/$1/$2";
//@ Anjuman | D: 05172012  -- track affiliate from url  
$route['affProgram/(:any)/(:num)/(:any)'] = "affiliateAdmin/affiliate_media/programSpecificAffiliateLink/$1/$2/$3";

//for copt-in forms
$route['contactForm/([a-fA-F\d]{32})'] = "affiliateAdmin/opt_in/contactForm/$1";
$route['joinMailingList/([a-fA-F\d]{32})'] = "affiliateAdmin/opt_in/joinMailingList/$1";

$route['saveContacts'] = "affiliateAdmin/opt_in/saveContacts";
$route['saveMailingList'] = "affiliateAdmin/opt_in/saveMailingList";

$route['join/thankYou/(:num)/([a-fA-F\d]{32})'] = "affiliateAdmin/opt_in/thankYou/$1/$2";

$route['conatct/confirmation/([a-fA-F\d]{32})'] = "affiliateAdmin/opt_in/confirmContactSubmit/$1";
$route['mailingList/confirmation/([a-fA-F\d]{32})'] = "affiliateAdmin/opt_in/confirmContactSubmit/$1";
//added by Tania Noor
$route['adminAffSignUp/(:num)'] = "administration/admin_affiliate_signup/showSignUpForm/$1";
$route['adminAffSignUp/(:num)/(:num)'] = "administration/admin_affiliate_signup/showSignUpForm/$1/$2";
$route['adminAffLogin/(:num)'] = "administration/admin_affiliate_signup/showLoginForm/$1/1";
$route['adminAffLogin/(:num)/(:num)'] = "administration/admin_affiliate_signup/showLoginForm/$1/$2";
$route['adminAffProgram/(:any)/(:num)'] = "administration/admin_affiliate_program_setup/adminAffProgramSpecificLink/$1/$2";
$route['adminAffiliate/confirmation'] = "administration/admin_affiliate_signup/confirmation";

$route['advanceIntegration/(:num)'] = "jscript_generator/showThankYouScript/$1";
//rapyd language routes
include_once ("rapyd.php");
$language_pregex = "(" . implode ( "|", $rpd ["languages"] ) . ")";

$route [$language_pregex] = $route ['default_controller'];
$route [$language_pregex . '/(.+)'] = "$2";

unset ( $rpd );
unset ( $language_pregex );

$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
