<?= $this->include("themes/_commonPartialsBs/datatables") ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>

<?= $this->section("content") ?>
<div class="row">
    <div class="col-12">
		<div class="card card-info">
			<div class="card-header">
        		<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
			</div><!--//.card-header -->
			<form id="maquinaForm" class="card-body" method="post" action="<?= $formAction ?>">
				<?= csrf_field() ?>
                <div class="card-body">
                    <?= view("themes/_commonPartialsBs/_alertBoxes") ?>
                    <?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
                    <?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems") ?>
                </div><!-- /.card-body -->
                <div class="py-4">
                    <input type="submit"
                        class="btn btn-primary float-start me-sm-3 me-1"
                        name="save"
                        value="<?= lang("Basic.global.Save") ?>"
                    />
                    <?= anchor(route_to("maquinaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
                </div><!-- /.card-footer -->
			</form>
    </div><!-- //.card -->
    </div><!--//.col -->
</div><!--//.row -->


<?php if(str_contains($formAction,'edit')): ?>
        
    <div class="accordion mt-3" id="accordianTarifasImpresion">
        <div class="card accordion-item active">
            <h2 class="accordion-header" id="headingOne">
                <button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
                    <h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
                </button>
            </h2>

            <div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordianTarifasImpresion">
                <div class="accordion-body">
                    
                    <table id="tableOfMaquinastarifasimpresion" class="table table-striped table-hover" style="width: 100%;">
                        <thead>
                            <tr>
                                <th><?= lang('MaquinasTarifasImpresions.uso') ?></th>
                                <th><?= lang('MaquinasTarifasImpresions.tipo') ?></th>
                                <th><?= lang('MaquinasTarifasImpresions.precio') ?></th>
                                <th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        </tbody>
                    </table>   
                </div>
            </div>
        </div>
    </div> <!-- //.accordion -->
<?php endif; ?>

<?php if(str_contains($formAction,'edit')): ?>
    
    <div class="accordion mt-3" id="accordianPapelesCalles">
        <div class="card accordion-item active">
            <h2 class="accordion-header" id="headingOne">
                <button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip3" aria-expanded="false" aria-controls="accordionTip3">
                    <h3><?= lang("MaquinasCalles.moduleTitle") ?></h3>
                </button>
            </h2>

            <div id="accordionTip3" class="accordion-collapse collapse show" data-bs-parent="#accordianPapelesCalles">
                <div class="accordion-body">
                    <table id="tableOfCalles" class="table table-striped table-hover" style="width: 100%;">
                        <thead>
                            <tr>
                                <th><?= lang('MaquinasCalles.formas') ?></th>
                                <th><?= lang('MaquinasCalles.internas') ?></th>
                                <th><?= lang('MaquinasCalles.externas') ?></th>
                                <th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        </tbody>
                    </table>   
                </div>
            </div>
        </div>
    </div> <!-- //.accordion -->

<?php endif; ?>

<?php if(str_contains($formAction,'edit')): ?>
    
    <div class="accordion mt-3" id="accordianPapelesImpresion">
        <div class="card accordion-item active">
            <h2 class="accordion-header" id="headingOne">
                <button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip2" aria-expanded="false" aria-controls="accordionTip2">
                    <h3><?= lang("MaquinasPapelImpresion.papel_impresion_maquinas") ?></h3>
                </button>
            </h2>

            <div id="accordionTip2" class="accordion-collapse collapse show" data-bs-parent="#accordianPapelesImpresion">
                <div class="accordion-body">
                    <table id="tableOfPapelesImpresion" class="table table-striped table-hover" style="width: 100%;">
                        <thead>
                            <tr>
                                <th><?= lang('MaquinasPapelImpresion.activo') ?></th>
                                <th><?= lang('PapelGenerico.papelGenerico') ?></th>
                                <th><?= lang('PapelImpresion.nombre') ?></th>
                                <th><?= lang('PapelImpresion.gramaje') ?></th>
                                <th><?= lang('PapelImpresion.bn') ?></th>
                                <th><?= lang('PapelImpresion.color') ?></th>
                                <th><?= lang('PapelImpresion.cubierta') ?></th>
                                <th><?= lang('PapelImpresion.sobrecubierta') ?></th>
                                <th><?= lang('PapelImpresion.rotativa') ?></th>
                                <th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        </tbody>
                    </table>   
                </div>
            </div>
        </div>
    </div> <!-- //.accordion -->

    <?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>

<?php endif; ?>





<?= $this->endSection() ?>





<?= $this->section("additionalInlineJs") ?>

    const lastColNr2 = $('#tableOfPapelesImpresion').find("tr:first th").length - 1;
    const actionBtns2 = function(data) {
        return `
            <a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit2 mx-2" data-id="${data.papel_impresion_id}"></i></a>
                `;
    };

    $(document).on('click', '.btn-edit2', function(e) {
        window.open(`/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`); 
    });

    function watch(j) {
        return new Proxy(JSON.parse ('{"watch":' + j + '}'), {
            set: function(target, property, value) {
                target[property] = value;
                $('#tableOfPapelesImpresion').DataTable().ajax.reload(null,false);
                theTable2.clearPipeline();    
                theTable2.draw();
                
            }
        });
    }
    
    isRotativa = watch(0);
    

    $(document).ready(function () {
        if($(this).is(':checked')){

            $("#datosRotativa").show();
        }
    });

    $('#isRotativa').on("click",function(el){
        asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
                '<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallback, noCallback);
    });

    function yesCallback() {
        if($('#isRotativa').is(':checked')){
            isRotativa.watch = 1;
            $("#datosRotativa").show();
        }else{
            document.getElementById("precioTintaNegro").value = 0;
            document.getElementById("precioTintaColor").value = 0;
            document.getElementById("velocidadCorte").value = 0;
            document.getElementById("precioHoraCorte").value = 0;
            document.getElementById("metrosxminuto").value = 0;
            $("#datosRotativa").hide();
            isRotativa.watch = 0;
        }
        theTable2.clearPipeline();
        theTable2.draw();
        //yeniden(response.<?= csrf_token() ?>); esto da error JJO?
    }

    function noCallback() {
        // Toggle behaviour
        $('#isRotativa').prop("checked", !$('#isRotativa').prop("checked"));
    }

    $('#isRotativa').on('change', function(){
        updatePapeles()
    })

    $('#isTinta').on('change', function(){
        updatePapeles()
    })

    function updatePapeles(){
        yeniden(json.<?= csrf_token() ?>);

        $.ajax({
            url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>',
            data: {
                maquina_id: id,
                isRotativa: isRotativa.watch,
                isInkjet: $('#isTinta').prop('checked'),
                <?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v,
            },
            method: 'POST',
            headers: {'X-Requested-With': 'XMLHttpRequest'},
            success:function(response){
                
                token=JSON.parse(response).<?= csrf_token() ?>;
                yeniden(token);

                theTable.clearPipeline();
                theTable.draw();
        
                theTable2.clearPipeline();
                theTable2.draw();
            }
        });
    }

    $('#isPadre').on("click",function(el){
        if($(this).is(':checked')){
            $("#selectVariante").show();
        }else{
            $("#padreId").select2('val', -1);
            $("#selectVariante").hide();
        }
    });

    $('#padreId').select2({
        allowClear: false,
        ajax: {
            url: '<?= route_to("menuItemsOfMaquinas") ?>',
            type: 'post',
            dataType: 'json',

            data: function (params) {
                return {
                    id: 'id',
                    text: 'nombre',
                    searchTerm: params.term,
                    <?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
                };
            },
            delay: 60,
            processResults: function (response) {

                yeniden(response.<?= csrf_token() ?>);

                return {
                    results: response.menu
                };
            },
            cache: true
        },
        
    });

    const lastColNr = $('#tableOfTarifamanipuladolineas').find("tr:first th").length - 1;
    const url = window.location.href;
    const url_parts = url.split('/');
    if(url_parts[url_parts.length-2] == 'edit'){
        id = url_parts[url_parts.length-1];
    }
    else{
        id = -1;
    }

    const actionBtns = function(data) {
        return `
                    <span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
                    <a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
                    <span class="cancel"></span>
                `;
    };


    usoTypes = [
        {label:'<?= lang('MaquinasTarifasImpresions.interior') ?>', value:'interior'}, 
        {label:'<?= lang('MaquinasTarifasImpresions.cubierta') ?>', value: 'cubierta'},
        {label:'<?= lang('MaquinasTarifasImpresions.sobrecubierta') ?>', value: 'sobrecubierta'}
    ];
    
    tipoTypes = [
        {label:'<?= lang('MaquinasTarifasImpresions.negro') ?>', value:'negro'}, 
        {label:'<?= lang('MaquinasTarifasImpresions.negrohq') ?>', value: 'negrohq'},
        {label:'<?= lang('MaquinasTarifasImpresions.bicolor') ?>', value: 'bicolor'},
        {label:'<?= lang('MaquinasTarifasImpresions.color') ?>', value: 'color'},
        {label:'<?= lang('MaquinasTarifasImpresions.colorhq') ?>', value: 'colorhq'},
    ];

	editor = new $.fn.dataTable.Editor( {
        ajax: {
            url: "<?= route_to('editorOfMaquinasTarifaImpresion') ?>", 
            headers: {
                <?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
            },
        },
        table   : "#tableOfMaquinastarifasimpresion",
        idSrc:  'id',
        fields: [ {
                name: "uso",
                type: "select",
                options: usoTypes
            }, {
                name: "tipo",
                type: "select",
                options: tipoTypes
            }, {
                name: "precio",
                attr: {
                    type: "number"
                }
            }, {
                "name": "maquina_id",
                "type": "hidden"
            },{
                "name": "deleted_at",
                "type": "hidden"
            },{
                "name": "is_deleted",
                "type": "hidden"
            },
        ]
    } );


    editor.on( 'preSubmit', function ( e, d, type ) {
        if ( type === 'create'){
            d.data[0]['maquina_id'] = id;
        }
        else if(type === 'edit' ) {
            for (v in d.data){
                d.data[v]['maquina_id'] = id;
            }
        }
    });
    
    
    editor.on( 'postSubmit', function ( e, json, data, action ) {
        
        updatePapeles()
    });


    editor2 = new $.fn.dataTable.Editor( {
        ajax: {
            url: "<?= route_to('editorOfMaquinasPapelImpresion') ?>", 
            headers: {
                <?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
            },
        },
        table   : "#tableOfPapelesImpresion",
        idSrc:  'papel_impresion_id',
        fields: [  
            { 
                name:      "active",
                type:      "checkbox",
                separator: "|",
                ipOpts:    [
                    { label: '', value: 1 }
                ]
            },{
                "name": "papel_impresion_id",
                "type": "hidden"
            },{
                "name": "gramaje",
                "type": "hidden"
            },{
                "name": "maquina_id",
                "type": "hidden"
            }
        ]
    } );

    editor2.on( 'postSubmit', function ( e, json, data, action ) {
        yeniden(json.<?= csrf_token() ?>);
        if(json.error){
            document.getElementById("check_" + json.data.papel_impresion_id).checked = false;
            Swal.fire({
                icon: 'error',
                title: '<?= lang('Basic.global.sweet.error_tittle') ?>',
                text: json.error,
            });
        }
    });

    
	var theTable = $('#tableOfMaquinastarifasimpresion').DataTable( {
		serverSide: true,
        processing: true,
        autoWidth: true,
        responsive: true,
        order: [[ 1, "asc" ]],
        pageLength: 5,
        lengthChange: false,
        searching: false, 
        paging: true, 
        info: false,
        dom: '<"mt-4"><"float-end"B><"float-start"l><t>', //"Blt",
		ajax : $.fn.dataTable.pipeline( {
            url: '<?= route_to('dataTableOfMaquinasTarifasImpresion') ?>',
            data: {
                id_maquina: id,
            },
            method: 'POST',
            headers: {'X-Requested-With': 'XMLHttpRequest'},
            async: true,
        }),
        columns: [
            { 'data': 'uso',  "render": function ( data, type, row, meta ) {
                    if(data=='interior')
                        return '<?= lang('MaquinasTarifasImpresions.interior') ?>';
                    else if (data=='cubierta')
                        return '<?= lang('MaquinasTarifasImpresions.cubierta') ?>';
                    else if (data=='sobrecubierta')
                        return '<?= lang('MaquinasTarifasImpresions.sobrecubierta') ?>';
                }
            },
            { 'data': 'tipo',  "render": function ( data, type, row, meta ) {
                    if(data=='negro')
                        return '<?= lang('MaquinasTarifasImpresions.negro') ?>';
                    else if (data=='negrohq')
                        return '<?= lang('MaquinasTarifasImpresions.negrohq') ?>';
                    else if (data=='bicolor')
                        return '<?= lang('MaquinasTarifasImpresions.bicolor') ?>';
                    else if (data=='color')
                        return '<?= lang('MaquinasTarifasImpresions.color') ?>';
                    else if (data=='colorhq')
                        return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
                }
            },
            { 'data': 'precio' },
            {
                data: actionBtns,
                className: 'row-edit dt-center'
            }
            
        ],
        columnDefs: [
            {
                orderable: false,
                searchable: false,
                targets: [lastColNr]
            },
            {"orderData": [ 0, 1 ],    "targets": 0 },

        ],
        language: {
            url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
        },
        buttons: [ {
            className: 'btn btn-primary float-end me-sm-3 me-1',
            extend: "createInline",
            editor: editor,
            formOptions: {
                submitTrigger: -1,
                submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
            }
        } ]
    } );

    
    var theTable2 = $('#tableOfPapelesImpresion').DataTable( {
		serverSide: true,
        processing: true,
        autoWidth: true,
        responsive: true,
        lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
        order: [[ 1, "asc" ]],
        pageLength: 25,
        lengthChange: true,
        searching: true, 
        paging: true, 
        info: true,
        stateSave: true,
        dom: "lftp",
		ajax : $.fn.dataTable.pipeline( {
            url: '<?= route_to('dataTableOfMaquinasPapelesImpresion') ?>',
            data: function (d) {
                d.maquina_id = id;
                d.isRotativa = isRotativa.watch;
                d.webguard_token  = '<?= csrf_hash() ?>';
            },
            method: 'POST',
            headers: {'X-Requested-With': 'XMLHttpRequest'},
            async: true,
        }),
        columns: [
            { 'data': 'active',
                render: function (data, type, row) {
                    if (type === 'display') {
                        return '<input type="checkbox" class="editor-active" id="check_' + row.papel_impresion_id + '">';
                    }
                    return data;
                },
                className: 'dt-body-center'
            },
            { 'data': 'papel_generico'},
            { 'data': 'papel_impresion'},
            { 'data': 'gramaje'},
            { 'data': 'bn'},
            { 'data': 'color'},
            { 'data': 'cubierta'},
            { 'data': 'sobrecubierta'},
            { 'data': 'rotativa'},
            { data: actionBtns2,
                    className: 'row-edit dt-center'}
        ],
        columnDefs: [
            {
                orderable: false,
                targets: [lastColNr2] 
            },
            {
                searchable: false,
                targets: [0,3,4,5,6,7,8,lastColNr2]
            }
        ],
        rowCallback: function (row, data) {
            // Set the checked state of the checkbox in the table
            $('input.editor-active', row).prop('checked', data.active == 1);
        },
        language: {
            url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
        }
    } );

    
    // Cuando se clica en un checkbox hacer submit en el editor
    theTable2.on( 'change', 'input.editor-active', function () {
        editor2
            .edit( $(this).closest('tr'), false )
            .set( 'active', $(this).prop( 'checked' ) ? 1 : 0 )
            .submit();
    } );
    
     
    // Activate an inline edit on click of a table cell
    $('#tableOfMaquinastarifasimpresion').on( 'click', 'tbody span.edit', function (e) {
        editor.inline(
            theTable.cells(this.parentNode.parentNode, '*').nodes(),
            {
                cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
                cancelTrigger: 'span.cancel',
                submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
                submitTrigger: 'span.edit',
                submit: 'allIfChanged'
            } 
        );
    } );

    theTable2.on( 'draw.dt', function () {
        const boolCols = [4, 5, 6, 7, 8];
        for (let coln of boolCols) {
            theTable2.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
                cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
            });
        }
    });
    
    // Delete row
    $(document).on('click', '.btn-delete', function(e) {
        $(".btn-remove").attr('data-id', $(this).attr('data-id'));
        const row = $(this).closest('tr')[0]._DT_RowIndex;
        
        if($(this).closest('table').attr('id').includes('tarifas')){
            $(".btn-remove").attr('table', "tarifas");
            $(".btn-remove").attr('row_index', row);
        }
        else if($(this).closest('table').attr('id').includes('Calles')){
            $(".btn-remove").attr('table', "calles");
            $(".btn-remove").attr('row_index', row);
        }
        else{
            $(".btn-remove").attr('table', );
        }
    });


    $(document).on('click', '.btn-remove', function(e) {
        const dataId = $(this).attr('data-id');
        const row = $(this).attr('row_index');
        
        if ($.isNumeric(dataId)) {

            if($(this).attr('table').includes('tarifas')){
                remove_tarifas(dataId, row);
            }
            else if ($(this).attr('table').includes('calles')){
                remove_calles(dataId, row);
            }
        }
    });

    function remove_calles(dataId, row){
        $.ajax({
                url: `/maquinascalles/delete/${dataId}`,
                method: 'GET',
            }).done((data, textStatus, jqXHR) => {
                $('#confirm2delete').modal('toggle');
                theTable3.clearPipeline();
                theTable3.row($(row)).invalidate().draw();
                popSuccessAlert(data.msg ?? jqXHR.statusText);
            }).fail((jqXHR, textStatus, errorThrown) => {
                popErrorAlert(jqXHR.responseJSON.messages.error)
        });
    };

    function remove_tarifas(dataId, row){

        $.ajax({
                url: `/maquinastarifasimpresion/delete/${dataId}`,
                method: 'GET',
            }).done((data, textStatus, jqXHR) => {
                $('#confirm2delete').modal('toggle');
                theTable.clearPipeline();
                theTable.row($(row)).invalidate().draw();
                popSuccessAlert(data.msg ?? jqXHR.statusText);
            }).fail((jqXHR, textStatus, errorThrown) => {
                popErrorAlert(jqXHR.responseJSON.messages.error)
        });
    }      

       

<?= $this->endSection() ?>


<!------------------------------------------->
<!-- Código JS para tabla calles -->
<!------------------------------------------->
<?= $this->section("additionalInlineJs") ?>

    var editor3 = new $.fn.dataTable.Editor( {
        ajax: {
            url: "<?= route_to('editorOfMaquinascalles') ?>", 
            headers: {
                <?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
            },
        },
        table   : "#tableOfCalles",
        idSrc:  'id',
        fields: [ {
                name: "formas"
            }, {
                name: "internas"
            }, {
                name: "externas"
            }, {
                "name": "maquina_id",
                "type": "hidden"
            },{
                "name": "deleted_at",
                "type": "hidden"
            },{
                "name": "is_deleted",
                "type": "hidden"
            },
        ]
    } );


    editor3.on( 'preSubmit', function ( e, d, type ) {
        if ( type === 'create'){
            d.data[0]['maquina_id'] = id;
        }
        else if(type === 'edit' ) {
            for (v in d.data){
                d.data[v]['maquina_id'] = id;
            }
        }
    });
    
    
    editor3.on( 'postSubmit', function ( e, json, data, action ) {
        
        yeniden(json.<?= csrf_token() ?>);
    });


    editor3.on( 'submitSuccess', function ( e, json, data, action ) {
        
        theTable3.clearPipeline();
        theTable3.draw();
    });

    theTable3 = $('#tableOfCalles').DataTable({
        processing: true,
        serverSide: true,
        autoWidth: true,
        responsive: true,
        scrollX: true,
        lengthMenu: [ 5],
        pageLength: 10,
        lengthChange: false,
        searching: false,
        info: false,
        "dom": '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
        stateSave: true,
        language: {
            url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
        },
        ajax : $.fn.dataTable.pipeline( {
            url: '<?= route_to('dataTableOfMaquinascalles') ?>',
            data: {
                maquina_id: id,
            },
            method: 'POST',
            headers: {'X-Requested-With': 'XMLHttpRequest'},
            async: true,
        }),
        columns : [
            { 'data': 'formas' },
            { 'data': 'internas' },
            { 'data': 'externas' },
            { data: actionBtns,
                className: 'row-edit dt-center'}
        ],
        buttons: [ {
            className: 'btn btn-primary float-end me-sm-3 me-1',
            extend: "createInline",
            editor: editor3,
            formOptions: {
                submitTrigger: -1,
                submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
            }
        } ]
    });

    // Activate an inline edit on click of a table cell
    $('#tableOfCalles').on( 'click', 'tbody span.edit', function (e) {
        editor3.inline(
            theTable3.cells(this.parentNode.parentNode, '*').nodes(),
            {
                cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
                cancelTrigger: 'span.cancel',
                submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
                submitTrigger: 'span.edit',
                submit: 'allIfChanged'
            } 
        );
    } );

    

    

<?= $this->endSection() ?>



<?=$this->section('css') ?>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?>


<?= $this->section('additionalExternalJs') ?>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
<?=$this->endSection() ?>