Ok Gracias!!!! perfecto
Código PHP:
Ver originalecho '<table class="table table-bordered table-striped datatable" id="table-2">';
echo '<thead>';
echo '<tr>';
echo '<th>';
echo '<div class="checkbox checkbox-replace">';
echo '<input type="checkbox" id="chk-1">';
echo '</div>';
echo '</th>';
echo '<th>Contrato</th>';
echo '<th>Cliente</th>';
echo '<th>Matricula</th>';
echo '<th>DNI PASAPORTE</th>';
echo '<th>Matricula Remolque</th>';
echo '<th>Nombre</th>';
echo '</tr>';
echo '</thead>';
foreach($distribuciones as $distrib) {
echo ' <tbody>
<tr>
<td>
<div class="checkbox checkbox-replace">
<input type="checkbox" id="chk-1">
</div>
</td>
<td>'.$distrib->Contrato.'</td>
<td>'.$distrib->Cliente.'</td>
<td>'.$distrib->Matricula_tractora.'</td>
<td>'.$distrib->DNI_conductor.'</td>
<td>'.$distrib->Matricula_remolque.'</td>
<td>'.$distrib->Nombre_conductor.'</td>
<td>
<a href="#" class="btn btn-default btn-sm btn-icon icon-left">
<i class="entypo-pencil"></i>
Edit
</a>
<a href="#" class="btn btn-danger btn-sm btn-icon icon-left">
<i class="entypo-cancel"></i>
Delete
</a>
<a href="#" class="btn btn-info btn-sm btn-icon icon-left">
<i class="entypo-info"></i>
Profile
</a>
</td>
</tr>';
}
}
?>
Pero una ultima pregunta porque si n despues del primer foreach cambio a variables mas cortas con:
Código PHP:
Ver original$ndistri = $distrib->Num_autorizacion;
$clientes = $distrib->Cliente;
$matriculat = $distrib->Matricula_tractora;
$matricular = $distrib->Matricula_remolque;
$dni = $distrib->DNI_conductor;
$namedriver = $distrib->Nombre_conductor;
$fecha = $distrib->Fecha;
$hora = $distrib->Hora;
$estado = $distrib->Estado;
$contrato = $distrib->Contrato;
y si llamo alos contratos por la variable corta me 3 registros del mismo contrato
Ej con: $distrib->Contrato
Contrato Cliente Matricula DNI PASAPORTE Matricula Remolque Nombre
80317048-10 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
80317048-10 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
Ejemplo con $contrato:
Contrato Cliente Matricula DNI PASAPORTE Matricula Remolque Nombre
80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran Edit Delete Profile
Gracias de todas formas por tu ayuda prestada: