<div class="d-flex justify-content-between align-items-center mb-4">
    <h4 class="mb-0"><i class="fas fa-tags me-2"></i><?= lang('cards.card_types') ?></h4>
    <a href="/card-types/create" class="btn btn-primary"><i class="fas fa-plus me-1"></i><?= lang('common.create') ?></a>
</div>
<div class="card"><div class="card-body">
    <table id="types-table" class="table table-striped w-100" data-url="/card-types/datatable"
           data-columns='[
               {"data":"id","title":"#","width":"50px"},
               {"data":"type_code","title":"Code"},
               {"data":"name_en","title":"Name (EN)"},
               {"data":"name_ar","title":"Name (AR)"},
               {"data":"applicable_to","title":"For"},
               {"data":"fee","title":"Fee","render":"renderMoney"},
               {"data":"is_active","title":"Active","render":"renderBool"},
               {"data":"id","title":"Actions","orderable":false,"searchable":false,"render":"renderTypeActions"}
           ]'>
    </table>
</div></div>
<?php $__view->push('scripts') ?>
<script>
function renderBool(d){return d==1?'<i class="fas fa-check text-success"></i>':'<i class="fas fa-times text-danger"></i>';}
function renderMoney(d){return parseFloat(d||0).toFixed(2);}
function renderTypeActions(d){return '<a href="/card-types/'+d+'/edit" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i></a>';}
document.addEventListener('DOMContentLoaded',function(){DataTableHelper.init('types-table');});
</script>
<?php $__view->endPush() ?>