<h4 class="mb-4"><i class="fas fa-sort-numeric-up me-2"></i><?= lang('admin.sequences') ?></h4>
<div class="card"><div class="card-body">
    <table id="seq-table" class="table table-striped w-100" data-url="/admin/sequences/datatable"
           data-columns='[{"data":"name"},{"data":"prefix"},{"data":"current"},{"data":"next_sample"},{"data":"reset"},{"data":"active"},{"data":"actions","orderable":false}]'>
        <thead><tr><th>Name</th><th>Prefix</th><th>Current</th><th>Next Sample</th><th>Reset</th><th>Status</th><th>Actions</th></tr></thead>
    </table>
</div></div>
<?php $__view->push('scripts') ?>
<script>
DataTableHelper.init('seq-table',{paging:false});
$(document).on('click','.btn-reset-seq',function(){if(!confirm('Reset sequence "'+$(this).data('name')+'"? This is irreversible!'))return;
    $.post('/admin/sequences/'+$(this).data('id')+'/reset',{_token:'<?= csrf_token() ?>'},function(r){if(r.success){FormHelper.showToast('success',r.message);DataTableHelper.reload('seq-table');}else FormHelper.showToast('error',r.message);},'json');});
</script>
<?php $__view->endPush() ?>