<?php
$this->load->view('report_pdf/pdf_header');
$period_label = isset($period_label) ? $period_label : '';
$row = (!empty($report) && isset($report[0])) ? $report[0] : null;
$allotted = $row ? (float) $row->Budget_Allotted : 0;
$utilized = $row ? (float) $row->Amount_Utilized : 0;
$balance = $row ? (float) $row->Balance : 0;
?>
<style>
    .be-wrap { margin-top: 24px; font-size: 13px; color: #111; }
    .be-acq { text-decoration: underline; font-weight: bold; margin: 0 0 10px 0; }
    .be-title { font-size: 16px; font-weight: bold; margin: 0 0 14px 0; }
    .be-range { margin: 0 0 22px 0; }
    .be-table { width: 90%; border-collapse: collapse; margin: 0 auto; }
    .be-table th, .be-table td {
        border: 1px solid #222;
        padding: 10px 12px;
        text-align: center;
        font-size: 13px;
    }
    .be-table th { background: #f3f3f3; font-weight: bold; }
    .be-table td { font-weight: bold; }
</style>

<div class="be-wrap">
    <p class="be-acq">Acquisition :</p>
    <p class="be-title">Budget Expenditure report</p>
    <p class="be-range">
        Date Range:
        <?php echo htmlspecialchars($period_label !== '' ? $period_label : ''); ?>
    </p>

    <table class="be-table" cellspacing="0" cellpadding="0">
        <tr>
            <th>Budget Allotted</th>
            <th>Amount Utilized</th>
            <th>Balance</th>
        </tr>
        <tr>
            <td><?php echo number_format($allotted, 2); ?></td>
            <td><?php echo number_format($utilized, 2); ?></td>
            <td><?php echo number_format($balance, 2); ?></td>
        </tr>
    </table>
</div>
