Asi lo he heecho pero no me da registros completos solo el primero y lo repite tantas veces como registros hay.
Código PHP:
Ver original
foreach($distribuciones as $distrib) {
echo $distrib->Num_autorizacion . ' | ';
echo $distrib->Cliente . ' | ';
echo $distrib->Contrato. ' | ';
echo $distrib->Matricula_tractora . ' | ';
echo $distrib->DNI_conductor . ' | ';
echo $distrib->Fecha . ' | ';
echo $distrib->Hora . ' | ';
echo $distrib->Estado . ' | ';
echo $distrib->Producto ;
echo '<br>';
echo PHP_EOL;
}
}
$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;
/* else {
echo $distribuciones->Num_autorizacion . PHP_EOL;
} */
//sleep(3);
echo 'Respuesta en ';
echo time() - $timeIni . ' segundos' ; echo $distrib->Num_autorizacion;
echo '<br>';
echo PHP_EOL;
echo '<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>';
echo '<tbody>';
echo '<tr>';
echo '<td>';
echo '<div class="checkbox checkbox-replace">';
echo '<input type="checkbox" id="chk-1">';
echo '</div>';
echo '</td>';
foreach($distribuciones as $distrib) {
echo '<td>'.$contrato.'</td>';
echo '<td>'.$clientes.'</td>';
echo '<td>'.$matriculat.'</td>';
echo '<td>'.$dni.'</td>';
echo '<td>'.$matricular.'</td>';
echo '<td>'.$namedriver.'</td>';
}
}
echo '<td>';
echo '<a href="#" class="btn btn-default btn-sm btn-icon icon-left">';
echo '<i class="entypo-pencil"></i>';
echo 'Edit';
echo '</a>';
echo '<a href="#" class="btn btn-danger btn-sm btn-icon icon-left">';
echo '<i class="entypo-cancel"></i>';
echo 'Delete';
echo '</a>';
echo '<a href="#" class="btn btn-info btn-sm btn-icon icon-left">';
echo '<i class="entypo-info"></i>';
echo 'Profile';
echo '</a>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<div class="checkbox checkbox-replace">';
echo '<input type="checkbox" id="chk-1">';
echo '</div>';
echo '</td>';
?>
asi quedo:
NumCliente: 47564 3 | 47564 | 80317048-10 | 4764 AFR | 39654225L | 2015-11-04 | 09:00:00.0000000 | Confirmada | 126
4 | 47564 | 80317048-10 | 4764 AFR | 39654225L | 2015-11-05 | 09:00:00.0000000 | Confirmada | 126
4 | 47564 | 80317048-11 | 4764 AFR | 39654225L | 2015-11-05 | 09:00:00.0000000 | Confirmada | 126
Respuesta en 0 segundos4
Contrato Cliente Matricula DNI PASAPORTE Matricula Remolque Nombre
80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran 80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran 80317048-11 47564 4764 AFR 39654225L 5567 CFG Pere Vilagran EditDeleteProfile