par
nestecha » 08 août 2015, 16:27
function display_tg_tds($aDatas) {
foreach ($aDatas as $arrayElement){
echo '<tr>';
echo '<td class="tg-031e">'.$arrayElement['nom'].'</td>';
echo '<td class="tg-031e">'.$arrayElement['prix'].' €</td>';
echo '<td class="tg-031e">'.$arrayElement['quantite'].'</td>';
echo '<td class="tg-031e">'.$arrayElement['quantite'] * $arrayElement['prix'].'</td>';
echo '</tr>';
}
}
Dans un autre fichier functions.php que tu inclues.
Et ensuite :
echo '<table class="tg" width="100%">
<tr>
<th class="tg-031e">Ref</th>
<th class="tg-031e">P.U.</th>
<th class="tg-031e">Quatité</th>
<th class="tg-031e">Total</th>
</tr>';
display_tg_tds($resultats);
echo '</table> ';