'product', 'category' => 'category', 'brand' => 'brand', 'shopping-basket' => 'cart', 'everything' => 'everything_template', 'index' => 'index', 'cms' => 'content_management', 'site-information' => 'site_information', 'employee-login' => 'content_management', 'login' => 'login', 'registration' => 'customer_registration', 'shipping-address' => 'shipping_address_check', 'payment-information' => 'payment_information', 'payment-information-member' => 'payment_information_member', 'shipping-method' => 'shipping_method', 'payment-method' => 'payment_method', 'confirmation' => 'confirmation', 'confirmation-ajax' => 'ajax_order_record', 'order-complete' => 'order_complete', 'store-login' => 'store_login', 'thank-you' => 'email_list_thankyou', 'information' => 'information', 'join-mailing-list' => 'join_email_list', 'credit-card-fix' => 'credit_card_fix', 'member-favorites' => 'member_favorite', 'member-login' => 'member_login', 'member-registration' => 'member_registration', 'jobs' => 'jobs', 'system-maintenance' => 'checkout_down', 'suggestions-comments' => 'suggestions', 'customer-service' => 'customer_service', 'comments' => 'comment', 'rss' => 'rss', 'floor-two-dashboard' => 'floor_two_dashboard', 'floor-two-cart' => 'floor_two_cart', 'floor-two-checkout' => 'floor_two_checkout', 'hickorees-floor-two' => 'hickorees_floor_two', 'basic-test' => 'basic_test', 'sandbox' => 'basic_test', 'api-test' => 'api_test', 'transaction-sync' => 'transaction_sync', 'unsubscribe' => 'unsubscribe', 'openerp' => 'openerp', 'password-recovery' => 'password_recovery', 'journal' => 'journal', 'admin' => 'admin' ); if(empty($uri_array)){ $uri_array[1] = 'index'; } foreach($route_array as $key => $value) { if(in_array($key,$uri_array)) { $route_name = $key; $route = $value; $found = array_search($key, $uri_array); if(isset($uri_array[$found + 1])) { define('URL_ID', $uri_array[$found + 1]); } else { define('URL_ID', 0); } break; } } if(!isset($route)) { foreach($uri_array as $value) { if(array_key_exists($value,$route_array)) { header('location: ' . BASE_URL . URI); exit; } } $route_name = $uri_array[1]; $route = $uri_array[1]; } switch($uri_array[MAX(array_keys($uri_array))]) { case 'product': header('location: ' . BASE_URL . rtrim(URI, '/product')); exit; break; case 'brand': header('location: ' . BASE_URL . rtrim(URI, '/brand')); exit; break; default: break; } define('ROUTE', $route); define('ROUTE_NAME', $route_name); $x = ROUTE_NAME; switch(ROUTE_NAME) { case 'index': case 'product': case 'category': case 'brand': case 'join-mailing-list': case 'site-information': case 'suggestions-comments': case 'jobs': case 'customer-service': case 'shopping-basket': case 'hickorees-floor-two': case 'basic-test': case 'unsubscribe': case 'journal': $group = 'main_shop'; break; case 'login': case 'payment-information': case 'payment-information-member': case 'confirmation': case 'order-complete': case 'password-reminder': case 'password-recovery': $group = 'checkout'; break; case 'rss': case 'transaction-sync': case 'openerp': $group = 'no_template'; break; case 'cms': case 'employee-login': $group = 'cms'; break; case 'floor-two-dashboard': case 'floor-two-cart': case 'floor-two-checkout': $group = 'floor_two'; break; case 'admin': $group = 'cms2'; break; default: $group = ''; } define('GROUP', $group); if(GROUP == 'checkout') { if(isset($_SESSION['checkout_array']['url_path'])) { if($_SESSION['checkout_array']['url_path'][max(array_keys($_SESSION['checkout_array']['url_path']))] != CURRENT_URL) { $_SESSION['checkout_array']['url_path'][] = CURRENT_URL; } } else { $_SESSION['checkout_array']['url_path'][] = CURRENT_URL; } } elseif(GROUP == 'cms') { exit; } if(GROUP != 'main_shop' && !isset($_COOKIE['cart_id'])) { header('LOCATION: ' . BASE_URL); exit; } // elapsed("pre_controller"); if(file_exists(DOC_ROOT . '/controller/group/' . GROUP . '_controller.php')) { include(DOC_ROOT . '/controller/controller.php'); } // elapsed("pre_template"); if(GROUP != '' && GROUP != 'no_template' && GROUP != 'cms2') { if(file_exists(DOC_ROOT . '/template/template_head.php')) { include(DOC_ROOT . '/template/template_head.php'); } if(file_exists(DOC_ROOT . '/template/template_top.php')) { include(DOC_ROOT . '/template/template_top.php'); } if(file_exists(DOC_ROOT . '/template/template_nav.php')) { include(DOC_ROOT . '/template/template_nav.php'); } if(file_exists(DOC_ROOT . '/template/template_validator.php')) { include(DOC_ROOT . '/template/template_validator.php'); } if(file_exists(DOC_ROOT . '/template/template_breadcrumb.php')) { include(DOC_ROOT . '/template/template_breadcrumb.php'); } } elseif(GROUP != 'no_template') { if(file_exists(DOC_ROOT . '/template/template_head.php')) { include(DOC_ROOT . '/template/template_head.php'); } } //elapsed("pre_view"); //ANALYTICS SCRIPT $extension = explode('.', ROUTE); if(file_exists(DOC_ROOT . '/view/' . ROUTE . '_view.php')) { include(DOC_ROOT . '/view/' . ROUTE . '_view.php'); } elseif(!isset($extension[1])) { if(file_exists(DOC_ROOT . '/' . ROUTE . '.php')) { include(DOC_ROOT . '/' . ROUTE . '.php'); } elseif(file_exists(DOC_ROOT . '/ajax_files/' . ROUTE . '.php')) { include(DOC_ROOT . '/ajax_files/' . ROUTE . '.php'); } elseif(file_exists(DOC_ROOT . '/garbage/' . ROUTE . '.php')) { include(DOC_ROOT . '/garbage/' . ROUTE . '.php'); } else { include(DOC_ROOT . '/404.html'); } } //elapsed("post_view"); if(GROUP != '') { if(file_exists(DOC_ROOT . '/template/template_bottom.php')) { include(DOC_ROOT . '/template/template_bottom.php'); } } if(ROUTE_NAME == 'order-complete') { unset($_SESSION['checkout_array']); } }