<div class="card-box">
<div class="col-12">
    <div class="card-box-header">
        <h5>
            <i class="fa fa-print" onclick="window.print()" style="font-size:18px;cursor:pointer;margin-right:8px;" title="Print"></i>
            <i class="fa-solid fa-file-contract" style="color:#7c3aed;"></i> Report Header
        </h5>
        <a href="<?php echo site_url('report_header/create'); ?>" class="btn btn-primary btn-sm">
            <i class="fa-solid fa-plus me-1"></i> Add Report Header
        </a>
    </div>
    <div class="print-title" style="display:none;">Report Header</div>

    <div class="table-responsive">
        <table id="report_header_detailview" class="table table-bordered table-hover dt-table mb-0">
            <thead>
                <tr>
                    <th width="60">Sr.</th>
                    <th>Report Header Name</th>
                    <th width="180" class="text-center">Status</th>
                    <th width="160" class="text-center">Action</th>
                </tr>
            </thead>
            <tbody>
                <?php if(!empty($reportheaderdata)): $sr = 1; foreach($reportheaderdata as $row): ?>
                <tr>
                    <td><?php echo $sr++; ?></td>
                    <td><?php echo htmlspecialchars($row->report_header_name); ?></td>
                    <td class="text-center">
                        <?php if($row->status == 1): ?>
                            <span class="badge-active"><i class="fa-solid fa-circle-check me-1"></i>Active</span>
                        <?php else: ?>
                            <span class="badge-inactive"><i class="fa-solid fa-circle-xmark me-1"></i>Inactive</span>
                        <?php endif; ?>
                    </td>
                    <td class="text-center">
                        <a href="<?php echo site_url('report_header/edit/'.$row->id); ?>" class="btn btn-sm btn-edit me-1"><i class="fa-solid fa-pen-to-square"></i></a>
                    </td>
                </tr>
                <?php endforeach; else: ?>
                <tr><td colspan="4" class="text-center py-4 text-muted">No report header found. <a href="<?php echo site_url('report_header/create'); ?>">Add first</a></td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
</div>
