Add PDF validation in email script; add Nat_SubSubGroupSequence column
- Skip attachment if downloaded content is not a valid PDF (HTML error response) - Add Nat_SubSubGroupSequence to nat_subsubgroup table (missing column referenced by sp_rpt_hasil_lab in SELECT and ORDER BY) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -292,6 +292,11 @@ foreach ($rows as $row) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (substr($pdf, 0, 4) !== '%PDF') {
|
||||
log_msg(" Not a PDF (got HTML/error response), skipping");
|
||||
continue;
|
||||
}
|
||||
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'ibl_email_') . '.pdf';
|
||||
file_put_contents($tmp, $pdf);
|
||||
$tmp_files[] = $tmp;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Add missing Nat_SubSubGroupSequence column to nat_subsubgroup
|
||||
-- Required by sp_rpt_hasil_lab which references this column in SELECT and ORDER BY
|
||||
|
||||
ALTER TABLE nat_subsubgroup
|
||||
ADD COLUMN Nat_SubSubGroupSequence char(2) NOT NULL DEFAULT '' AFTER Nat_SubSubGroupCode;
|
||||
Reference in New Issue
Block a user