Dear Friends,
I am alot before doing the mixed content of php and HTML in single variable in PHP..
I could not get the data even though there is not SYNTAX error..
please look my code and advise
$htmlcontent .="
<tr>
<td colspan=\"8\">".$details."></td>
</tr>";
for($k=0;$k<count($reg_years[$details]);$k++) {
$year = (int)($reg_years[$details][$k]);
$singlecount[$year] = array_filter($result[$details],function($details1) use ($year){
return ($details1['reg_year'] == $year && $details1['bench_type'] == 1);
});
$divisioncount[$year] = array_filter($result[$details],function($details2) use ($year){
return ($details2['reg_year'] == $year && $details2['bench_type'] == 2);
});
$fullcount[$year] = array_filter($result[$details],function($details3) use ($year){
return ($details3['reg_year'] == $year && $details3['bench_type'] >= 3);
});
$rpcount[$year] = array_filter($result[$details],function($rp) use ($year){
return ($rp['reg_year'] == $year && $rp['bench_type'] == 'RP');
});
$mjccount[$year] = array_filter($result[$details],function($mjc) use ($year){
return ($mjc['reg_year'] == $year && $mjc['bench_type'] == 'MJC');
});
$cocount[$year] = array_filter($result[$details],function($co) use ($year){
return ($co['reg_year'] == $year && $co['bench_type'] == 'X');
});
$total = 0;
$total = (int)(count($singlecount[$year])+count($divisioncount[$year])+count($fullcount[$year])+count($rpcount[$year])+count($mjccount[$year])+count($cocount[$year]));
$htmlcontent .="
<tr>
<td>".$year."</td>
<td align=\"center\">
if(count($singlecount[$year])>0) {
echo (count($singlecount[$year]));
}
else {
echo "-";
}
</td>
<td align=\"center\">
if(count($divisioncount[$year])>0) {
".count($divisioncount[$year])."
} else {
"-"
}
</td>
<td align=\"center\">
if (count($fullcount[$year]) > 0)
{
echo (count($fullcount[$year]));
}
else
{
echo "-";
} </td > < td align =\"center\">
if(count($rpcount[$year])>0) {
echo (count($rpcount[$year]));
} else { echo " - "; }
</td>
<td align=\"center\">
if(count($mjccount[$year])>0) {
echo (count($mjccount[$year]));
} else { echo " - "; }
</td>
<td align=\"center\">
if(count($cocount[$year])>0) {
echo (count($cocount[$year]));
} else { echo " - "; }
</td>
<td align=\"center\">
echo $total;
</td>
</tr>";
}
}
$htmlcontent .= "</tbody></table>";
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($htmlcontent);
$mpdf->Output();
Waiting for FAST reply
Thanks
Anes