<?php 
/* Template Name: Sales template */
get_header();
?>
<!----------------------- banner---------------------------------------------------->

<div class="bannerbox"><?php the_post_thumbnail();?></div>

<!----------------------- banner---------------------------------------------------->


<div class="container">
  <div class="pos_head">
      <div class="page_head"><h1><?php the_title();?></h1></div>
  </div>  

</div>

<div class="innerpages">
    <div class="container">
    	<div class="sale_tab">
            <!-- Nav tabs -->
            <ul class="nav nav-tabs jet_tab" role="tablist">
               <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">
               <img src="<?php echo get_template_directory_uri();?>/images/s1.jpg" width="233" height="73" /></a>
               </li>
               <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">
               <img src="<?php echo get_template_directory_uri();?>/images/s2.jpg" width="233" height="73" /></a>
               </li>
               <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">
               <img src="<?php echo get_template_directory_uri();?>/images/s3.jpg" width="233" height="73" /></a>
               </li>
            </ul>
    
            <!-- Tab panes -->
            <div class="tab-content">
              <div role="tabpanel" class="tab-pane fade in active" id="home">
              	<div class="row">
              	<?php
		   $i=0;
		   query_posts( 'cat=4 &order=asc' );while ( have_posts() ) : the_post();
		   $featuredImage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full'); 
		?>
		   <div class="col-md-4 col-sm-4">
                    <div class="jet_panel">
                    <a href="" data-toggle="modal" data-target="#myModal<?php the_ID();?>"><img src="<?php echo  $featuredImage[0];?>" /></a>
                    	<div class="blk_bg">         
                            <div class="row">
                                <div class="col-md-12">
                               <?php the_title();?>
                                </div>                               
                            </div>
                             <?php the_content();?>                                                
                   	 </div>
                    </div>
                    </div>                                        
		    <div id="myModal<?php the_ID();?>" class="modal fade" role="dialog">
		      <div class="modal-dialog">
		        <div class="modal-content">
		          <div class="modal-header">
		            <button type="button" class="close" data-dismiss="modal">&times;</button>
		          </div>
		          <div class="modal-body">
		            <div id="carousel-example-generic2<?php the_ID();?>" class="carousel slide" data-ride="carousel">
		              <!-- Indicators -->
		              <ol class="carousel-indicators">
		              <?php
		               global $dynamic_featured_image;$k=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				 foreach($featured_images as $images) {?>
				<?php $imageurl = $images['full'];?>				  
				  <li data-target="#carousel-example-generic2<?php the_ID();?>" data-slide-to="<?php echo $k;$k++;?>"></li>
		                 <?php } ?>
		              </ol>
		              <!-- Wrapper for slides -->
		              <div class="carousel-inner" role="listbox">
		               <?php global $dynamic_featured_image;$j=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				foreach($featured_images as $images) {$j++;?>
				<?php $imageurl = $images['full'];?>
				  <div class="item bnr <?php if($j==1){?>active<?php } ?>">
				    <img src="<?php echo $imageurl;?>" alt="">
		                </div>
				<?php } ?>                     
		              </div>
		              <!-- Controls -->
		              <a class="left carousel-control" href="#carousel-example-generic2<?php the_ID();?>" role="button" data-slide="prev">
		                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
		                <span class="sr-only">Previous</span>
		              </a>
		              <a class="right carousel-control" href="#carousel-example-generic<?php the_ID();?>" role="button" data-slide="next">
		                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
		                <span class="sr-only">Next</span>
		              </a>
		            </div>
		          </div>          
		        </div>
		      </div>
		    </div>                 
       		 <?php if($i==2){?><div class="clearfix"></div><?php }endwhile; ?>
       		 </div>               
              </div>
              <div role="tabpanel" class="tab-pane fade" id="profile">
              <div class="row">
              	<?php
		   $i=0;
		   query_posts( 'cat=5 &order=asc' );while ( have_posts() ) : the_post();
		   $featuredImage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full'); 
		?>
		   <div class="col-md-4 col-sm-4">
                    <div class="jet_panel">
                    <a href="" data-toggle="modal" data-target="#myModal<?php the_ID();?>"><img src="<?php echo  $featuredImage[0];?>" /></a>
                    	<div class="blk_bg">         
                            <div class="row">
                                <div class="col-md-12">
                               <?php the_title();?>
                                </div>                               
                            </div>
                             <?php the_content();?>                                                
                   	 </div>
                    </div>
                    </div>                                        
		    <div id="myModal<?php the_ID();?>" class="modal fade" role="dialog">
		      <div class="modal-dialog">
		        <div class="modal-content">
		          <div class="modal-header">
		            <button type="button" class="close" data-dismiss="modal">&times;</button>
		          </div>
		          <div class="modal-body">
		            <div id="carousel-example-generic2<?php the_ID();?>" class="carousel slide" data-ride="carousel">
		              <!-- Indicators -->
		              <ol class="carousel-indicators">
		              <?php
		               global $dynamic_featured_image;$j=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				 foreach($featured_images as $images) {?>
				<?php $imageurl = $images['full'];?>				  
				  <li data-target="#carousel-example-generic2<?php the_ID();?>" data-slide-to="<?php echo $j;$j++;?>"></li>
		                 <?php } ?>
		              </ol>
		              <!-- Wrapper for slides -->
		              <div class="carousel-inner" role="listbox">
		               <?php global $dynamic_featured_image;$k=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				foreach($featured_images as $images) {$k++;?>
				<?php $imageurl = $images['full'];?>
				  <div class="item bnr <?php if($k==1){?>active<?php } ?>">
				    <img src="<?php echo $imageurl;?>" alt="">
		                </div>
				<?php } ?>                     
		              </div>
		              <!-- Controls -->
		              <a class="left carousel-control" href="#carousel-example-generic2<?php the_ID();?>" role="button" data-slide="prev">
		                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
		                <span class="sr-only">Previous</span>
		              </a>
		              <a class="right carousel-control" href="#carousel-example-generic2<?php the_ID();?>" role="button" data-slide="next">
		                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
		                <span class="sr-only">Next</span>
		              </a>
		            </div>
		          </div>          
		        </div>
		      </div>
		    </div>                 
       		 <?php if($i==2){?><div class="clearfix"></div><?php }endwhile; ?>
       		 </div>                
                    
                 </div>
              </div>
              <div role="tabpanel" class="tab-pane fade" id="messages">
              <div class="row">
              	<?php
		   $i=0;
		   query_posts( 'cat=6 &order=asc' );while ( have_posts() ) : the_post();
		   $featuredImage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full'); 
		?>
		   <div class="col-md-4 col-sm-4">
                    <div class="jet_panel">
                    <a href="" data-toggle="modal" data-target="#myModal<?php the_ID();?>"><img src="<?php echo  $featuredImage[0];?>" /></a>
                    	<div class="blk_bg">         
                            <div class="row">
                                <div class="col-md-12">
                               <?php the_title();?>
                                </div>                               
                            </div>
                             <?php the_content();?>                                                
                   	 </div>
                    </div>
                    </div>                                        
		    <div id="myModal<?php the_ID();?>" class="modal fade" role="dialog">
		      <div class="modal-dialog">
		        <div class="modal-content">
		          <div class="modal-header">
		            <button type="button" class="close" data-dismiss="modal">&times;</button>
		          </div>
		          <div class="modal-body">
		            <div id="carousel-example-generic2<?php the_ID();?>" class="carousel slide" data-ride="carousel">
		              <!-- Indicators -->
		              <ol class="carousel-indicators">
		              <?php
		               global $dynamic_featured_image;$l=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				 foreach($featured_images as $images) {?>
				<?php $imageurl = $images['full'];?>				  
				  <li data-target="#carousel-example-generic2<?php the_ID();?>" data-slide-to="<?php echo $l;$l++;?>"></li>
		                 <?php } ?>
		              </ol>
		              <!-- Wrapper for slides -->
		              <div class="carousel-inner" role="listbox">
		               <?php global $dynamic_featured_image;$m=0;
				$featured_images = $dynamic_featured_image->get_featured_images($post->ID);
				foreach($featured_images as $images) {$m++;?>
				<?php $imageurl = $images['full'];?>
				  <div class="item bnr <?php if($m==1){?>active<?php } ?>">
				    <img src="<?php echo $imageurl;?>" alt="">
		                </div>
				<?php } ?>                     
		              </div>
		              <!-- Controls -->
		              <a class="left carousel-control" href="#carousel-example-generic2<?php the_ID();?>" role="button" data-slide="prev">
		                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
		                <span class="sr-only">Previous</span>
		              </a>
		              <a class="right carousel-control" href="#carousel-example-generic2<?php the_ID();?>" role="button" data-slide="next">
		                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
		                <span class="sr-only">Next</span>
		              </a>
		            </div>
		          </div>          
		        </div>
		      </div>
		    </div>                 
       		 <?php if($i==2){?><div class="clearfix"></div><?php }endwhile; ?>
       		 </div> 
       	 </div>
	</div>              
       </div>
    </div>
  </div>
<?php get_footer();?>
 