<div class="card-box">
<div class="col-12">

    <div class="card-box-header">
        <h5>
            <i class="fa fa-file-excel-o icon_hover" onclick="exportToExcel('category_detailview','category')" style="color:#17179e;font-size:18px;cursor:pointer;margin-right:8px;" title="Export Excel"></i>
            <i class="fa fa-print icon_hover" onclick="window.print()" style="font-size:18px;cursor:pointer;margin-right:8px;" title="Print"></i>
            <i class="fa-solid fa-tag text-primary"></i> Category Master
        </h5>
        <a href="<?php echo site_url('category/create'); ?>" class="btn btn-primary btn-sm">
            <i class="fa-solid fa-plus me-1"></i> Add Category
        </a>
    </div>
<div class="print-title" style="display:none;">Category Master</div>

    <div class="table-responsive">
        <table id="category_detailview" class="table table-bordered table-hover dt-table mb-0" data-empty-text="No categories found.">
            <thead>
                <tr>
                    <th width="60">Sr.</th>
                    <th>Category Name</th>
                    <th width="120" class="text-center">Status</th>
                    <th width="160" class="text-center">Action</th>
                </tr>
            </thead>
            <tbody>
                <?php if(!empty($categorydata)): $sr = 1; foreach($categorydata as $row): ?>
                <tr>
                    <td><?php echo $sr++; ?></td>
                    <td><?php echo htmlspecialchars($row->category_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('category/edit/'.Category::_encode_id($row->id)); ?>" class="btn btn-sm btn-edit me-1" title="Edit">
                            <i class="fa-solid fa-pen-to-square"></i>
                        </a>
                        <!--<a href="<?php echo site_url('category/delete/'.$row->id); ?>" class="btn btn-sm btn-delete btn-delete-confirm" title="Delete">-->
                        <!--    <i class="fa-solid fa-trash"></i>-->
                        <!--</a>-->
                    </td>
                </tr>
                <?php endforeach; endif; ?>
            </tbody>
        </table>
    </div>

</div>
</div>