diff --git a/app/Controllers/Ipd_discharge.php b/app/Controllers/Ipd_discharge.php index abc5516..eab21a0 100644 --- a/app/Controllers/Ipd_discharge.php +++ b/app/Controllers/Ipd_discharge.php @@ -5430,6 +5430,9 @@ class Ipd_discharge extends BaseController $headerHtml = $this->sanitizeDischargePdfHtml($headerHtml, false); $footerHtml = $this->sanitizeDischargePdfHtml($footerHtml, false); $renderedHtml = $this->sanitizeDischargePdfHtml($renderedHtml); + $selectedTemplateId = (int) ($templatePack['selected_template_id'] ?? 0); + $printBaseUrl = site_url('Ipd_discharge/show_discharge/' . $ipdId); + $templateQuery = $selectedTemplateId > 0 ? '?tpl=' . $selectedTemplateId : ''; // Show HTML with syntax highlighting return $this->response @@ -5441,6 +5444,8 @@ class Ipd_discharge extends BaseController 'pre{background:#fff;padding:20px;border:1px solid #ddd;overflow:auto;white-space:pre-wrap;word-wrap:break-word;} ' . '' . '

Discharge Summary HTML Source (IPD ID: ' . $ipdId . ')

' . + '

Print With Header' . + 'Print Without Header

' . '

Header Preview

' . '
' . ($headerHtml !== '' ? $headerHtml : '(empty header_html)') . '
' . '

Footer Preview

' .