The problem happens in the loop where you're iterating through the data to generate your PDF records. Since I can't see all of your code, I'll focus on the part that seems relevant where you're building the HTML content for your PDFs. It looks like like you're attempting to populate the HTML content for each record using
$value2['total1']
and
$value2['total2']
, these variables are not present in your code snippet. You might need to adjust this part of your code to correctly reference the data from your
$ListData
array -
foreach ($ListData as $user_id => $claims) {
foreach ($claims as $claim_id => $claim_data) {
$html .= '<table class="tabular">';
$html .= '<tr><td colspan="8" style="text-align:left;border:none;">' . $claim_data['value1'] . '</td></tr>';
$html .= '<tr><td colspan="8" style="text-align:left;border:none;">' . $claim_data['value2'] . '</td></tr>';
}
}
Using proper debugging and output checks can be very helpful in identifying issues like this. You can use
var_dump
or
print_r
to inspect the contents of variables and arrays in your code to ensure that the data is being processed correctly.