<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
	/****************************************************
		*
		* @File:      template.php
		* @Package:   GetSimple
		* @Action:    Bootstrap3 for GetSimple CMS
		*
	*****************************************************/
?>

<?php include('header.inc.php'); ?>

<div class="container center">
	<div id="<?php get_page_slug(); ?>" class="grid">
		<div class="width-medium-2-3">
			<article class="uk-article">
				<h1 id="pagetitle" class="uk-article-title"><?php echo $set_lang['FX_SEARCH_REZ']; ?></h1>
				<?php 
				if (function_exists('get_i18n_search_form') && return_theme_setting('search_internal')!=1) {
					if(isset($_POST['keywords'])) $keywords = @explode(' ', $_POST['keywords']);
					if($language == "ru") $format_date = '%d.%m.%Y';
					else $format_date = '%Y.%m.%d';
					if(isset($_GET['tags'])) $keytags = $_GET['tags'];
					if(isset($_GET['words'])) $keywords = $_GET['words'];
					get_i18n_search_form(array('slug'=>'search'));
					if(!empty($keywords) && !empty($keytags) && !is_array($keywords)) {
						get_i18n_search_results(array('tags'=>$keytags, 'words'=>$keywords, 'DATE_FORMAT'=>$format_date));
					}
					else {
						if(!empty($keywords)) { get_i18n_search_results(array('words'=>$keywords, 'DATE_FORMAT'=>$format_date)); }
						if(!empty($keytags)) { get_i18n_search_results(array('tags'=>$keytags, 'DATE_FORMAT'=>$format_date)); }
					}
				} 
				else {
					if(return_theme_setting('search_meta')==1) get_search_results(true);
					 else get_search_results(false);
				}	 ?>
			</article>
		</div>
		<aside class="sidebar-a width-medium-1-3">	
			<div class="panel panel-box widget_text">
				<?php get_navigation_items(return_page_slug(), 'context-noparents-current', true); ?>
			</div>
		</aside>
	</div>
</div>

<?php include('footer.inc.php'); ?>