SITEFIRSTLANG) { header('Location: /'.$_COOKIE[CN_SITELANG].'/'); exit; }; }; }; require_once('_classes/constants.php'); $constants = new Constants; require_once('_classes/mailsender.php'); $mailsender = new MailSender; require_once('_classes/page.php'); $page = new Page; // Check language require_once('_languages/languages.php'); require_once('_classes/lang-site.php'); $lang = new Lang; $lang->firstlang = SITEFIRSTLANG; $lang->alllangs = $languages_site; $lang->cookiename = CN_SITELANG; $lang->cookietime = time() + 31622400; $lang->CheckLang(); $chooselang = $lang->thislang; require_once('_classes/rubrication.php'); $rubrication = new Rubrication; require_once('_classes/categories.php'); $categories = new Categories; // Statistic of visit pages - info data require_once('_classes/visitpages.php'); $vpages = new VisitPages; $vpages->lang = $chooselang; if (M_CART) { // Cart require_once('_classes/productscart.php'); $productscart = new ProductsCart; }; if (M_FAVORITES) { // Favorites require_once('_classes/favorites.php'); $favorites = new Favorites; }; if (M_FEEDBACK) { // Feedback require_once('_classes/feedback.php'); $feedback = new Feedback; }; // Reviews require_once('_classes/reviews.php'); $reviews = new Reviews; // Callback require_once('_classes/callback.php'); $callback = new Callback; // HotelRezervation require_once('_classes/hotelrooms.php'); $hotelrooms = new HotelRooms; require_once('_classes/hotelrezervation.php'); $hotelrezervation = new HotelRezervation; // Appointments require_once('_classes/appointments.php'); $appointments = new Appointments; // Doctor Questions require_once('_classes/doctorquestions.php'); $doctorquestions = new DoctorQuestions; // Site Rating require_once('_classes/siterating.php'); $siterating = new SiteRating; if (M_GUESTBOOK) { // Guestbook require_once('_classes/guestbook.php'); $guestbook = new Guestbook; }; if (M_PRODUCTCOMMENTS) { // Product Comments require_once('_classes/comments.php'); $comments = new Comments; }; if (M_VOTES) { // Votes require_once('_classes/votes.php'); $votes = new Votes; $votes->thislang = $chooselang; }; if (M_BANNERS) { require_once('_classes/banners.php'); $banners = new Banners; $banners->thislang = $chooselang; require_once('_modules/banners/site/core/banners.php'); }; // Check authorization require_once('_classes/auth.php'); $authuser = new AuthCustomers; $authuser->base = BASE_C; $authuser->basesession = BASE_CS; $authuser->request_url = REQUESTURI; $authuser->cookiename = CN_SITECUSTOMER; $authuser->cookietime = time() + 86400; $authuser->CheckAuth(); // Anonym authorization require_once('_classes/anonymauth.php'); $authanonym = new AuthAnonym; $authanonym->cookiename = CN_SITEANONYM; $authanonym->cookietime = time() + 86400; // Customers require_once('_classes/customers.php'); $customers = new Customers; if ($authuser->checkauth){ if ($authanonym->CheckAuth()) { $vpages->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); if (M_FAVORITES) {$favorites->FavoritesAnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; if (M_CART) {$productscart->CartAnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; $reviews->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); $callback->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); $hotelrezervation->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); $appointments->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); $doctorquestions->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); $siterating->AnonymToCustomer($authanonym->anonymid,$authuser->customerid); if (M_FEEDBACK) {$feedback->AnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; if (M_GUESTBOOK) {$guestbook->AnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; if (M_PRODUCTCOMMENTS) {$comments->AnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; if (M_VOTES) {$votes->AnonymToCustomer($authanonym->anonymid,$authuser->customerid);}; $authanonym->DeleteAuth(); }; $authinfo['authtype'] = 1; $authinfo['customerid'] = $authuser->customerid; $authinfo['ip'] = $authuser->ip; } else { if ($authanonym->CheckAuth()) {$authanonym->UpdateAuth();} else {$authanonym->AddAuth();}; $authinfo['authtype'] = 0; $authinfo['customerid'] = $authanonym->anonymid; $authinfo['ip'] = $authanonym->ip; }; // Page define $page->uri = $lang->remainuri; $page->lang = $chooselang; $page->customerid = $authinfo['customerid']; $page->GetPage(); $lang->ChooseLang($page->pagetype); if (SITEMODE == 'eye') {define('ROOT', '/eye'.$lang->root);} else {define('ROOT', $lang->root);}; $chooselang = $lang->thislang; require_once('_languages/lang-site.php'); if ($page->pagetype != "mainpage") { require_once('core/menu.php'); }; require_once('core/allpages.php'); require_once('core/menu_top.php'); require_once('core/menu_top_full.php'); require_once('core/menu_top_eye.php'); require_once('core/menu_bottom.php'); require_once('core/menu_bottom_eye.php'); require_once('core/siterating.php'); require_once('core/runlines.php'); require_once('core/forms.php'); // Check Cart if (M_CART) {$productscart->DeleteOldProductsInCart();} if (M_FAVORITES) {/*$favorites->DeleteOldProductsInFavorites();*/} if (M_CART) {$allproductsincart = $productscart->CheckAllProductsInCartNow($authinfo['authtype'],$authinfo['customerid']);}; // SITE RATING if (!isset($_COOKIE[CN_RATING])){ define('RATING', true); if (!isset($_COOKIE[CN_RATING_SHOW])){ define('RATING_SHOW', true); setcookie(CN_RATING_SHOW, time(), time()+TIME_RATING_SHOW, "/"); define('RATING_SHOW_START',TIME_RATING_SHOW_START); } else { define('RATING_SHOW_START',TIME_RATING_SHOW_START - (time() - $_COOKIE[CN_RATING_SHOW])); if (RATING_SHOW_START > 0) { define('RATING_SHOW', true); } else { define('RATING_SHOW', false); }; }; } else { define('RATING', false); setcookie(CN_RATING, "shown", time()+TIME_RATING, "/"); define('RATING_SHOW', false); define('RATING_SHOW_START', 0); }; // BANEXTERNALSITE if (isset($_SERVER['HTTP_REFERER'])) { if (substr_count($_SERVER['HTTP_REFERER'],'krasotaimedicina.ru') > 0) { define('BANEXTERNALSITE', true); } else {define('BANEXTERNALSITE', false);}; } else {define('BANEXTERNALSITE', false);}; $showpage404 = false; $getauthdirectory = false; switch($page->pagetype) { case "mainpage": { include("_modules/mainpage/site/core/index.php"); }; break; case "indexpage": { include("_modules/indexpage/site/core/index.php"); }; break; case "coupon": { include("_modules/coupon/site/core/index.php"); }; break; case "page": case "department": case "hotel": { include("core/price_and_doctors.php"); if (empty($page->doctorid)) { include("_modules/contentpages/site/core/index.php"); } else { include("_modules/contentpages/site/core/doctor.php"); }; }; break; case "photoalbum": { include("_modules/photoalbum/site/core/index.php"); }; break; case "reviews": { include('_modules/reviews/site/core/index.php'); }; break; case "callback": { include("_modules/callback/site/core/index.php"); }; break; case "hotelrezervation": { include("_modules/hotelrezervation/site/core/index.php"); }; break; case "appointments": { include("_modules/appointments/site/core/index.php"); }; break; case "doctorquestions": { include('_modules/doctorquestions/site/core/index.php'); }; break; case "siterating": { include("_modules/siterating/site/core/index.php"); }; break; case "feedback": { if (M_FEEDBACK) {include("_modules/feedback/site/core/index.php");} else {$showpage404 = true;}; }; break; case "guestbook": { if (M_GUESTBOOK) {include('_modules/guestbook/site/core/index.php');} else {$showpage404 = true;}; }; break; case "sitemap": { include("_modules/sitemap/site/core/index.php"); }; break; case "productdir": { if (M_CART or M_FAVORITES) {require_once('core/products_cart_and_favorites.php');}; if (M_CATEGORES) { if (empty($page->productid)) { include("_modules/products/site/core/index.php"); } else { require_once('core/tellafriend.php'); include("_modules/products/site/core/oneproduct.php"); }; } else {$showpage404 = true;}; }; break; case "bybrands": { if (M_CART or M_FAVORITES) {require_once('core/products_cart_and_favorites.php');}; if (M_BRANDS) { if (empty($page->brandid)) { include("_modules/brands/site/core/index.php"); } else { include("_modules/products/site/core/bybrands.php"); }; } else {$showpage404 = true;}; }; break; case "subscribe": { if (M_SUBSCRIBE) {include("_modules/subscribe/site/core/subscribe_step_1.php");} else {$showpage404 = true;}; }; break; case "subscribe_step_2": { if (M_SUBSCRIBE) {include("_modules/subscribe/site/core/subscribe_step_2.php");} else {$showpage404 = true;}; }; break; case "editsubscribe": { if (M_SUBSCRIBE) {include("_modules/subscribe/site/core/editsubscribe.php");} else {$showpage404 = true;}; }; break; case "unsubscribe": { if (M_SUBSCRIBE) {include("_modules/subscribe/site/core/unsubscribe.php");} else {$showpage404 = true;}; }; break; case "articles": case "smi": { if (empty($page->articleid)) { include("_modules/articles/site/core/index.php"); } else { include("_modules/articles/site/core/onearticle.php"); }; }; break; case "promo": { if (empty($page->promoid)) { include("_modules/promo/site/core/index.php"); } else { include("_modules/promo/site/core/onepromo.php"); }; }; break; case "persons": { include("_modules/persons/site/core/index.php"); }; break; case "doctors": { include("_modules/doctors/site/core/index.php"); }; break; case "prices": { if (empty($page->priceid)) { include("_modules/contentpages/site/core/index.php"); } else { include("_modules/contentpages/site/core/oneprice.php"); }; }; break; case "videos": { include("_modules/videos/site/core/index.php"); }; break; case "pagephotogallery": { if (M_PHOTOGALLERIES) {include_once('_modules/pagephotogallery/site/core/index.php');} else {$showpage404 = true;}; }; break; case "documents": { if (M_DOCUMENTS) {include('_modules/documents/site/core/index.php');} else {$showpage404 = true;}; }; break; case "votes": { if (M_VOTES) {include('_modules/votes/site/core/index.php');} else {$showpage404 = true;}; }; break; case "registration": { if (!$authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/registration_step_1.php");} else {$showpage404 = true;}; } else { header('Location: '.ROOT.'/'); exit; }; }; break; case "registration_step_2": { if (!$authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/registration_step_2.php");} else {$showpage404 = true;}; } else { header('Location: '.ROOT.'/'); exit; }; }; break; case "accountchanges": { if ($authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/accountchanges.php");} else {$showpage404 = true;}; } else { $getauthdirectory = true; if (M_CUSTOMERS) {include("_modules/mainpage/site/core/index.php");} else {$showpage404 = true;}; }; }; break; case "changeemail": { if (M_CUSTOMERS) {include("_modules/customers/site/core/changeemail.php");} else {$showpage404 = true;}; }; break; case "passwordchanges": { if ($authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/passwordchanges.php");} else {$showpage404 = true;}; } else { $getauthdirectory = true; if (M_CUSTOMERS) {include("_modules/mainpage/site/core/index.php");} else {$showpage404 = true;}; }; }; break; case "addresseschanges": { if ($authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customeraddresses/site/core/index.php");} else {$showpage404 = true;}; } else { $getauthdirectory = true; if (M_CUSTOMERS) {include("_modules/mainpage/site/core/index.php");} else {$showpage404 = true;}; }; }; break; case "forgetpassword": { if (!$authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/forgetpassword.php");} else {$showpage404 = true;}; } else { header('Location: '.ROOT.'/'); exit; }; }; break; case "forgetpassword_step_2": { if (!$authuser->checkauth){ if (M_CUSTOMERS) {include("_modules/customers/site/core/forgetpassword_step_2.php");} else {$showpage404 = true;}; } else { header('Location: '.ROOT.'/'); exit; }; }; break; case "cart": { if (M_CART or M_FAVORITES) {require_once('core/products_cart_and_favorites.php');}; if (M_CART) {include("_modules/cart/site/core/index.php");} else {$showpage404 = true;}; }; break; case "favorites": { if (M_CART or M_FAVORITES) {require_once('core/products_cart_and_favorites.php');}; if (M_FAVORITES) {include("_modules/favorites/site/core/index.php");} else {$showpage404 = true;}; }; break; case "allorders": { if ($authuser->checkauth){ if (M_CART) { if (empty($page->orderid)) { include("_modules/orders/site/core/index.php"); } else { include("_modules/orders/site/core/oneorder.php"); }; } else {$showpage404 = true;}; } else { $getauthdirectory = true; if (M_CUSTOMERS) {include("_modules/mainpage/site/core/index.php");} else {$showpage404 = true;}; }; }; break; case "oneorder": { if ($authuser->checkauth){ if (M_CART) {include("_modules/orders/site/core/oneorder.php");} else {$showpage404 = true;}; } else { $getauthdirectory = true; if (M_CUSTOMERS) {include("_modules/mainpage/site/core/index.php");} else {$showpage404 = true;}; }; }; break; case "search": { if (M_SEARCH) {include("_modules/search/site/core/index.php");} else {$showpage404 = true;}; }; break; case "comments": { if (M_PRODUCTCOMMENTS) {include("_modules/productcomments/site/core/index.php");} else {$showpage404 = true;}; }; break; case "calendar": { if (M_CALENDAR) {include('_modules/calendar/site/core/index.php');} else {$showpage404 = true;}; }; break; case "404": { $showpage404 = true; }; break; }; if ($showpage404) { $page->pagetitle = $langdata['site_404_title']; $page->pagedescription = $langdata['site_404_description']; $page->pagekeywords = $langdata['site_404_keywords']; $page->pagehead = $langdata['site_404_head']; $page->pagetext = $langdata['site_404_text']; include("_modules/404/site/core/index.php"); }; ?>