<?php 
$this->load->view('site/templates/header');
$this->load->model('product_model');
$this->load->model('user_model');
$allSub_Cat=array_merge($subCategories->result_array()); //echo '<pre>'; print_r($allSub_Cat); die;
?>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>


<div class="main">     
        
      
                
  <div class="content-wrap">
    <div id="header_menu" class="content-wrap-inner clear ">
    
        <div id="logo_inner" class="col col4">
        	<h1 class="jewely-text"><?php echo ucfirst($currentMainCategory->cat_name);?></h1>
            
            
            <div class="share-icons">
            <!--<a href="#"><span class="twitter-share-icon"></span>
                         <span class="twitter-text">Tweet</span></a>-->
           <a href="<?php echo current_url();?>" class="twitter-share-button" data-lang="en" data-count="none"><?php if($this->lang->line('shopsec_tweet') != '') { echo stripslashes($this->lang->line('shopsec_tweet')); } else echo 'Tweet'; ?></a>
            </div>
            
            
        </div>
        
       <ul id="inner-page-ul" class="col col8 col-last">
          <?php foreach($subCategories->result_array() as $subCat) {
			  if ($subCat['cat_name'] != ''){ $commentData = $this->category_model->get_all_counts($subCat['id'],''); if($commentData[0]['disp']>0){
			  ?>
         	<li class="col col2">
           		<a href="browse/<?php echo $this->uri->segment(2).'/'; echo $subCat['id'].'-'.$subCat['seourl'];?>"><?php echo ucfirst($subCat['cat_name']);?></a>
         	 </li>
             <?php } }}?>
          	
        </ul>
        
    </div>
</div>           
                
  
</div>


<div  class="purchase_review">
    	
     <div style="margin-top: 28px; max-width:1050px; left:30px;" class="main" role="main"> 
        
         <div id="container" class="clearfix">
        
       <?php if(sizeof($allSub_Cat) != 0) {?>
       	<ul class="first_look_page">
        <?php $s=1; $s1=0; foreach($allSub_Cat as $subCatList) { 
		
		if ($subCatList['cat_name'] != ''){ $commentData = $this->category_model->get_all_counts($subCatList['id'],''); if($commentData[0]['disp']>0){ $s1=1;
		
		?>
        
         <li class="box row<?php echo $s; ?>">
            <div class="banner-out">
            <div class="banner-in">
                <a class="link-addres" href="browse/<?php echo $this->uri->segment(2).'/'; echo $subCatList['id'].'-'.$subCatList['seourl']; ?>">
                <img alt="<?php echo $subCatList['cat_name']; ?>" style="width:476px;top:0px; left:0px" src="images/<?php if($subCatList['image'] != '') { echo 'category/'.$subCatList['image'];} else { echo 'dummyProductImage.jpg';} ?>" title="<?php echo $subCatList['cat_name'];?>" />
                </a>
                <!--<a class="credit" href="#"> capucinne </a>-->
            </div>
            </div>
            
            
            <div class="banner-title">
          <a  href="browse/<?php echo $this->uri->segment(2).'/'; echo $subCatList['id'].'-'.$subCatList['seourl']; ?>"><?php echo $subCatList['cat_name']; ?><span class="drop-row"></span></a>
            </div>
    </li>
    	 
    	 
    
        <?php $s++; if($s>3){ $s=1;}}  }}
			if($s1==0){ ?>
					<h2 style="text-align:center; width:100%;"><?php if($this->lang->line('seller_noprod') != '') { echo stripslashes($this->lang->line('seller_noprod')); } else echo "No Product Found"; ?></h2>
			<?php }
		 ?>
     
            </ul>
            </div> 
          <?php }  else {?>
          <h2><?php if($this->lang->line('list_subcate') != '') { echo stripslashes($this->lang->line('list_subcate')); } else echo 'No SubCategories Found'; ?>!</h2>
		  <?php }?>
          
        
       </div> 
    </div>

<div class="main">

<div id="footer-divider">
            
            <ul class="footer-menus">
                <li class="blocker"> <?php if($this->lang->line('user_follow') != '') { echo stripslashes($this->lang->line('user_follow')); } else echo 'Follow'; ?> <?php echo $this->config->item('email_title'); ?> </li>
                <li><a class="icons1" href="<?php echo $this->config->item('facebook_link'); ?>" target="_blank"><?php if($this->lang->line('user_facebook') != '') { echo stripslashes($this->lang->line('user_facebook')); } else echo 'Facebook'; ?></a></li>
                <li><a class="icons3" href="<?php echo $this->config->item('twitter_link'); ?>" target="_blank"><?php if($this->lang->line('comm_twitter') != '') { echo stripslashes($this->lang->line('comm_twitter')); } else echo 'Twitter'; ?></a></li>
                <li><a class="icons4" href="<?php echo $this->config->item('pinterest'); ?>" target="_blank"><?php if($this->lang->line('comm_pininterest') != '') { echo stripslashes($this->lang->line('comm_pininterest')); } else echo 'Pintrest'; ?></a></li>
            </ul>
            
            
            <ul class="footer-menus1 col col8 col-last">
            
            
            
                        <?php  foreach ($this->data['mainCategories']->result() as $row){
							if ($row->cat_name != ''){ $commentData = $this->category_model->get_all_counts($row->id,''); if($commentData[0]['disp']>0){
							$cur_catid=explode('-',$this->uri->segment(2));	
							if($cur_catid[0] == $row->id) {
                      	?>
                        <span>
                        <a href="category-list/<?php echo $row->id;?>-<?php echo $row->seourl;?>"><?php echo $row->cat_name;?></a>
                      </span>
                      <?php 
                      	}}   }  }
						
				foreach($subCategories->result() as $catList) {
				    ?> 
                    
            <li class="col col2">
                <a href="browse/<?php echo $this->uri->segment(2).'/'; echo $catList->id.'-'.$catList->seourl;?>"><?php echo ucfirst($catList->cat_name);?></a>
                 
            </li>
            <?php }?>
                     
                  
                  </ul>        
		
           
                 <ul class="footer-menus2">
               
           <?php  foreach ($this->data['mainCategories']->result() as $row){
							if ($row->cat_name != ''){ $commentData = $this->category_model->get_all_counts($row->id,''); if($commentData[0]['disp']>0){
							$cur_catid=explode('-',$this->uri->segment(2));	
							if($cur_catid[0] != $row->id) {
                      	?>
                        <li class="blocker2">
                        <a href="category-list/<?php echo $row->id;?>-<?php echo $row->seourl;?>"><?php echo $row->cat_name;?></a>
                      </li>
          <?php }} } }?>
            </ul>
            
            </div>

</div>

<script src="js/site/jquery.masonry.min.js"></script>
<script>
$( document ).ready(function() {
    $('#container').masonry({
      itemSelector: '.box', 
      columnWidth: 51
    });
	/*if($("#chekit").val() == 'cat'){ 
	 window.location.href=baseURL+"category-list/<?php //echo $this->uri->segment(2);?>?ref=cats";
	}*/ 
});  
</script>
<?php $this->load->view('site/templates/footer'); ?>
