        <?=$this->tinyMce?>
<center><h3><?=$title?></h3></center>
      <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>
<div>
       <h2>Κατηγορίες "Οινοτουρισμού"</h2>
          <? if ($add_cat==false) { ?>
          <h4><?=anchor("admin/categories/add_right_cat", 'Προσθήκη νέας κατηγορίας')?></h4>
          <? } ?>
<? if ($add_cat==true) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Categories</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <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_cat', $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='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 category')?><br /><?=anchor("admin/categories/right_cat", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? if (!$categories) { ?>
      </tbody>
    </table>
    <? } ?>
<?    } ?>
<? if ($categories) { ?>
<? if ($add_cat==false) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Categories</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="col">Όνομα</th>
          <th scope="col">Σειρά</th>
          <th scope="col">Γλώσσα</th>
          <th scope="col">Ενέργειες</th>
        </tr>
        <? } ?>
        <? foreach($categories as $categories=>$category){ ?>
        <? if (($edit_cat==true) && ($category['id']==$edit_id)) { ?>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/update_right_cat/'.$category['id'].'/'.$category['right_cat_id'],$attributes); ?>
        <tr>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $category_name = $this->MAdmins->getRightCategoriesbyLang($category['right_cat_id'], $language['lang_id']); ?>
                    <?  echo "<label for='name'></label>";
		$data = array('name'=>'name'.$language['lang_id'],'id'=>'name'.$language['lang_id'],'size'=>15,  'value' => $category_name['name']);
echo form_input($data) .""; ?>
<br />
<? } ?>
		</td>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
                    <?  echo "<label for='order'></label>";
		$data = array('name'=>'order'.$language['lang_id'],'id'=>'order'.$language['lang_id'],'size'=>15,  'value' => $category['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 category')?><br /><?=anchor("admin/categories/right_cat", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? } else { ?>
        <tr>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $category_name = $this->MAdmins->getRightCategoriesbyLang($category['right_cat_id'], $language['lang_id']); ?>
		   <?=$category_name['name']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <?=$category['order']?><br /><? } ?></td>
        <td>
        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <?=$language['lang_name']?>
        <br />
		<? }  ?>
		</td>
          <td><?=anchor("admin/categories/edit_right_cat/".$category['id'], 'Επεξεργασία εγγραφής')?><br /><Br /><?=anchor("admin/categories/view_right_category/".$category['right_cat_id'], 'Υπο-κατηγορία/ες - Κείμενα')?><Br /><br /><?=anchor("admin/categories/delete_right_cat/".$category['right_cat_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?></td>
      </tr>
       <? }
	   } ?>
      </tbody>
    </table>
<?    } ?>
          </div>