<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.carnet_types') ?></h4>
    <a href="/carnet-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="ct-table" class="table table-striped w-100" data-url="/carnet-types/datatable"
           data-columns='[{"data":"id","title":"#","width":"50px"},{"data":"type_code","title":"Code"},{"data":"name_en","title":"Name"},{"data":"max_entries","title":"Entries"},{"data":"validity_days","title":"Days"},{"data":"price","title":"Price","render":"renderMoney"},{"data":"is_active","title":"Active","render":"renderBool"},{"data":"id","title":"Actions","orderable":false,"searchable":false,"render":"renderCTActions"}]'>
    </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 renderCTActions(d){return '<a href="/carnet-types/'+d+'/edit" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i></a>';}
document.addEventListener('DOMContentLoaded',function(){DataTableHelper.init('ct-table');});
</script>
<?php $__view->endPush() ?>