{% Objednávka č.} {$order_data['id']}

{% Stav objednávky bol zmený na} {{echo(__('o_' . $order_data['state']))}}

{% Spôsob doručenia} {$order_data['delivery']}
{% Spôsob úhrady} {$order_data['payment']}
{% Zákazník}
{% Meno a priezvisko} {$order_data['name']}
{% Ulica a číslo} {$order_data['street']}
{% PSČ} {$order_data['postal_code']}
{% Mesto} {$order_data['city']}
{% Krajina} {$order_data['country']}
{% E-mail} {$order_data['email']}
{loop $products} {/loop}
{% Tovar}

{$value['name']}

{$value['description']}

{$value['amount']} ks

{$value['product_price']|number} EUR

{% Celková cena}

{$order_data['total_price']|number} EUR

); $prev_url = $this->app->create_url('page', $data); } catch(ModelException $e) { $prev_url = NULL; } } else { if ($current_page_parent !== NULL) { $parent_page = clone $this->services->page; $where = array(); $where[] = array('id', $current_page_parent); $where[] = array('pages_contents.language', $this->view['language']['id']); $parent_page->fetch_data($where); if ($parent_page['order'] >= 10) { $where = array(); $where[] = array('parent', $parent_page['parent']); $where[] = array('order', $parent_page['order'] - 10); $where[] = array('pages_contents.language', $this->view['language']['id']); $where[] = array('showlink', 1); $prev = clone $this->services->page; $prev->fetch_data($where); $data = array( 'language' => $this->view['language']['code'], 'url' => $prev['url'] ); $prev_url = $this->app->create_url('page', $data); } else { $prev_url = NULL; } } else { $prev_url = NULL; } } $where = array(); $where[] = array('parent', $current_page_parent); $where[] = array('order', $current_page_order + 10); $where[] = array('pages_contents.language', $this->view['language']['id']); $where[] = array('showlink', 1); $next = clone $this->services->page; try { $next->fetch_data($where); if ($next !== NULL) { $data = array( 'language' => $this->view['language']['code'], 'url' => $next['url'] ); $next_url = $this->app->create_url('page', $data); } } catch(ModelException $e) { if ($current_page_parent !== NULL) { $parent_page = clone $this->services->page; $where = array(); $where[] = array('id', $current_page_parent); $where[] = array('pages_contents.language', $this->view['language']['id']); $parent_page->fetch_data($where); $where = array(); $where[] = array('parent', $parent_page['parent']); $where[] = array('order', $parent_page['order'] + 10); $where[] = array('pages_contents.language', $this->view['language']['id']); $where[] = array('showlink', 1); $next = clone $this->services->page; try { $next->fetch_data($where); $data = array( 'language' => $this->view['language']['code'], 'url' => $next['url'] ); $next_url = $this->app->create_url('page', $data); } catch(ModelException $e) { $next_url = NULL; } } else { $next_url = NULL; } } return array('prev' => $prev_url, 'next' => $next_url); } private function projects_category() { if (isset($this->app->arguments['category']) === FALSE) { return $this->page(); } $current_category_order = $this->view['category']['order']; $data = array( 'language' => $this->view['language']['code'], 'url' => $this->view['page_url'] ); if ($current_category_order >= 20) { $where = array(); $where[] = array('order', $current_category_order - 10); $where[] = array('projects_categories_contents.language.code', $this->view['language']); $prev = clone $this->services->projects_category; $prev->fetch_data($where); $data['category'] = $prev['url']; $prev_url = $this->app->create_url('projects_category', $data); } else { $prev_url = $this->app->create_url('projects_category', $data); } $where = array(); $where[] = array('order', $current_category_order + 10); $where[] = array('projects_categories_contents.language.code', $this->view['language']); $next = clone $this->services->projects_category; try { $next->fetch_data($where); $data['category'] = $next['url']; $next_url = $this->app->create_url('projects_category', $data); } catch(ModelException $e) { $urls = $this->page(); $next_url = $urls['next']; } return array('prev' => $prev_url, 'next' => $next_url); } private function urban_plans() { if (isset($this->app->arguments['district_url']) === FALSE) { return $this->page(); } $districts = $this->view['districts']->fetch_all(); foreach ($districts as $key => $district) { if ($district['url'] === $this->app->arguments['district_url']) { break; } } $data = array( 'language' => $this->view['language']['code'], 'url' => $this->view['page_url'] ); if ($key > 0) { $prev = $districts[$key - 1]; $data['district_url'] = $prev['url']; } $prev_url = $this->app->create_url('urban_plans', $data); foreach ($districts as $key => $district) { if ($district['url'] === $this->app->arguments['district_url']) { break; } } if ($key !== (count($districts) - 1)) { $next = $districts[$key + 1]; $data['district_url'] = $next['url']; $next_url = $this->app->create_url('urban_plans', $data); } else { $urls = $this->page(); $next_url = $urls['next']; } return array('prev' => $prev_url, 'next' => $next_url); } private function eshop_category() { if (isset($this->app->arguments['category']) === FALSE) { return $this->page(); } $prev_url = NULL; $next_url = NULL; $categories = array(); foreach ($this->view['categories'] as $category) { $categories[$category['order']] = $category; } foreach ($categories as $category) { if ($category['url'] === $this->app->arguments['category']) { break; } } $data = array( 'language' => $this->view['language']['code'], 'url' => 'e-shop' ); $prev_order = $category['order'] - 10; if (isset($categories[$prev_order]) === TRUE) { $prev_category = $categories[$prev_order]; $data['category'] = $prev_category['url']; $prev_url = $this->app->create_url('eshop_category', $data); } else { $prev_url = $this->app->create_url('projects_category', $data); } $next_order = $category['order'] + 10; if (isset($categories[$next_order]) === TRUE) { $next_category = $categories[$next_order]; $data['category'] = $next_category['url']; $next_url = $this->app->create_url('eshop_category', $data); } else { $urls = $this->page(); $next_url = $urls['next']; } return array('prev' => $prev_url, 'next' => $next_url); } private function eshop_product() { $prev_url = NULL; $next_url = NULL; $category_url = Arrays::get_value($this->app->arguments, 'category'); $where = array(); $where[] = array('eshop_products.show', TRUE); $where[] = array('eshop_products_contents.language', $this->view['language']['id']); $where[] = array('eshop_products.category.show', TRUE); $where[] = array('eshop_products.category.eshop_categories_contents.language', $this->view['language']['id']); if ($category_url !== NULL) { $where[] = array('eshop_categories_contents.url', $category_url); } $order = array(); $order[] = array('eshop_products.recommended', 'DESC'); $order[] = array('eshop_products.category.order', 'ASC'); $products_ids = $this->services->eshop_product ->fetch_more($where, $order) ->fetch_values('id'); $key = array_search($this->app->arguments['product_id'], $products_ids); $prev_key = $key - 1; if (isset($products_ids[$prev_key]) === TRUE) { $w = $where; $w[] = array('eshop_products.id', $products_ids[$prev_key]); $prev_product = clone $this->services->eshop_product; $prev_product->fetch_data($w); $data = array( 'language' => $this->view['language']['code'], 'url' => 'e-shop', 'category' => $prev_product['category_url'], 'product_id' => $prev_product['id'], 'product' => Strings::webalize($prev_product['name']) ); if ($category_url !== NULL) { $prev_url = $this->app->create_url('eshop_product_category', $data); } else { $prev_url = $this->app->create_url('eshop_product', $data); } } else { $data = array( 'language' => $this->view['language']['code'], 'url' => 'e-shop', 'category' => $category_url ); $prev_url = $this->app->create_url('eshop_category', $data); } $products_count = count($products_ids); $next_key = $key + 1; if (isset($products_ids[$next_key]) === TRUE) { $where[] = array('eshop_products.id', $products_ids[$next_key]); $next_product = clone $this->services->eshop_product; $next_product->fetch_data($where); $data = array( 'language' => $this->view['language']['code'], 'url' => 'e-shop', 'category' => $next_product['category_url'], 'product_id' => $next_product['id'], 'product' => Strings::webalize($next_product['name']) ); if ($category_url !== NULL) { $next_url = $this->app->create_url('eshop_product_category', $data); } else { $next_url = $this->app->create_url('eshop_product', $data); } } else { $data = array( 'language' => $this->view['language']['code'], 'url' => 'e-shop', 'category' => $category_url ); $next_url = $this->app->create_url('eshop_category', $data); } return array('prev' => $prev_url, 'next' => $next_url); } }