<div class="table-responsive">
	
    <table class="table table-bordered table-striped table-hover table-condensed">
        <thead>
            <tr>
                <td colspan="6">
                    

                    <?php echo $this->paginationControl( $this->list ); ?>
                </td>
            </tr>
            <tr>
                <th><?php echo $this->translate( '#name#' ); ?></th>
                <th><?php echo $this->translate( '#email#' ); ?></th>
                <th><?php echo $this->translate( '#subject#' ); ?></th>
                <th><?php echo $this->translate( '#to#' ); ?></th>
                <th><?php echo $this->translate( '#date#' ); ?></th>
                <th></th>
            </tr>
            <form id="searchForm">
            <tr class="search-row">
            	<td><?= $this->formText('name',$this->search['name'],array('style'=>'width:96%'))?></td>
            	<td><?= $this->formText('email',$this->search['email'],array('style'=>'width:96%'))?></td>
            	<td><?= $this->formText('subject',$this->search['subject'],array('style'=>'width:96%'))?></td>
            	<td><?= $this->formText('to',$this->search['to'],array('style'=>'width:96%'))?></td>
            	<td><?= $this->formText('date',$this->search['email'],array('style'=>'width:96%','class'=>'date'))?></td>
            	<td>
                    <span class="btn-group">
                        
                    <button class="btn btn-default" title="<?= $this->translate('#search#') ?>"><i class="fa fa-search"></i></button>
                    <a href="<?= $this->url(array('format'=>'xls')) ?>" class="btn btn-default" title="Télécharger Version Excell"><i class="fa fa-download"></i></a>
                    </span>
                </td>
            </tr>
            </form>
        </thead>

        <tbody>
<?php   
		if ( count( $this->list ) ) {
			foreach ( $this->list as $item ) { ?>
            <tr>
                <td><?= $item->firstname. ' ' . $item->name ?></td>
                <td><?= $item->email; ?></td>
                <td><?= $item->subject; ?></td>
                <td><?= $item->to; ?></td>
                <td><?php $d=new Zend_Date($item->date); echo $d->get(Zend_Date::DATE_MEDIUM); ?></td>
                <td class="actions">
                    <span class="btn-group">
                        
                        <a href="<?php echo $this->url( array( 'action' => 'view', 'id' => $item->id ) ); ?>" class="view btn btn-default" title="<?php echo $this->translate( '#view#' ); ?>">
                            <span class="fa fa-eye"></span>
                            
                        </a>

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

        <tfoot>
            <tr>
                <td colspan="6">
                    

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



<?php $this->inlineScript()->captureStart(); ?>
jQuery(function(){
	
	
	$('td.actions a.view').click(function(e){
		e.preventDefault();
		$.get($(this).attr('href'),function(data){

            bootbox.alert(data);

		})
	});
	
    $('td.actions a.delete').click(function(e){
        e.preventDefault();
        var lnk = this;

        bootbox.confirm("<?= $this->translate('#Are you sure you want to permanently delete this?#') ?>", function(result) {
          $.post( $(lnk).attr('href'),{confirm:1},function(data){
                        if(data.success){
                            $(lnk).parents('tr').effect('fade');
                        }
                        FlashMessenger.refreshMessages();
                        $('#delete-dialog').dialog( "close" );
                    },'json' );
        }); 

    });
	
	
	
});
<?php $this->inlineScript()->captureEnd();
