<section id="portfolio" class="page-section-main">
  <div class="port-wraper">

    <div class="container">
      <div class="row pad-top-150">
      
        <div class="col-md-6 col-xs-12">
          <!-- <div class="port-ico-img"><i class="icon-stack"></i></div> -->
          <div class="port-nav">
            <ul class="filter" id="port-menu">
            <li>
                <a href="#"  class="port-hover filter active" data-group="all">همه</a>
                 <span>&nbsp; &nbsp;/</span>
               </li>
            <?php
			$sql_portal=$db->query("select * from categories order by id desc limit 5");

			while($res_portal=$db->fetchNextArray($sql_portal)){
			?>
              <li>
                <a href="#"  class="filter" data-group="<?php echo $res_portal['id'];?>"><?php echo $res_portal['name'];?></a>
                 <span>&nbsp; &nbsp;/</span>
               </li>
               <?php }?>
            </ul>
          </div>
        </div>
        <div class="col-md-1"></div>
        <div class="col-md-5 col-xs-12 pad-bottom-50 animated" data-fx="fadeInUp">
          <div class="port-head">
            <h1>نمونه کارها</h1>
            <h2>آخرین پروژه های ما :)</h2>
          </div>
        </div>
         
        
      </div>
    </div>

    <!--======== ajax area trigger =========== -->
     <div class="ajax_area_trigger">
        
        <div class="ajax_close">
         <span><a href="#"><i class="icon-cross3"></i></a></span>
        </div>

        <div class="ajax_drop"></div>
      </div>

<!--//////port conent area ///////-->
<div class="port-content-main">
  <div id="grid" class="port-row">
    <!-- 1st tile -->
     <?php
			$sql_portal=$db->query("select * from ads order by id desc limit 12");

			while($res_portal=$db->fetchNextArray($sql_portal)){
				
				$ecat=$db->query("select * from categories where id='".$res_portal['category']."'");
				$cat=$db->fetchNextArray($ecat);
				
				$epic=$db->query("select * from pictures where profile='1' and adid='".$res_portal['id']."'");
				$pic=$db->fetchNextArray($epic);
			?>
    <div class="port-tile-main" data-groups='["all", "<?php echo $res_portal['category'];?>"]'>
      <div class="port-tile">
       <div class="port-img"><img src="<?php echo $pic['file'];?>" class="img-responsive" alt="<?php echo $pic['name'];?>"></div>
       <div class="fg-port-left"></div>
       <div class="fg-port-sland-left"></div>
       <div class="fg-port-sland-left-content">
        <h1><?php echo $res_portal['name'];?></h1>
        <h2><?php echo $cat['name'];?></h2>
       </div>
       <div class="port-btn">
        <a href="<?php echo seourl('portfolio',$res_portal['id']);?>" ><i class="icon-search"></i></a>
       </div>
      </div>
    </div>
    
<?php }?>
  </div>
</div>

  </div>
</section>