<div class="card">
    <div class="card-header">

<div class="row align-items-center">
    <!-- Icon + Text -->
    <div class="col-md-6 d-flex align-items-center">
        <i class="material-icons-two-tone text-primary d-block f-46">add_task</i>

        <div>
            <h5 class="mb-0">
                List of all <span class="text-primary"><?= $total_sub_services ?></span> Services/Fee with actions
            </h5>
            <small>You can Edit or Delete (depending on rights)</small>
        </div>
    </div>

    <!-- Button -->
    <div class="col-md-6 text-end">
        <button class="btn btn-primary btn-sm btn-round"
                data-bs-toggle="modal"
                data-bs-target="#ExportServiceFeeModal">
            Export CSV
        </button>
        <button class="btn btn-primary btn-sm btn-round"
                data-bs-toggle="modal"
                data-bs-target="#ImportServiceFeeModal">
            Import CSV
        </button>
        <button class="btn btn-primary btn-sm btn-round"
                data-bs-toggle="modal"
                data-bs-target="#AddServiceFeeModal">
            Add Service / Fee
        </button>
    </div>

</div>
    </div>



    <div class="card-body">
        <table id="services-table" class="table table-striped table-bordered nowrap">
            <thead>
                <tr>
                    <th>#</th>
<!--                     <th>Department</th>
                    <th>Service</th> -->
                    <th>Name</th>
                    <!-- <th>Description</th> -->
                    <th>Fee</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($sub_services as $i => $ss): ?>
<tr>
    <td><?= $i+1 ?></td>
<!--     <td><?= $ss->department_name ?></td>
    <td><?= $ss->service_name ?></td> -->
    <td><?= $ss->name ?><br><span class="badge bg-light-primary f-12" href="#!"><?= $ss->department_name ?></span> | <span class="badge bg-light-info f-12" href="#!"><?= $ss->service_name ?></span> </td>
    <!-- <td><?= $ss->description ?></td> -->
    <td><?= isset($ss->fee) ? number_format($ss->fee,2).' '.$ss->currency : '-' ?></td>
    <td>
      
<a href="#" class="badge bg-light-warning edit-subservice-btn"
   data-id="<?= $ss->id ?>"
   data-name="<?= $ss->name ?>"
   data-service="<?= $ss->service_id ?>"
   data-description="<?= $ss->description ?>"
   data-fee="<?= isset($ss->fee) ? $ss->fee : '' ?>"
   data-currency="<?= isset($ss->currency) ? $ss->currency : 'PKR' ?>">
   <i data-feather="edit"></i>
</a>




<a href="javascript:void(0);" class="badge  bg-light-danger delete-confirmation-modal"
                   data-url="<?= base_url('admin/sub_services/delete/'.$ss->id) ?>">
                   <i data-feather="trash"></i>
                 </a>


    </td>
</tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>