Ver Mensaje Individual
  #7 (permalink)  
Antiguo 12/11/2015, 05:53
javierconesa23
 
Fecha de Ingreso: febrero-2011
Ubicación: Barcelona
Mensajes: 195
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: convertir resultado en un icono

me han ayudado por ahi:
Código PHP:
Ver original
  1. echo '<table class="table  table-bordered table-striped datatable"  id="table-2">';
  2. echo    '<thead>';
  3. echo        '<tr class="success" >';
  4. echo            '<th>Contrato</th>';
  5. echo            '<th>Cliente</th>';
  6. echo            '<th>Matricula Tractora</th>';
  7. echo            '<th>DNI PASAPORTE</th>';
  8. echo            '<th>Matricula Remolque</th>';
  9. echo            '<th>Nombre</th>';
  10. echo            '<th>Estado</th>';  
  11. echo        '</tr>';
  12. echo    '</thead>';
  13. function muestraEstado($estado)
  14. {
  15.     if($estado === 'Confirmada') {
  16.         echo '<button type="button" class="btn btn-success">
  17.            <i class="entypo-check"></i>
  18.        </button>';
  19.     } else {
  20.         echo $estado;
  21.     }
  22. }
  23.  
  24. if (is_array($distribuciones)) {
  25.  foreach($distribuciones as $distrib) {
  26.  
  27.  echo ' <tbody>
  28.        <tr>
  29.            <td>'.$distrib->Contrato.'</td>
  30.            <td>'.$distrib->Cliente.'</td>
  31.            <td>'.$distrib->Matricula_tractora.'</td>
  32.            <td>'.$distrib->DNI_conductor.'</td>
  33.            <td>'.$distrib->Matricula_remolque.'</td>
  34.            <td>'.$distrib->Nombre_conductor.'</td>
  35.            <td>'.muestraEstado($distrib->Estado).'</td>
  36.            </tr>';        
  37.  
  38.   }    
  39. }
  40. echo '</table>';

gracias de todas formas como siempre