        <?=$this->tinyMce?>
<center><h3><?=$title?></h3></center>
      <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>
          <h2>Sub-Categories for: <?=$category['name']?></h2>
          <? if ($add_subcat==false) { ?>
          <h4><?=anchor("admin/categories/add_right_category/".$category['id'], 'Προσθήκη νέας υπο-κατηγορίας')?></h4>
          <? } ?>
<? if ($add_subcat==true) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Sub-Categories</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="col">Link</th>
          <th scope="col">Τίτλος</th>
          <th scope="col">Κείμενο</th>
          <th scope="col">Σειρά</th>
          <th scope="col">Γλώσσα</th>
          <th scope="col">Ενέργειες</th>
        </tr>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/add_right_category/'.$category['right_cat_id'], $attributes); ?>
        <tr>
          <td>
                      <? $languages = $this->MAdmins->getLanguages();
					  foreach($languages as $languages=>$language){ ?>
        <?  echo "<p><label for='name'></label>";
		$data = array('name'=>'name'.$language['lang_id'],'id'=>'name'.$language['lang_id'],'size'=>15);
echo form_input($data) ."</p>"; ?>
<br />
<? } ?>
		</td>
          <td>
                      <? $languages = $this->MAdmins->getLanguages();
					  foreach($languages as $languages=>$language){ ?>
        <?  echo "<p><label for='title'></label>";
		$data = array('name'=>'title'.$language['lang_id'],'id'=>'title'.$language['lang_id'],'size'=>15);
echo form_input($data) ."</p>"; ?>
<br />
<? } ?>
		</td>
          <td>
                  <? $languages = $this->MAdmins->getLanguages();
                   foreach($languages as $languages=>$language){ ?>
        <?  echo "<p><label for='content'></label>";
		$data = array('name'=>'content'.$language['lang_id'],'id'=>'content'.$language['lang_id'],'size'=>15);
echo form_textarea($data) ."</p>"; ?>
<br />
<? } ?>
		</td>
          <td>
                      <? $languages = $this->MAdmins->getLanguages();
					  foreach($languages as $languages=>$language){ ?>
        <?  echo "<p><label for='order'></label>";
		$data = array('name'=>'order'.$language['lang_id'],'id'=>'order'.$language['lang_id'],'size'=>15);
echo form_input($data) ."</p>"; ?>
<br />
<? } ?>
		</td>
        <td>
        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <? echo "<p>".$language['lang_name']."</p>"; ?>
        <br />
		<? }  ?>
		</td>
        <td><? echo form_submit('submit','add sub category')?><br /><?=anchor("admin/categories/view_right_category/".$category['right_cat_id'], 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? if (!$subcategories) { ?>
      </tbody>
    </table>
    <? } ?>
<?    } ?>
<? if ($subcategories) { ?>
<? if ($add_subcat==false) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Sub-Categories</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="col">Link</th>
          <th scope="col">Τίτλος</th>
          <th scope="col">Κείμενο</th>
          <th scope="col">Σειρά</th>
          <th scope="col">Γλώσσα</th>
          <th scope="col">Ενέργειες</th>
        </tr>
        <? } ?>
        <? foreach($subcategories as $subcategories=>$subcategory){ ?>
        <? if (($edit_subcat==true) && ($subcategory['s_id']==$edit_id)) { ?>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/update_right_category/'.$category['id'].'/'.$subcategory['sub_id'],$attributes); ?>
        <tr>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
                    <?  echo "<label for='name'></label>";
		$data = array('name'=>'name'.$language['lang_id'],'id'=>'name'.$language['lang_id'],'size'=>15,  'value' => $subcategory_name['name']);
echo form_input($data) .""; ?>
<br />
<? } ?>
		</td>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
                    <?  echo "<label for='title'></label>";
		$data = array('name'=>'title'.$language['lang_id'],'id'=>'title'.$language['lang_id'],'size'=>15,  'value' => $subcategory_name['title']);
echo form_input($data) .""; ?>
<br />
<? } ?>
		</td>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
                    <?  echo "<label for='content'></label>";
		$data = array('name'=>'content'.$language['lang_id'],'id'=>'content'.$language['lang_id'],'size'=>15,  'value' => $subcategory_name['content']);
echo form_textarea($data) .""; ?>
<br />
<? } ?>
		</td>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
                    <?  echo "<label for='order'></label>";
		$data = array('name'=>'order'.$language['lang_id'],'id'=>'order'.$language['lang_id'],'size'=>15,  'value' => $subcategory_name['order']);
echo form_input($data) .""; ?>
<br />
<? } ?>
		</td>
        <td>
        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <?=$language['lang_name']?>
        <br />
        <? } ?>
		</td>
        <td><? echo form_submit('submit','update sub-category')?><br /><?=anchor("admin/categories/view_right_category/".$category['id'], 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? } else { ?>
        <tr>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
		   <?=$subcategory_name['name']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
		   <?=$subcategory_name['title']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
		   <?=$subcategory_name['content']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $subcategory_name = $this->MAdmins->getRightSubCategoriesbyLang($subcategory['sub_id'], $language['lang_id']); ?>
		   <?=$subcategory_name['order']?><br /><? } ?></td>
        <td>
        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <?=$language['lang_name']?>
        <br />
		<? }  ?>
		</td>
          <td><?=anchor("admin/categories/edit_right_category/".$category['id'].'/'.$subcategory['sub_id'], 'Επεξεργασία εγγραφής')?><Br /><?=anchor("admin/categories/delete_right_category/".$category['id'].'/'.$subcategory['sub_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?>
      </tr>
       <? }
	   } ?>
      </tbody>
    </table>
<?    } else {?>
<h5>Δεν υπάρχουν υπο-κατηγορίες</h5>
<? } ?> 
          <h4><?=anchor("admin/categories/right_cat", 'Επιστροφή στις κατηγορίες Οινοτουρισμού')?></h4>