<?= $this->include("themes/_commonPartialsBs/datatables") ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?=$this->extend('themes/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="clienteForm" data-cliente="<?=$clienteEntity->id?>" 
                    data-url="<?= auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor') ? 
                        '/presupuestos/presupuestocliente/edit/' : '/presupuestoadmin/edit/' ?>"
                    method="post" class="card-body" action="<?= $formAction ?>">
				<?= csrf_field() ?>
                <div class="card-body">
                    <?= view("themes/_commonPartialsBs/_alertBoxes") ?>
                    <?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
                    <?= view("themes/vuexy/form/clientes/cliente/_clienteFormItems") ?>
                </div><!-- /.card-body -->
                <div class="pt-4">
                    <input
                            type="submit"
                            class="btn btn-primary float-start me-sm-3 me-1"
                            name="save"
                            id="saveForm"
                            value="<?= lang("Basic.global.Save") ?>"
                    >
                    <?= anchor(route_to("clienteList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
                </div><!-- /.card-footer -->
			</form>
        </div><!-- //.card -->
    </div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>


<?=$this->section('css') ?>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
    <link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>">
<?=$this->endSection() ?>


<?= $this->section("additionalExternalJs") ?>
    <script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.colVis.min.js") ?>"></script>
    <script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
    <script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
    <script type="module" src="<?= site_url('assets/js/safekat/pages/cliente/cliente.js?'. 'token' . '='. (csrf_token() ?? "token")) ?>"></script>
<?= $this->endSection() ?>