I have a custom web-app, getting data from a FileMaker database and spitting it out XML -> PHP -> HTML.
I'm currently generating a table in a big FOR loop and echoing out the results like so:
echo '
<tr>
<td><strong>Qty Approved</strong></td>
<td><strong>' . $record['qty1 approved'][0] . '</strong></td>
<td><strong>' . $record['qty2 approved'][0] . '</strong></td>
<td><strong>' . $record['qty3 approved'][0] . '</strong></td>
<td><strong>' . $record['qty4 approved'][0] . '</strong></td>
<td><strong>' . $record['qty5 approved'][0] . '</strong></td>
<td><strong>' . $record['qty6 approved'][0] . '</strong></td>
<td><strong>' . $record['qty7 approved'][0] . '</strong></td>
<td><strong>' . $record['qty8 approved'][0] . '</strong></td>
<td><strong>' . $record['qty9 approved'][0] . '</strong></td>
<td><strong>' . $record['qty10 approved'][0] . '</strong></td>
<td><strong>' . $record['qty11 approved'][0] . '</strong></td>
<td>'. $approved_string . '</td>
</tr>
';
I want to conditionally highlight some of the values in the table (which is what I'm doing with that $approved_string) whereby if e.g. the qty5 approved value > 0 then make it red, else make it green.
I understand how to reformat the table to properly use CSS, but what I don't know is whether or not to pre-calculate the values before echoing the table like with that $approved_string OR if I can/should be placing an if statement within my echo statement?