How to write if conditions inside TCPDF table. The following is not working. Where am I doing mistake?
$tbl = '<<<EOD
<style>
td {
text-align: center;
}
</style>
<table cellpadding="1" cellspacing="0" border="1">
<thead style="text-align:center">
<tr style="background-color:#FFFF00;color:#0000FF;text-align:center">
<th>Discounts</th>
<th>%</th>
</tr>
</thead>
<tbody>
<tr>
<th>Corporate</th>
<td>$corporateDiscount</td>
</tr>
<tr>
<th>Negotiated Discount</th>
<td>$negotiatedDiscountPrint</td>
</tr>';
if($mag == 'Axon') {
$tbl .= '<tr>
<th>New Discount</th>
<td>$newList</td>
</tr>';
}
$tbl .= '<tr>
<th style="color:#0000FF;">Total Discount</th>
<td>$secondTableTotalPrint</td>
</tr>
</tbody>
</table>
EOD';
$pdf->writeHTML($tbl, true, false, false, false, '');