<?php echo $header; ?>
<?php if (isset($success)) { ?>
<div class="success"><?php echo $success; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>

  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  
  <div class="content8">
		<?php if (isset($posts)) { ?>
			<div class="product-filter">
			<div class="display">
				<form method="get" action="/index.php"> 
				<input name="route" type="hidden" value="blog/post" />
				<input name="filter_title" type="text" value="<?=$filter_title?>" placeholder="enter search text..." />
				<input type="submit" value="Search" />
				<a href="index.php?route=blog/post">Clear</a>
				</form>
			</div>
			<div class="limit"><b><?php echo $text_limit; ?></b>
			  <select onchange="location = this.value;">
				<?php foreach ($limits as $limits) { ?>
				<?php if ($limits['value'] == $limit) { ?>
				<option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
				<?php } else { ?>
				<option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
				<?php } ?>
				<?php } ?>
			  </select>
			</div>
			<div class="sort"><b><?php echo $text_sort; ?></b>
			  <select onchange="location = this.value;">
				<?php foreach ($sorts as $sorts) { ?>
				<?php if ($sorts['value'] == $sort . '-' . $order) { ?>
				<option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
				<?php } else { ?>
				<option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
				<?php } ?>
				<?php } ?>
			  </select>
			</div>
		  </div>
	  
	  <div class="post_outer">
		<?php 
		$i = 1;
		foreach ($posts as $key=>$post) :
		?>
			<div class="blog-post post">
                <h3 class="teaser"><a href="<?php echo $post['href'];?>" rel="bookmark" title=""><?php echo $post['title'];?></a></h3>
                <p><?php echo $post['posted_date'];?> by <?php echo $post['author_name'];?></p>

                <?php if($post["first_image"]) { ?>
                    <div class="image">
                        <img alt="post image" src="<?php echo $post["first_image"]; ?>" />
                    </div>
                <?php } elseif($post['thumb']){ ?>
                    <div class="image">
                        <img alt="post image" src="<?php echo $post['thumb'];?>" />
                    </div>
                <?php } ?>

				<p><?php echo $post['short_description'];?>...</p>
                <div class="button_outer">
                    <a href="<?php echo $post['href'];?>" class="button"><?php echo $text_more_info; ?></a>
                </div>
			</div>


		<?php endforeach; ?>
	 </div>

	  <div class="pagination"><?php echo $pagination; ?></div>
	  <?php } ?>
	  
	  
	  <?php if (!isset($posts)) { ?>
	  <div class="content"><?php echo $text_empty; ?></div>
	  <div class="buttons">
		<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
	  </div>
	  <?php } ?>
	  
  </div>
  <?php echo $content_bottom; ?>
</div>  
<?php echo $footer; ?> 