public function index() { if (App::getModel('cart')->getMinimumOrderValue() > 0) { App::redirectUrl($this->registry->router->generate('frontend.cart')); } $this->Render('Checkout'); }
public function index() { if (Session::getActiveClientid() == NULL) { App::redirectUrl($this->registry->router->generate('frontend.mainside', true)); } $this->Render('ClientAddress'); }
public function __construct($registry, $modelFile = NULL) { parent::__construct($registry, $modelFile); $this->model = App::getModel('layerednavigationbox'); $this->controller = $this->registry->router->getCurrentController(); //$this->args = array( //'orderBy' => $this->getParam('orderBy', 'default'), //'orderDir' => $this->getParam('orderDir', 'asc'), //'currentPage' => 1, //'viewType' => $this->getParam('viewType', 0), //'priceFrom' => $this->getParam('priceFrom', 0), //'priceTo' => $this->getParam('priceTo', Core::PRICE_MAX), //'producers' => $this->getParam('producers', 0), //'attributes' => $this->getParam('attributes', 0) //); //$this->controller = $this->registry->router->getCurrentController(); //if($this->controller == 'categorylist') { //$this->category = App::getModel('categorylist')->getCurrentCategory(); //$this->args['param'] = $this->category['seo']; //} //elseif ($this->controller == 'productsearch') { //$this->args['action'] = 'index'; //$this->args['param'] = $this->getParam(); //} //else { //$this->category = array('id' => 0); //} if (isset($_POST['layered_submitted']) && $_POST['layered_submitted'] == 1) { App::redirectUrl($this->model->generateRedirectUrl()); } //$this->productIds = $this->getProducts(); }
public function index() { if (Session::getActiveClientid() > 0) { App::redirectUrl($this->registry->router->generate('frontend.clientsettings', true)); } $this->Render('Registration'); }
public function __construct($registry, $modelFile = NULL) { parent::__construct($registry, $modelFile); $this->controller = $this->registry->router->getCurrentController(); $this->init(); if (isset($_POST['layered_submitted']) && $_POST['layered_submitted'] == 1) { App::redirectUrl($this->generateRedirectUrl()); } $this->productIds = $this->getProducts(); }
public function logout() { if ($this->registry->router->getAdministrativeMode() == 1) { Session::flush(); App::redirectUrl($this->registry->router->generate('frontend.login', true)); } else { App::getModel('clientlogin')->destroyAutologinKey(); Session::flush(); App::redirectUrl($this->registry->router->generate('frontend.home', true)); } }
public function index() { $cms = $this->model->getStaticContent((int) $this->registry->core->getParam()); if (empty($cms)) { App::redirectUrl($this->registry->router->generate('frontend.home', true)); } if (!empty($cms['redirect']) && $cms['redirect'] == 1 && !empty($cms['redirect_route'])) { App::redirectUrl($this->registry->router->generate($cms['redirect_route'], true)); } $this->registry->template->assign('cms', $cms); return $this->registry->template->fetch($this->loadTemplate('index.tpl')); }
public function cancel() { $clientorder = Session::getActivePaymentData(); if (isset($clientorder) && $clientorder != NULL) { $paymentMethodModel = App::getModel('payment')->getPaymentMethodById($clientorder['orderData']['payment']['idpaymentmethod']); $paymentMethodData = App::getModel('payment/' . $paymentMethodModel)->getPaymentData($clientorder); $paymentMethodData = App::getModel('payment/' . $paymentMethodModel)->cancelPayment($clientorder, $this->registry->core->getParam()); $this->registry->template->assign('content', $paymentMethodData); $this->registry->template->assign('orderId', $clientorder['orderId']); $this->registry->template->assign('orderData', $clientorder['orderData']); return $this->registry->template->fetch($this->loadTemplate($paymentMethodModel . '.tpl')); } else { App::redirectUrl($this->registry->router->generate('frontend.home', true)); } }
public function getNewsById($id) { $sql = "SELECT \n\t\t\t\t\tN.idnews, \n\t\t\t\t\tNT.topic, \n\t\t\t\t\tNT.summary,\n\t\t\t\t\tNT.content,\n\t\t\t\t\tNT.seo,\n\t\t\t\t\tNT.keyword_title,\n\t\t\t\t\tNT.keyword,\n\t\t\t\t\tNT.keyword_description,\n\t\t\t\t\tN.adddate,\n\t\t\t\t\tN.featured\n\t\t\t\tFROM news N\n\t\t\t\tLEFT JOIN newsview NV ON NV.newsid = idnews\n\t\t\t\tLEFT JOIN newstranslation NT ON N.idnews = NT.newsid AND NT.languageid = :languageid\n\t\t\t\tWHERE\n\t\t\t\t\tidnews=:id\n\t\t\t\tAND\n\t\t\t\t\tpublish = 1\n\t\t\t\tAND\n\t\t\t\t\tIF((N.startdate IS NULL OR N.startdate = '0000-00-00 00:00:00' OR N.startdate <= CURDATE()) AND (N.enddate IS NULL OR N.enddate = '0000-00-00 00:00:00' OR N.enddate >= CURDATE()), 1, 0)\n\t\t\t\t\t\n\t\t\t\tAND\n\t\t\t\t\tNV.viewid = :viewid\n\t\t\t\tORDER BY N.`adddate` desc"; $stmt = Db::getInstance()->prepare($sql); $stmt->bindValue('id', $id); $stmt->bindValue('languageid', Helper::getLanguageId()); $stmt->bindValue('viewid', Helper::getViewId()); $stmt->execute(); $rs = $stmt->fetch(); $Data = array(); if ($rs) { $Data = array('featured' => $rs['featured'], 'topic' => $rs['topic'], 'adddate' => $rs['adddate'], 'summary' => $rs['summary'], 'content' => $rs['content'], 'seo' => $rs['seo'], 'link' => $this->generateUrl($rs['idnews'], $rs['seo']), 'keyword_title' => $rs['keyword_title'] == NULL || $rs['keyword_title'] == '' ? $rs['topic'] : $rs['keyword_title'], 'keyword' => $rs['keyword'], 'keyword_description' => $rs['keyword_description'], 'mainphoto' => $this->getPhotosByNewsId($id), 'otherphoto' => $this->getOtherPhotosByNewsId($id)); return $Data; } else { App::redirectUrl($this->registry->router->generate('frontend.news', true)); } }
protected function categorylist($id) { $category = App::getModel('categorylist')->getCurrentCategory(); if (empty($category)) { App::redirectUrl($this->registry->router->generate('frontend.sitemap', true)); } $sql = "SELECT\n\t\t\t\t\tCONCAT(:seo,'/',IF(CT.seo IS NOT NULL, CT.seo,'')) AS link, \n\t\t\t\t\tCT.name AS title\n\t\t\t\tFROM categorypath CP\n\t\t\t\tLEFT JOIN categorytranslation CT ON CP.ancestorcategoryid = CT.categoryid AND CT.languageid = :languageid\n\t\t\t\tWHERE CP.categoryid = :categoryid\n\t\t\t\tORDER BY CP.order DESC"; $stmt = Db::getInstance()->prepare($sql); $stmt->bindValue('seo', Seo::getSeo('categorylist')); $stmt->bindValue('categoryid', $category['id']); $stmt->bindValue('languageid', Helper::getLanguageId()); $stmt->execute(); $Data = array(); while ($rs = $stmt->fetch()) { $Data[] = array('link' => $rs['link'], 'title' => $rs['title']); } return $Data; }
public function index() { if (strlen($this->getParam()) == 0) { App::redirectUrl($this->registry->router->generate('frontend.home', true)); } $product = App::getModel('product/product')->getProductAndAttributesById((int) $this->registry->core->getParam()); $range = App::getModel('product/product')->getRangeType((int) $this->registry->core->getParam()); App::getModel('product/product')->getPhotos($product); if (empty($product)) { App::redirectUrl($this->registry->router->generate('frontend.home', true)); } $product['photo']['normal'][0] = 'design/' . str_replace(DESIGNPATH, '', $product['photo']['normal'][0]); $selectAttributes = App::getModel('product/product')->getProductAttributeGroups($product); $attset = App::getModel('product/product')->getProductVariant($product); $this->registry->template->assign('product', $product); $this->registry->template->assign('attributes', $selectAttributes); $this->registry->template->assign('attset', $attset); $this->registry->template->assign('ROOTPATH', ROOTPATH); $htmlcontent = $this->registry->template->fetch($this->loadTemplate('index.tpl')); $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Gekosale'); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray(1); $pdf->SetFont('dejavusans', '', 10); $pdf->AddPage(); $pdf->writeHTML($htmlcontent, true, 0, true, 0); @ob_clean(); $pdf->Output($product['seo'], 'D'); }
public function getCurrentCategory() { if (strlen($this->getParam()) == 0) { App::redirectUrl($this->registry->router->generate('frontend.sitemap', true)); } if (empty($this->_currentCategory)) { $this->getCategoryBySeo($this->getParam()); } return $this->_currentCategory; }
public function generateSitemap($id) { $sql = "SELECT * \n\t\t\t\tFROM sitemaps \n\t\t\t\tWHERE idsitemaps = :id\n\t\t\t\t"; $stmt = Db::getInstance()->prepare($sql); $stmt->bindValue('id', $id); $stmt->execute(); $rs = $stmt->fetch(); if ($rs) { $xml = new \SimpleXMLElement('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></urlset>'); if ($rs['publishforcategories']) { $Categories = $this->getCategories(4); foreach ($Categories as $category) { $node = $xml->addChild('url'); $node->addChild('loc', $category['loc']); $node->addChild('lastmod', $category['lastmod']); $node->addChild('changefreq', 'weekly'); $node->addChild('priority', $rs['priorityforcategories']); } } if ($rs['publishforproducts']) { $Products = $this->getProducts(1000); foreach ($Products as $product) { $node = $xml->addChild('url'); $node->addChild('loc', $product['loc']); $node->addChild('lastmod', $product['lastmod']); $node->addChild('changefreq', 'weekly'); $node->addChild('priority', $rs['priorityforproducts']); } } if ($rs['publishforproducers']) { } if ($rs['publishfornews']) { $News = $this->getNews(); foreach ($News as $news) { $node = $xml->addChild('url'); $node->addChild('loc', $news['loc']); $node->addChild('lastmod', $news['lastmod']); $node->addChild('changefreq', 'weekly'); $node->addChild('priority', $rs['priorityfornews']); } } if ($rs['publishforpages']) { $Pages = $this->getPages(); foreach ($Pages as $page) { $node = $xml->addChild('url'); $node->addChild('loc', $page['loc']); $node->addChild('lastmod', $page['lastmod']); $node->addChild('changefreq', 'weekly'); $node->addChild('priority', $rs['priorityforpages']); } } } else { App::redirectUrl($this->registry->router->generate('frontend.sitemap', true)); } header('Content-type: text/xml; charset=utf-8'); header('Cache-Control: max-age=0'); $doc = new \DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $domnode = dom_import_simplexml($xml); $domnode = $doc->importNode($domnode, true); $domnode = $doc->appendChild($domnode); echo $doc->saveXML(); }