<?php
		//	Zend_Debug::dump($this);
	//		die;
?>
<table class="table table-striped table-bordered table-condensed table-rounded">
        <thead>
        	<tr>
                <td colspan="5">
                    <span class="pull-right">
                        <a href="<?php echo $this->url( array( 'action' => 'save' ) ); ?>" class="btn btn-primary btn-large">
                            <span class="fa fa-plus"></span>
                            <?php echo $this->translate( '#create#' ); ?>
                        </a>
                    </span>

                    <?php echo $this->paginationControl( $this->paginator ); ?>
                </td>
            </tr>
            <tr>
                <th width="60"><?php echo $this->translate( '#id#' ); ?></th>
                <th><?php echo $this->translate( '#name#' ); ?></th>
                <th><?php echo $this->translate( '#image#' ); ?></th>
                <th width="120"><?php echo $this->translate( '#dateAdd#' ); ?></th>
                <th width="120"></th>
            </tr>
            <form id="searchForm">
            <tr class="search-row">
            	<td><?= $this->formText('id',$this->search['id'],array('style'=>'width:96%'))?></td>
            	<td><?= $this->formText('name',$this->search['name'],array('style'=>'width:96%'))?></td>
            	<td></td>            	
            	<td></td>
            	<td><?= $this->formSubmit('search','#search#', array('class'=>'btn btn-default'))?></td>
            </tr>
            </form>
        </thead>

        <tbody>
        <?php 
        if( $this->paginator ):
        foreach ($this->paginator as $entry) : ?>
        <tr>
            <td><?= $entry->id ?></td>
            <td><?= $entry->name ?></td>
            <td><?php 
               if($entry->imageExists()){
                   echo $this->htmlImage($entry->getThumbnail(), array('style' =>  'max-height:75px;'));
               } ?></td>
             
            <td><?= $entry->date('dateAdd')->get(Zend_Date::DATE_MEDIUM); ?></td>
            <td class="actions">
                <a href="<?php echo $this->url( array( 'action' => 'save', 'id' => $entry->id ) ); ?>" class="btn btn-default btn-small" title="<?= $this->translate( '#edit#' ) ?>">
                    <i class="fa fa-pencil"></i>
                </a>

                <a href="<?php echo $this->url( array( 'action' => 'delete', 'id' => $entry->id ) ); ?>" class="btn btn-small btn-danger action delete" title="<?= $this->translate( '#delete#' ) ?>">
                    <i class="fa fa-trash-o"></i>
                </a>
            </td>
        </tr>
        <?php endforeach; ?>
        <?php else: ?>
        <tr><td colspan="5"><?php echo $this->translate( '#this list is empty#' ); ?></td></tr>
    <?php endif; ?>
        </tbody>

        <tfoot>
            <tr>
                <td colspan="5">
                    <span class="pull-right">
                        <a href="<?php echo $this->url( array( 'action' => 'save' ) ); ?>" class="btn btn-primary btn-large">
                            <span class="fa fa-plus"></span>
                            <?php echo $this->translate( '#create#' ); ?>
                        </a>
                    </span>

                    <?php echo $this->paginationControl( $this->paginator ); ?>
                </td>
            </tr>
        </tfoot>
    </table>
