Is this correct? Or am I overloading the responsibilities of the view?
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Estado</th>
<th>Prioridad</th>
<th>Responsable</th>
<th>Categoría</th>
<th>Solicitud</th>
<th>Creado</th>
<th>Cerrado</th>
</tr>
</thead>
<tbody>
<?php
$class = '';
$label = '';
foreach ($solicitud as $key => $value) {
if( $value['priority'] > 0 && $value['priority'] < 4 ) $class = 'badge-important';
if( $value['priority'] > 4 && $value['priority'] < 7 ) $class = 'badge-info';
if( $value['priority'] > 7 ) $class = 'badge-warning';
if( $value['id'] == 1 ) $label = 'label-info';
if( $value['id'] == 2 ) $label = 'label-success';
if( $value['id'] == 3 ) $label = 'label-danger';
echo '<tr>';
echo ' <td><span class="label label-sm '.$label.'">'.ucfirst($value['status']).'</span></td>';
echo ' <td><span class="badge '.$class.' ">'.$value['priority'].'</span></td>';
echo ' <td>'.$value['sname'].' '.$value['last_name'].'</td>';
echo ' <td>'.$value['name'].'</td>';
echo ' <td>'.$value['message'].'</td>';
echo ' <td>'.$value['created'].'</td>';
echo '<td>'.(( $value['closed'] ) ? $value['closed'] : 'pendiente').'</td>';
echo '</tr>';
} ?>
</tbody>
</table>