<div class="row-fluid">
    <p><?php 
        if($this->session->userdata('edita') == 1)
        echo anchor('catalogosweb/ean_nuevo/','Nuevo articulo'); ?></p>
    <div class="span12">
                                            
        <?php echo $this->pagination->create_links(); ?>
        
        <table class="table table-condensed table-hover">
            <caption>Registros: <?php echo $query->num_rows(); ?></caption>
            <thead>
                <tr>
                    <th>Tipo</th>
                    <th>Clave</th>
                    <th>Descripcion</th>
                    <th>Ean</th>
                    <th>Nombre comercial</th>
                    <th>Marca</th>
                    <th colspan="2">
                        &nbsp;
                    </th>                                                
                </tr>
            </thead>
            <tbody>
                <?php                                             
                    
                foreach($query->result() as $row){                                       
                
                ?>
                <tr>
                    <td><?php echo $row->suministro; ?></td>
                    <td><?php echo $row->cvearticulo; ?></td>                    
                    <td><?php echo $row->descripcion; ?></td>
                    <td><?php echo $row->ean; ?></td>
                    <td><?php echo $row->comercial; ?></td>
                    <td><?php echo $row->marca; ?></td>

                    <?php
                    if($this->session->userdata('edita') == 1)
                    {
                    ?>
                        <td width="10px">
                            <?php if($row->activo == 1) echo anchor('catalogosweb/ean_edita/'.$row->ean, 'Editar', array('class' => "btn btn-warning btn-sm")); ?>                            
                            
                        </td>                    

                        <td width="10px">
                            <?php if($row->activo == 0) echo anchor('catalogosweb/ean_activa/'.$row->ean, 'Activar', array('class' => "btn btn-primary btn-sm")); ?>

                            <?php if($row->activo == 1) echo anchor('catalogosweb/ean_desactiva/'.$row->ean, 'Eliminar', array('class' => "btn btn-danger btn-sm")); ?>
                            
                        </td>
                    <?php
                    }
                    ?>
                </tr>
                <?php 
                
                
                }
                
                
                ?>
            </tbody>
        </table>
        
	</div>	
</div>
