<center><h3><?=$title?></h3></center>
      <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>
                  <div class="subcolumns">
        <div class="c50l">
          <div class="subcl">
    <h4><?=anchor("admin/categories/add_company", 'Προσθήκη νέας εταιρίας')?></h4>
              </div>
        </div>
        <div class="c50r">
          <div class="subcr">
<?php /*?><? $attributes=array('class'=>'search-form', 'autocomplete'=>'off');?>
<? $data = array("name" => "term", "id" => "term", "maxlength" => "128", 'id'=>'masthead-search-term', 'class'=>'search-term');?>
<div id="masthead-search">
	<?=form_open("admin/categories/search_hotel",$attributes); ?>
    <?="Seach Hotels"?>
    <?=form_input($data);?>
    <input id="submit" type="submit" value="Search" name="submit" class="yt-button yt-button-primary"/>
	<?=form_close();?>
</div>
<?php */?>    </div>
  </div>
</div>
<br />
<? if ($search==false) { ?>
<? if ($companies) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Current Content</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($companies as $companies=>$company){ ?>
        <? //$company_details = $this->MAdmins->getHotelDetailsUnique($hotel['h_id']); ?>
        <? $categories = $this->MAdmins->getCompanyCategories($company['cmp_id']); ?>
        <tr>
          <td><a  title="<?=$company['cmp_name']?>"  href="<?=base_url().'images/cmps/'.$company['cmp_image']?>" rel="shadowbox[];options={counterType:'skip',continuous:true,animSequence:'sync'}"> <img class="center" src="<?=base_url().'images/cmps/thumb/'.$company['cmp_image']?>" style="max-width:120px; max-height:200px;" /> </a></td>
          <td><?=$company['cmp_name']?></td>
          <td><?=$company['cmp_description']?></td>
          <td><? foreach($categories as $categories=>$category){ ?>
           <? $category_name = $this->MAdmins->getCategoryName($category['cat_id'], 1); ?>
		  <?=$category_name['cat_name']?><br />
          <? } ?></td>
          <td><?=anchor("admin/categories/view_company/".$company['cmp_id'], 'Προβολή εταιρίας')?><br /><?=anchor("admin/categories/delete_company/".$company['cmp_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?></td>
       </tr>
       <? } ?>
      </tbody>
    </table>
<?    } ?>
<? } elseif ($search==true) { ?>
<? if ($companies) { ?>
    <table cellspacing="0" cellpadding="0" border="1" class="full">
      <thead>
        <tr>
          <th colspan="100%" scope="col">Current Content</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($companies as $companies=>$company){ ?>
        <? $categories = $this->MAdmins->getCompanyCategories($company['cmp_id']); ?>
        <tr>
          <td><a  title="<?=$company['cmp_name']?>"  href="<?=base_url().'images/cmps/'.$company['cmp_image']?>" rel="shadowbox[];options={counterType:'skip',continuous:true,animSequence:'sync'}"> <img class="center" src="<?=base_url().'images/cmps/thumb/'.$company['cmp_image']?>" style="max-width:120px; max-height:200px;" /> </a></td>
          <td><?=$company['cmp_name']?></td>
          <td><?=$company['cmp_description']?></td>
          <td><? foreach($categories as $categories=>$category){ ?>
           <? $category_name = $this->MAdmins->getCategoryName($category['cat_id'], 1); ?>
		  <?=$category_name['cat_name']?><br />
          <? } ?></td>
          <td><?=anchor("admin/categories/view_hotel/".$hotel['h_id'], 'Προβολή ξενοδοχείου')?><br /><?=anchor("admin/categories/delete_company/".$company['cmp_id'],  'Διαγραφή εγγραφής', array( 'onclick'=>'return confirm(\''.'Είστε σίγουροι πως θέλετε να προχωρήσετε στη διαγραφή?'.'\');', 'title' => '','class' => ''))?></td>
       </tr>
       <? } ?>
      </tbody>
    </table>
<?    } ?>
<? } ?>