$_GET['filename'] = ''; $_GET['pdftype'] = 'onlyheader'; include("../pdfimp2.php"); $html = ""; // Initialize HTML $output = array(); $sql = "SELECT * FROM WO_bmr_process a WHERE a.product_code='" . $_GET['product_code'] . "' AND a.batch_number='" . $_GET['batch_number'] . "' AND a.work_order_no='" . $_GET['work_order_no'] . "' ORDER BY a.id DESC"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $sql22="select *, a.product_name as productName ,c.entry_date as batchStartDate from product a left join batch_planning b on a.product_code=b.product_code left join mfg_work_order_hdr c on b.id=c.batch_plan_id WHERE a.product_code='" . $_GET['product_code'] . "' AND c.batch_number='" . $_GET['batch_number'] . "' AND c.work_order_no='" . $_GET['work_order_no'] . "' "; $result22 = $conn->query($sql22); if ($result22->num_rows > 0) { while ($row22 = $result22->fetch_assoc()) { $labelClaimData = json_decode($row22['label_claim'], true); // Decode JSON string $html.='

1. GENERAL INFORMATION

'; $html .= ''; $html .= '
GENERIC / PRODUCT NAME ' .$row22['productName']. '
LABEL CLAIM'; if (!empty($labelClaimData)) { foreach ($labelClaimData as $item) { $html .= $item['material_name'] . ' - ' . $item['strength'] . ' ' . $item['unit'] . ' per ' . $item['dose_unit_qty'] . ' ' . $item['dose_unit_qty_unit'] . '
'; } } else { $html .= 'NA'; } $html .= '
STORAGE CONDITION ' .$row22['storage_condition']. '
PRODUCT APPEARANCE ' .$row22['apperance']. '
CHANGE CONTROL NUMBER VERSION No: 00 EFFECTIVE DATE  
SUPERSEDES: NA
PROCESS DETAILS STANDARD BATCH SIZE:' .$row22['batch_size']. '
BATCH DETAILS
Date Started: ' .$row22['batchStartDate']. ' Batch No.: ' .$row22['batch_number']. '
Date Completed:   Manufacturing Date:  
Total Days:   Expiry Date:  
Generic Code: ' .$row22['genericProductCode']. ' Shelf Life ' .$row22['shelf_life']. '
MFR No. ' .$row22['mfr_no']. ' Manufacturing Location:
ZUMA PHARMA LLC
Parkent, Tashkent, Uzbekistan
Effective Batch No: ' .$row22['batch_number']. '

*Shelf life is tentative and shall be ascertained based on Accelerated and real-time stability data.

**If the filled weight (Limit: ............. to ............ )


MAH Approval NA


BMR ISSUED BY (QA) BMR RECEIVED BY (PRODUCTION)
   
SIGN & DATE SIGN & DATE
BMR RETURNED BY (PRODUCTION) BMR RECEIVED BY (QA)
   
SIGN & DATE SIGN & DATE

'; } } // Fetch all stages for the work_order_id $sqlTOC = "SELECT * FROM WO_bmr_process_stage WHERE WO_bmr_process_ID = '".$row["id"]."' ORDER BY id ASC"; $resultTOC = $conn->query($sqlTOC); // Initialize TOC $html .= '

2. Table of Content

'; $html .= ''; $html .= ''; $html .= ''; if ($resultTOC->num_rows > 0) { $tocIndex = 1; while ($tocRow = $resultTOC->fetch_assoc()) { $html .= ''; $html .= ''; $html .= ''; $html .= ''; $tocIndex++; } } else { $html .= ''; } $html .= '
S. No. Content
' . $tocIndex . '' . htmlspecialchars($tocRow['stages']) . '
No stages found.
'; $htmlBlocks = []; $sql2 = "SELECT * FROM WO_bmr_process_stage WHERE WO_bmr_process_ID = '".$row["id"]."' ORDER BY id ASC"; $result2 = $conn->query($sql2); if ($result2->num_rows > 0) { $stageIndex = 3; while ($row2 = $result2->fetch_assoc()) { $html .= '
'."

".$stageIndex.".)". $row2['stages']."


"; $stageIndex++; } } } } $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output('Dispensing Record.pdf', 'I');