<div class="mpez_bgr">
<h2><img src="<?=base_url()?>images/new/plus_icon.png" align="absmiddle" />&nbsp;<strong><?=$this->lang->line('categories_title')?></strong></h2>
<div style="padding:10px;">
  <div class="firstpane menu_list"> <!--Code for menu starts here-->
  			<? $uri=$this->uri->segment(1); ?>
  			<? $uri2=$this->uri->segment(2); ?>
            <? if (($uri!='products') && ($uri!='view_product') && ($uri!='product') && ($uri!='product_price') && ($uri!='product_price_new') && ($uri2!='products') && ($uri2!='view_product') && ($uri2!='product') && ($uri2!='product_price') && ($uri2!='product_price_new')) {
			$category_id='';
			} ?>
			<? $categories = $this->MFuncs->getCategories(); ?>
                <? if ($categories) { ?>
                <? //$i=1; ?>
				<? foreach($categories as $result=>$cat): ?>
                <? $sub_categories = $this->MFuncs->getSubCategories($cat['cat_id']);?>
                <? if ($sub_categories) { ?>
<?php /*?>                  <?  $string = $cat['cat_name'];
                 $string = $string.' '; ?>
              	<p class="menu_head"><?=str_replace("Σ ", "ς ", $string);?></p>
<?php */?>               	
				<p class="menu_head"><?=$cat['cat_name']?></p>
               <? if (!$category_id) { ?>
                <div class="menu_body" style="display:none">
                <? } elseif ($category_id==$cat['cat_id']) {?>
                 <div class="menu_body" style="display:block">
                <? } else { ?>
                <div class="menu_body" style="display:none">
                <? } ?>
				<? foreach($sub_categories as $sub_categories=>$sub_category): ?>

                <? $sub_subcategories = $this->MFuncs->getSubSubCategories($sub_category['sub_id']);?>
                <? if ($sub_subcategories) { ?>
               	<p class="menu_head2" style="padding:5px 0 5px 15px; margin-left:5px;"><?=$sub_category['name']?></p>
                <div class="menu_body2" style="display:none">
				<? foreach($sub_subcategories as $sub_subcategories=>$sub_subcategory): ?>
                <div class="menu_sub_links2">
                  <?=anchor("product_price/subsub/".$sub_subcategory['sub_sub_id'].'/priceasc', '- '.$sub_subcategory['name'])?>
                  </div>
                  <? //$i++; ?>
                <? endforeach ?>
                </div>
                <? } else { ?>
                  <? $qusql = "SELECT * FROM product_subcategories JOIN products ON product_subcategories.p_id=products.id WHERE product_subcategories.subcat_id=".$sub_category['sub_id']." AND products.published='Yes'";
				 $query = $this->db->query($qusql);
				 $tra = 0;
				 $tra = $query->num_rows(); 
				 if ($tra!=0) { ?>
                <div class="menu_sub_links">
                  <?=anchor("product_price/sub/".$sub_category['sub_id'].'/priceasc', $sub_category['name'])?>
                   </div>
                   <? } ?>
               <? } ?>
                  <? //$i++; ?>
                <? endforeach ?>
                </div>
                <? } else { ?>
                  <p class="menu_head"><?=anchor('product_price/cat/'.$cat['cat_id'].'/priceasc', '<b>'.$cat['cat_name'].'</b>');?></p>
                <? } ?>
    <?php /*?><img src="<?=base_url()?>images/line_diakekommeni.png" /><?php */?>
    <div style="height:5px;"></div>
                <? endforeach ?>
				<? } ?>
 	   </div>
	</div>
</div>

<? $news = $this->MFuncs->getNews(); ?>
<? if ($news) { ?>
<div style="height:5px">
</div>
<div class="green_bgr">
<h2><img src="<?=base_url()?>images/new/plus_icon.png" align="absmiddle" />&nbsp;<strong><?=$this->lang->line('news_title')?></strong></h2>
<div style="padding:10px;">
    <ul id="categories">
	<? foreach($news as $result=>$new): ?>
    <li><?=anchor('news/'.$new['id'], '<b>'.$new['title'].'</b>');?></li>
    <?php /*?><img src="<?=base_url()?>images/line_diakekommeni.png" /><?php */?>
    <div style="height:5px;"></div>
    <? endforeach ?>
	</ul>
  </div>
</div>
<? } ?>
<div style="height:15px"></div>
<div id="newsletter_bgr">
<h2><span style="color:#ffffff; padding-left:5px;"><?=$this->lang->line('text_newsletter');?></span></h2>
      <? $attributes = array('class' => 'nform','AUTOCOMPLETE'=>'off'); ?>
 	  <?=form_open('subscribe',$attributes); ?>
      <span style="font-size:12px;"><?=$this->lang->line('text_email')?></span>
    <div class="type-text">
      <? $data = array('name'=>'email','id'=>'email','value'=>'', 'size'=>'17')?>
      <?=form_input($data); ?>
    </div>
    <div class="type-button buttons" align="right" style="margin-top:5px;">
      <button type="submit" class="positive">
      <?=$this->lang->line('btn_submit')?>
      </button>
    </div>
    <br />
  <?=form_close(); ?>
</div>
<center>
    <?=anchor('name-day', img('images/giortazoun_new.jpg'));?>

</center>
<div style="height:15px"></div>
<center>
   <div class="fb-like" data-href="https://www.facebook.com/Wines2u" data-send="false" data-layout="box_count" data-width="170" data-show-faces="false" data-font="verdana"></div>
</center>