Beispiel #1
0
 function __construct()
 {
     $tree = Tree::getTreeByUrl();
     Funcs::setMeta($tree);
     $list = Search::getResult();
     View::render('site/search', array('list' => $list));
 }
Beispiel #2
0
 function __construct()
 {
     if ($_POST) {
         DB::escapePost();
         News::setSubscribers();
         if ($_SERVER['HTTP_REFERER']) {
             $this->redirect($_SERVER['HTTP_REFERER']);
         } else {
             $this->redirect('/media/news/');
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         if (Funcs::$uri[2] == '') {
             $tree['pic'] = $tree['fields']['files_gal1'][0]['path'];
             $tree['list'] = News::getList($tree['id']);
             //$tree['tags']=News::getTagList($tree['id']);
             View::render('news/list', $tree);
         } else {
             //$tree['tags']=News::getTags($tree['id']);
             $tree['next'] = News::getNext($tree['id'], $tree['parent'], $tree['udate']);
             $tree['prev'] = News::getPrev($tree['id'], $tree['parent'], $tree['udate']);
             if (isset($_GET['print'])) {
                 View::render('news/print', $tree);
             } else {
                 View::render('news/one', $tree);
             }
         }
     }
 }
 function __construct()
 {
     if (Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
         Funcs::setMeta($tree);
         $tree['list'] = Compare::getCompare();
         View::render('compare/list', $tree);
     }
 }
 public function upload()
 {
     if ($_SESSION['iuser']['id']) {
         if ($_POST['act'] == 'step1') {
             $model = new Upload();
             $model->step1();
             $this->redirect('/fotobook/upload/step2/');
         } elseif ($_POST['act'] == 'step2') {
             $model = new Upload();
             $model->step2();
             $this->redirect('/fotobook/upload/step3/');
         } elseif ($_POST['act'] == 'step3') {
             $model = new Upload();
             $model->step3();
             View::$layout = 'empty';
             View::render('fotobook/upload/step3done');
         } elseif ($_POST['act'] == 'step3return') {
             $model = new Upload();
             $model->step3return();
             //$this->redirect('/fotobook/upload/step4/');
         } elseif ($_POST['act'] == 'step4') {
             $model = new Upload();
             $data = $model->step4();
             $this->redirect('/fotobook/upload/thanks/', $data);
         } elseif (Funcs::$uri[2] == '') {
             $this->redirect('/fotobook/upload/step1/');
         } elseif (Funcs::$uri[2] == 'step1') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step1', $tree);
         } elseif (Funcs::$uri[2] == 'step2') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step2', $tree);
         } elseif (Funcs::$uri[2] == 'step3') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step3', $tree);
         } elseif (Funcs::$uri[2] == 'step3show') {
             View::$layout = 'empty';
             View::render('fotobook/upload/step3show');
         } elseif (Funcs::$uri[2] == 'step4') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step4', $tree);
         } elseif (Funcs::$uri[2] == 'thanks') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/thanks', $tree);
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('fotobook/upload/page', $tree);
     }
 }
 function __construct()
 {
     if (Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
         Funcs::setMeta($tree);
         $tree['list'] = Catalog::getFavorite();
         //$tree['recommended']=Catalog::getRecommended();
         View::render('favorite/list', $tree);
     }
 }
Beispiel #6
0
 function __construct()
 {
     $seo = array();
     $seo['seo_title'] = 'Пользователи';
     Funcs::setMeta($seo);
     if (is_numeric(Funcs::$uri[1]) && !Funcs::$uri[2]) {
         $data = User::getOne(Funcs::$uri[1]);
         $data['list'] = Catalog::getUserBooksList(Funcs::$uri[1]);
         View::render('user/one', $data);
     }
 }
 public function orders()
 {
     $data = array();
     $seo['seo_title'] = 'Управления заказами';
     Funcs::setMeta($seo);
     if (Funcs::$uri[2] == '') {
         $data['list'] = Manager::getManagerOrders();
         View::render('manager/orders', $data);
     } else {
         $data = Orders::getOne(Funcs::$uri[2]);
         $data['avatar'] = User::getAvatar($data['iuser']);
         View::render('manager/order', $data);
     }
 }
Beispiel #8
0
 function __construct()
 {
     $tree = Tree::getTreeByUrl('wide');
     Funcs::setMeta($tree);
     if ($_POST) {
         if (Online::send($tree['id'])) {
             $this->redirect('/online/thanks/');
         }
     }
     if (Funcs::$uri[1] == '') {
         View::render('online/form', $tree);
     } else {
         View::render('site/page', $tree);
     }
 }
 public function message()
 {
     if ($_POST) {
         $error = Feedback::sendMessage();
         if ($error) {
             View::render('faq/list', $tree);
         } else {
             $this->redirect('/feedback/message/?done');
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('feedback/message', $tree);
     }
 }
 function __construct()
 {
     $tree = Tree::getTreeByUrl('gal');
     Funcs::setMeta($tree);
     if (Funcs::$uri[2] == '') {
         $tree['list'] = Specials::getList($tree['id']);
         View::render('specials/list', $tree);
     } else {
         //$parents=Tree::getParents($tree['id']);
         //$parentTree=Tree::getTreeById($parents[count($parents)-3],'gal');
         //$tree['pic']=$parentTree['fields']['files_gal1'][0]['path'];
         $tree = Specials::getOne($tree['id']);
         //$tree['tags']=Articles::getTags($tree['id']);
         View::render('specials/one', $tree);
     }
 }
Beispiel #11
0
 function __construct()
 {
     if (!in_array(Funcs::$uri[1], get_class_methods(__CLASS__))) {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         $tree['list'] = Faq::getList($tree['id']);
         if ($_POST) {
             $error = Faq::ask($tree['id']);
             if ($error) {
                 View::render('faq/list', $tree);
             } else {
                 $this->redirect('/help/faq/');
             }
         } else {
             View::render('faq/list', $tree);
         }
     }
 }
Beispiel #12
0
 function __construct()
 {
     if ($_GET['act'] == 'del') {
         Forum::del();
         $this->redirect('/' . implode('/', Funcs::$uri) . '/');
     }
     if (Funcs::$uri[2] == '') {
         $tree = Tree::getTreeByUrl('wide', array('help', 'forum'));
         Funcs::setMeta($tree);
         $tree['list'] = Forum::getForum();
         View::render('forum/forum', $tree);
     } elseif (Funcs::$uri[3] == '') {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getItems();
                 Funcs::setMeta($tree);
                 View::render('forum/items', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/');
             }
         } else {
             $tree = Forum::getItems();
             Funcs::setMeta($tree);
             View::render('forum/items', $tree);
         }
     } else {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getList();
                 Funcs::setMeta($tree);
                 View::render('forum/list', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/' . Funcs::$uri[3] . '/');
             }
         } else {
             $tree = Forum::getList();
             Funcs::setMeta($tree);
             View::render('forum/list', $tree);
         }
     }
 }
Beispiel #13
0
 public function thanks()
 {
     $tree['seo_title'] = $tree['seo_keywords'] = $tree['seo_description'] = 'Спасибо за заказ';
     Funcs::setMeta($tree);
     View::render('basket/thanks');
 }
Beispiel #14
0
 function __construct()
 {
     if (Funcs::$uri[0] == '') {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         //$tree['hits']=Index::getHits();
         //$tree['mainbanner']=Index::getMainBanner();
         //$id=Tree::getIdTreeByModule('news');
         //$tree['news']=News::getList($id,2);
         //$tree['banners']=Index::getBanners();
         /*$tree['about']=Fields::getFieldsByTree(8,'wide');
         		$tree['examples']=Index::getExamples();
         		$tree['forum']=Forum::getIndex();*/
         View::render('site/index', $tree);
     } elseif (Funcs::$uri[0] == 'sitemap') {
         //$tree=Tree::getTreeByUrl('wide');
         //Funcs::setMeta($tree);
         $model = new Tree();
         $tree['sitemap'] = $model->getSitemap();
         View::render('site/sitemap', $tree);
     } elseif (Funcs::$uri[0] == 'rss') {
         View::$layout = "empty";
         View::render('news/rss', News::getRSS());
     } elseif (Funcs::$uri[0] == 'contacts' && Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('site/contacts', $tree);
     } elseif (Funcs::$uri[0] == 'viewed') {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         $tree['list'] = Catalog::getViewed();
         $tree['recommended'] = Catalog::getRecommended();
         View::render('favorite/viewed', $tree);
     } elseif (Funcs::$uri[0] == 'customer' && Funcs::$uri[1] == 'partners' && Funcs::$uri[2] == 'anketa' && Funcs::$uri[3] == '') {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('site/anketa', $tree);
     } else {
         $tree = Tree::getTreeByUrl();
         Funcs::setMeta($tree);
         if ($tree['info']['type'] == 'spage') {
             $class = strtoupper(substr($tree['info']['path'], 0, 1)) . substr($tree['info']['path'], 1, strlen($tree['info']['path']));
             if (class_exists($class)) {
                 if ($tree['info']['id2'] == 0) {
                     eval('$tree[\'list\']=' . $class . '::getList($tree[\'id\']);');
                     View::render($tree['info']['path'] . '/list', $tree);
                 } else {
                     eval('$tree[\'fields\']=' . $class . '::getOne($tree[\'id\']);');
                     if (isset($_GET['print'])) {
                         View::$layout = 'empty';
                         View::render($tree['info']['path'] . '/print', $tree);
                     } else {
                         View::render($tree['info']['path'] . '/one', $tree);
                     }
                 }
             } else {
                 if ($tree['info']['id2'] == 0) {
                     $tree['list'] = Spage::getList($tree['id']);
                     View::render($tree['info']['path'] . '/list', $tree);
                 } else {
                     $tree['fields'] = Spage::getOne($tree['id']);
                     if (isset($_GET['print'])) {
                         View::$layout = 'empty';
                         View::render($tree['info']['path'] . '/print', $tree);
                     } else {
                         View::render($tree['info']['path'] . '/one', $tree);
                     }
                 }
             }
         } else {
             View::render('site/page', $tree);
         }
     }
 }
Beispiel #15
0
 function thanks()
 {
     $tree = Tree::getTreeByUrl('wide');
     Funcs::setMeta($tree);
     View::render('faq/thanks', $tree);
 }
 function confirm()
 {
     $model = new User();
     $model->setConfirm();
     $tree = Tree::getTreeByUrl();
     Funcs::setMeta($tree);
     View::render('registration/thanks', $tree);
 }
Beispiel #17
0
 function fail()
 {
     $tree['seo_title'] = 'Покупка подарочной карты';
     Funcs::setMeta($tree);
     View::render('cards/fail', $tree);
 }
Beispiel #18
0
 function __construct()
 {
     if ($_POST) {
         DB::escapePost();
         if (isset($_POST['report'])) {
             $tree = Tree::getTreeByUrl();
             $href = Catalog::getPathToTree($tree['id']);
             Catalog::setReport($tree['id']);
             View::$layout = 'empty';
             View::render('site/redirect', array('href' => $href, 'text' => 'Отзыв успешно добавлен!'));
             die;
         }
         if (isset($_POST['subscribe'])) {
             $tree = Tree::getTreeByUrl();
             $href = Tree::getPathToTree($tree['id']);
             Catalog::setSubscribe($tree['id']);
             die;
         }
     } else {
         DB::escapeGet();
         if (Funcs::$uri[1] == '' && isset($_GET['hits']) && Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl();
             Funcs::setMeta($tree);
             $tree = Catalog::getHitCatalog($tree['id']);
             View::render('catalog/catalog', array('list' => $tree, 'name' => 'Все хиты'));
         } elseif (Funcs::$uri[1] == '' && Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl();
             Funcs::setMeta($tree);
             $tree = Catalog::getPreviewCatalog($tree['id']);
             //View::render('catalog/catalog',array('list'=>$tree));
         } elseif (Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
             if ($tree['info']['type'] == 'struct') {
                 $temp = Catalog::getInnerListPagi($tree['id']);
                 $tree['list'] = $temp['list'];
                 $tree['vendors'] = Catalog::getVendors($tree['id'], $tree['list']);
                 //$tree['options']['available']=array();
                 //$tree['options']['catalog']=Catalog::getType($tree['id'],$tree['parent']);
                 //$tree['options']['vendors']=Catalog::getVendors($tree['id']);
                 if ($_GET['ve']) {
                     $tree['name'] = $tree['seo_description'] = $tree['name'] . ' ' . Funcs::$referenceId['vendor'][$_GET['ve']]['name'];
                     Funcs::setMeta($tree);
                 }
                 $tree['options']['price'] = Catalog::getValuesPrice($tree['id']);
                 $tree['options']['price2'] = Catalog::getLink('pricelink');
                 //$tree['options']['rating']=array();
                 Funcs::setMeta($tree);
                 $tree['quantity'] = $temp['quantity'];
                 if ($_GET['ajax'] == 'act') {
                     print $tree['quantity'];
                     die;
                 } else {
                     View::render('catalog/list', $tree);
                 }
             } else {
                 Funcs::setMeta($tree, 'goods');
                 $id = $tree['id'];
                 $tree = Catalog::getOne($id);
                 Catalog::setPopularity($id);
                 $tree['reports'] = Catalog::getReports($id);
                 Catalog::setViewed($id);
                 $tree['same_price'] = Catalog::getAdditionalgood($id, 'better_for_same_price');
                 $tree['accessories'] = Catalog::getAdditionalgood($id, 'accessories');
                 //$tree['similargoods']=Catalog::getAdditionalgood($id,'similargoods');
                 $tree['similargoods'] = Catalog::getMore($tree['id'], $tree['parent']);
                 $tree['reportme'] = Catalog::getReport($tree['id']);
                 if (isset($_GET['print'])) {
                     View::$layout = 'empty';
                     View::render('catalog/print', $tree);
                     die;
                 } else {
                     View::render('catalog/one', $tree);
                 }
             }
         }
     }
 }
Beispiel #19
0
 function messages()
 {
     if ($_POST) {
         Funcs::escapePost();
         Message::addMessage(Funcs::$uri[2], $_POST['message']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if ($_GET['del']) {
         Funcs::escapeGet();
         Message::delMessage($_GET['del']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if (is_numeric(Funcs::$uri[2])) {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data = Message::getList(Funcs::$uri[2]);
         View::render('cabinet/messagesOne', $data);
     } else {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data['list'] = Message::getUsers();
         View::render('cabinet/messages', $data);
     }
 }
Beispiel #20
0
 public function thanks()
 {
     $tree = Tree::getTreeByUrl('wide');
     Funcs::setMeta($tree);
     View::render('site/page', $tree);
 }