Пример #1
0
 function printMainBlock()
 {
     if (!isset($this->request['action'])) {
         $this->request['action'] = "";
     }
     $action = explode(".", $this->request['action']);
     $obCms = new c_cmsContent();
     $obCms->obDb = $this->obDb;
     $obCms->request = $this->request;
     $obCmsDb = new c_cmsContentDb();
     $obCmsDb->obDb = $this->obDb;
     $obCmsDb->request = $this->request;
     $obSiteMap = new c_siteMap();
     $obSiteMap->obDb = $this->obDb;
     $obSiteMap->request = $this->request;
     $rssInterface = new feed_interface();
     $rssInterface->obDb = $this->obDb;
     $rssInterface->obDb = $this->obDb;
     $this->libFunc = new c_libFunctions();
     $comFunc = new c_commonFunctions();
     $comFunc->request = $this->request;
     switch ($action[0]) {
         case "error":
             $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » Error");
             $comFunc->cmsTemplate = $this->templatePath . "error.tpl.htm";
             $this->obTpl->set_var("TPL_VAR_BODY", $comFunc->m_dspError());
             break;
         case "cms":
             $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » " . $this->request['mode']);
             $obCms->cmsTemplate = $this->templatePath . "cmsContent.tpl.htm";
             $this->obTpl->set_var("TPL_VAR_BODY", $obCms->m_showCmsContent());
             break;
         case "sitemap":
             $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » Sitemap");
             $obSiteMap->siteMapTemplate = $this->templatePath . "siteMap.tpl.htm";
             $this->obTpl->set_var("TPL_VAR_BODY", $obSiteMap->m_showSitemap());
             break;
         case "download":
             $retUrl = $this->libFunc->m_safeUrl(SITE_URL . "index.php?action=download&mode=" . $this->request['mode']);
             $_SESSION['referer'] = $retUrl;
             $this->libFunc->authenticate();
             unset($_SESSION['referer']);
             $this->obDb->query = "SELECT `iOrderid_PK` FROM " . ORDERS . " WHERE `iCustomerid_FK` = '" . $_SESSION['userid'] . "' AND `iOrderStatus` = '1'";
             foreach ($this->obDb->fetchQuery() as $result) {
                 $this->obDb->query = "SELECT COUNT(`iOrderid_FK`) FROM " . ORDERPRODUCTS . " WHERE `iOrderid_FK` = '" . $result->iOrderid_PK . "' AND `iProductid_FK` = '" . $this->request['mode'] . "'";
                 $record = $this->obDb->fetchQuery();
                 if ($record[0]->{'COUNT(`iOrderid_FK`)'} > 0) {
                     $this->obDb->query = "SELECT `vDownloadablefile` FROM " . PRODUCTS . " WHERE `iProdid_PK` = '" . $this->request['mode'] . "'";
                     $fileresult = $this->obDb->fetchQuery();
                     $obCmsDb->libFunc = $this->libFunc;
                     $obCmsDb->file = $fileresult[0]->vDownloadablefile;
                     $obCmsDb->m_downloadFile();
                     $this->libFunc->m_mosRedirect(SITE_URL);
                 } else {
                     $this->libFunc->m_mosRedirect(SITE_URL);
                 }
             }
             break;
         case "productRss":
             $this->libFunc->m_mosRedirect(SITE_URL . "RSS/productRss.xml");
             exit;
             break;
         case "articleRss":
             $this->libFunc->m_mosRedirect(SITE_URL . "RSS/articleRss.xml");
             exit;
             break;
         case "contactus":
             if (!isset($action[1])) {
                 $action[1] = "";
             }
             switch ($action[1]) {
                 case "thanks":
                     $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » Thanks");
                     $obCms->cmsTemplate = $this->templatePath . "contactsubmit.tpl.htm";
                     $this->obTpl->set_var("TPL_VAR_BODY", $obCms->m_showThanks());
                     break;
                 case "add":
                     if ($obCms->m_validateContact()) {
                         $obCms->cmsTemplate = $this->templatePath . "contact.tpl.htm";
                         $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » Contact us");
                         $this->obTpl->set_var("TPL_VAR_BODY", $obCms->m_showContactForm());
                     } else {
                         $obCmsDb->m_addContact();
                     }
                     break;
                 default:
                     $obCms->cmsTemplate = $this->templatePath . "contact.tpl.htm";
                     $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", " » Contact us");
                     $this->obTpl->set_var("TPL_VAR_BODY", $obCms->m_showContactForm());
                     break;
             }
             break;
         default:
             if (isset($this->request['sid']) && !empty($this->request['sid'])) {
                 $value = $this->request['sid'];
                 setcookie("sourceid", $value, time() + 3600, "/");
             }
             $obCms->cmsTemplate = $this->templatePath . "home.tpl.htm";
             $this->obTpl->set_var("TPL_VAR_BREDCRUMBS", "");
             $this->obTpl->set_var("SiteUrl", SITE_URL);
             $this->obTpl->set_var('TPL_VAR_BODY', $obCms->m_showHomePage());
             break;
     }
 }
Пример #2
0
        $comFunc->obDb = $obDatabase;
        $comFunc->request['mode'] = 'product';
        $obMainTemplate->set_var("TPL_VAR_BODY", $comFunc->m_dspError());
        $obMainTemplate->set_var("TPL_VAR_BREDCRUMBS", " » Error");
        $notFoundErrorFlag = 1;
        header("HTTP/1.0 404 Not Found");
    }
} elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ecom.cdetails') {
    $obDatabase->query = "SELECT vTitle,vMetaTitle,tMetaDescription,tKeywords,vLayout FROM " . CONTENTS . "," . FUSIONS . " WHERE iSubId_FK=iContentid_PK AND iState=1 AND  vSeoTitle='" . $_REQUEST['mode'] . "'";
    $rs = $obDatabase->fetchQuery();
    $rscount = $obDatabase->record_count;
    if ($rscount < 1) {
        $comFunc = new c_commonFunctions();
        $comFunc->obDb = $obDatabase;
        $comFunc->request['mode'] = 'content';
        $obMainTemplate->set_var("TPL_VAR_BODY", $comFunc->m_dspError());
        $obMainTemplate->set_var("TPL_VAR_BREDCRUMBS", "&nbsp;&raquo;&nbsp;Error");
        $notFoundErrorFlag = 1;
        header("HTTP/1.0 404 Not Found");
    }
}
if ($notFoundErrorFlag !== 1) {
    global $sModule;
    switch ($sModule) {
        case "ecom":
            $obEcomAdmin = new c_ecomController($obDatabase, $obMainTemplate, $attributes);
            break;
        case "user":
            $obUserAdmin = new c_userController($obDatabase, $obMainTemplate, $attributes);
            break;
        default: