<div class="row-fluid">
<div class="span8 categories" >
<link href="<?php echo base_url();?>assets/css/style.css" rel="stylesheet">
<div class="span12"><h2>Latest Classifieds</h2></div>
<div class="span12">
<div id="wrapper">
	<div id="columns">
	<?php if(isset($listings) && count($listings) > 0) { foreach($listings as $listing){ 
		$images=$this->postings_model->getPostingImages($listing->id);
		
		if(count($images)>0){
			$item_image=$images->image_url;
		}else{
			$item_image='default.png';
		}
		?>
		<div class="pin">
			<a href="<?php echo base_url();?>details/<?php echo formatText($listing->title);?>/<?php echo $listing->id;?>"><?php echo show_thumb($item_image,250,250,'class="img-thumbnail"');?></a>
			<p>
				<a href="<?php echo base_url();?>details/<?php echo formatText($listing->title);?>/<?php echo $listing->id;?>"><?php echo $listing->title;?></a><br><?php echo strlen($listing->description) > 100 ? substr($listing->description,0,100) : $listing->description;?>
			</p>
		</div>
	<?php } } ?>
	</div></div>
<div class="span4">
<ul>
<?php $count=0;foreach($parent_categories as $category){ ?>
    
        <li>
	<h4><a href="<?php echo base_url().'categories/'.formatText($category->name).'/'.$category->id;?>"><?php echo $category->name;?></a>
	</h4></li>
	<?php 
		$subcats=$this->categories_model->getSubCategories($category->id);
		if(count($subcats) > 0 ){
			?>
			<?php foreach($subcats as $subcategory){ ?>
			<li><a href="<?php echo base_url().'categories/'.formatText($subcategory->name).'/'.$subcategory->id;?>"><?php echo $subcategory->name;?></a></li><?php }?>			
			<?php
		}
	?>
<?php $count++;
	if($count==3){ echo '</ul></div><div class="span4"><ul>';$count=0;}
} ?>
    </ul>
</div>
</div>
  </div>
<div class="span4"><a class="btn btn-large btn-block btn-primary btn-warning" href="<?php echo base_url().'postad';?>" title="Post free classified ads">Post a Free Ad</a><!--<button class="btn btn-large btn-block btn-primary btn-warning" type="button">Post New Ad</button>-->  </div>
<div class="span4">&nbsp;</div>
<!--<div class="span4">
<div class="well">Featured Listings
<div>
	<img src="<?php echo base_url();?>assets/images/LeeByeong-heonava145.jpg" class="img-rounded">
</div>
                      <div style="vertical-align: top;" >
                          <h5>Title of the listing </h5>
                          
                      </div>
</div>
</div>-->

</div>