        <?=$this->tinyMce?>
<center><h3><?=$title?></h3></center>
      <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>
<div>
       <h2>Web Site Keywords</h2>
       <? 	$keywords = $this->MAdmins->getKeywords(); ?>
<? if ($keywords) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <tbody>
        <tr>
          <th scope="col">Keywords</th>
          <th scope="col">Ενέργειες</th>
        </tr>
        <? if ($edit_key==true) { ?>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/update_keywords/'.$keywords['id'], $attributes); ?>
        <tr>
          <td><?  echo "<label for='keywords'></label>";
		$data = array('name'=>'keywords','id'=>'keywords','size'=>'150', 'value' => $keywords['keywords']);
echo form_input($data) .""; ?>
		</td>
        <td><? echo form_submit('submit','update keywords')?><br /><?=anchor("admin/categories/settings", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? } else { ?>
        <tr>
          <td>
		   <?=$keywords['keywords']?>
           </td>
          <td><?=anchor("admin/categories/edit_keywords/".$keywords['id'], 'Επεξεργασία εγγραφής')?></td>
      </tr>
      <? } ?>
      </tbody>
    </table>
<?    } ?>
          </div>
<div>
       <h2>Categories</h2>
          <? if ($add_cat==false) { ?>
          <h4><?=anchor("admin/categories/add_category", 'Προσθήκη νέας κατηγορίας')?></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>
          <th scope="col">Ενέργειες</th>
        </tr>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/add_category', $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>
        <? echo "<p><label for='home_page'></label>";
			$options = array('Yes' => 'Yes', 'No' => 'No');
			echo form_dropdown('home_page',$options, 'No') ."</p>"; ?>
		</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/settings", 'Ακύρωση')?></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>
          <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_category/'.$category['id'].'/'.$category['cat_id'],$attributes); ?>
        <tr>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $category_name = $this->MAdmins->getCategoriesbyLang($category['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['cat_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>        <? echo "<p><label for='home_page'></label>";
			$options = array('Yes' => 'Yes', 'No' => 'No');
			echo form_dropdown('home_page',$options, $category['home_page']) ."</p>"; ?>
</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/settings", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? } else { ?>
        <tr>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <? $category_name = $this->MAdmins->getCategoriesbyLang($category['cat_id'], $language['lang_id']); ?>
		   <?=$category_name['cat_name']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
		   <?=$category['order']?><br /><? } ?></td>
           <td><?=$category['home_page']?></td>
        <td>
        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <?=$language['lang_name']?>
        <br />
		<? }  ?>
		</td>
          <td><?=anchor("admin/categories/edit_category/".$category['id'], 'Επεξεργασία εγγραφής')?><Br /><?=anchor("admin/categories/view_category/".$category['cat_id'], 'Υπο-κατηγορία/ες')?><Br /><?=anchor("admin/categories/delete_category/".$category['cat_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?></td>
      </tr>
       <? }
	   } ?>
      </tbody>
    </table>
<?    } ?>
          </div>
<div>
       <h2>News</h2>
          <? if ($add_new==false) { ?>
          <h4><?=anchor("admin/categories/add_new", 'Προσθήκη νέου')?></h4>
          <? } ?>
<? if ($add_new==true) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">News</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <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_new', $attributes); ?>
        <tr>
          <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='description'></label>";
$data = array('name'=>'description'.$language['lang_id'],'id'=>'description'.$language['lang_id'],'rows'=>'15', 'cols'=>'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 new')?><br /><?=anchor("admin/categories/settings", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? if (!$news) { ?>
      </tbody>
    </table>
    <? } ?>
<?    } ?>
<? if ($news) { ?>
<? if ($add_new==false) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">News</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="col">Τίτλος</th>
          <th scope="col">Κείμενο</th>
          <th scope="col">Σειρά</th>
          <th scope="col">Γλώσσα</th>
          <th scope="col">Ενέργειες</th>
        </tr>
        <? } ?>
        <? foreach($news as $news=>$new){ ?>
        <? if (($edit_new==true) && ($new['id']==$edit_id)) { ?>
            <? $attributes = array('class' => 'nform'); ?>
		    <?=form_open('admin/categories/update_new/'.$new['id'].'/'.$new['new_id'],$attributes); ?>
        <tr>
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
                    <?  echo "<label for='title'></label>";
		$data = array('name'=>'title'.$language['lang_id'],'id'=>'title'.$language['lang_id'],'rows'=>'15', 'cols'=>'15',  'value' => $new_name['title']);
echo form_input($data) .""; ?>
<br />
<? } ?>
		</td>
		<td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
                    <?  echo "<label for='description'></label>";
		$data = array('name'=>'description'.$language['lang_id'],'id'=>'description'.$language['lang_id'],'size'=>15,  'value' => $new_name['longdesc']);
echo form_textarea($data) .""; ?>
<br />
<? } ?>
		</td>        
          <td> <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
                    <?  echo "<label for='order'></label>";
		$data = array('name'=>'order'.$language['lang_id'],'id'=>'order'.$language['lang_id'],'rows'=>'15', 'cols'=>'15',  'value' => $new_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 new')?><br /><?=anchor("admin/categories/settings", 'Ακύρωση')?></td>
       </tr>
       <? echo form_close(); ?>
       <? } else { ?>
        <tr>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
		   <?=$new_name['title']?><br /><? } ?></td>
			<td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
		   <?=$new_name['longdesc']?><br /><? } ?></td>
          <td>
		   <? 	$languages = $this->MAdmins->getLanguages();
			foreach($languages as $languages=>$language){ ?>
            		   <? $new_name = $this->MAdmins->getNewsbyLang($new['new_id'], $language['lang_id']); ?>
		   <?=$new_name['order']?><br /><? } ?></td>
        <td>        <? $languages = $this->MAdmins->getLanguages();
		foreach($languages as $languages=>$language){ ?>
        <?=$language['lang_name']?>
        <br />
		<? }  ?>
		</td>
          <td><?=anchor("admin/categories/edit_new/".$new['id'], 'Επεξεργασία εγγραφής')?><?php /*?><Br /><?=anchor("admin/categories/view_category/".$category['cat_id'], 'Υπο-κατηγορία/ες')?><?php */?><Br /><?=anchor("admin/categories/delete_new/".$new['new_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?></td>
      </tr>
       <? }
	   } ?>
      </tbody>
    </table>
<?    } ?>
          </div>