FIX_TABLE_NOT_FOUND_ISSUE

This commit is contained in:
VENKATESHWARAN 2025-12-31 12:52:57 +05:30
parent 47d778bfe2
commit ab43cdc68a
2 changed files with 22 additions and 11 deletions

View File

@ -1076,10 +1076,23 @@ class EmployeeController extends AdminController
}
return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => $html, 'file_data' => $file_name, 'excel_data' => $excel_data], 200);
} catch (\Exception $e) {
} catch (\Throwable $th) {
$errorData = [
'message' => $th->getMessage(),
'file' => $th->getFile(),
'line' => $th->getLine(),
'code' => $th->getCode(),
'trace' => $th->getTraceAsString(),
'trace_array' => $th->getTrace(), // full array version (optional)
'function' => $th->getTrace()[0]['function'] ?? null,
'class' => $th->getTrace()[0]['class'] ?? null,
];
// Handle exception
$errorMessage = 'Error occurred: ' . $e->getMessage();
$errorMessage = 'Error occurred:' . PHP_EOL . json_encode($errorData, JSON_PRETTY_PRINT);
$this->myLogger->logme('error', $errorMessage);
$html = '<div class="text-center">No Data Found</div>';
return $this->respond(['dataStatus' => false, 'code' => 500, 'data' => $html, 'file_data' => $file_name], 500);
}

View File

@ -22,15 +22,13 @@ table.dataTable tbody td {
</thead>
<tbody class="font-12">
<?php for ($i = 1; $i <= $count; $i++): ?>
<tr>
<?php foreach ($tbody[$i] as $data): ?>
<td>
<?php echo $data;?>
</td>
<?php endforeach; ?>
</tr>
<?php endfor; ?>
<?php helper('excel_util_helper'); foreach ($tbody as $body) { if(check_row_is_empty_or_null($body)){break;} ?>
<tr>
<?php foreach ($body as $data){ ?>
<td><?= esc($data) ?></td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div> <!-- end .table-responsive -->