Il problema è che continui a fare due foreach su collection che hanno dimensioni diverse
getRigordStoricoQt() non credo ti restituisca articoli con taglie non ordinate dal cliente, giusto?
potresti fare così, anche se non so se l'ordine viene rispettato:
Codice PHP:<table class="tb_ordine">
<thead>
<tr>
<?php
$tgArray = array();
foreach ($objConnCerca->getTaglie($rigord['articolo_codice']) as $tg):
?>
<th>
<?php
$tgArray[$tg['taglia_codice']] = 0;
echo $tg['taglia_codice'];
?>
</th>
<?php endforeach; ?>
</tr>
<tr>
<?php
$qtaTotRiga = NULL;
foreach ($objConnCerca->getRigordStoricoQt($_GET['tesord'], $_GET['cliente'], $rigord['articolo_codice'], $rigord['articolo_colcod']) as $qt){
$qtaTotRiga += $qt['rigord_qta'];
$tgArray[$qt['taglia_codice']] = $qt['rigord_qta'];
}
foreach($tgArray as $row):
?>
<th>
<?php
echo $row;
?>
</th>
<?php endforeach; ?>
</tr>
</thead>
</table>

Rispondi quotando