implementado pestaña clientes en usuarios

This commit is contained in:
2024-12-15 12:24:49 +01:00
parent 7c5fdc0c88
commit 9a0581319c
7 changed files with 228 additions and 80 deletions

View File

@ -654,6 +654,24 @@
</div>
<div class="tab-pane fade" id="usuarios" role="tabpanel">
<div class="row align-items-end">
<div class="col-md-12 col-lg-4 px-4">
<div>
<label id="label_usuario" for="usuarios" class="form-label">
<?= lang('Users.usersAvailables') ?>
</label>
<select id="usuariosDisponibles" name="usuarios_disponibles" class="form-control select2bs2" style="width: 100%;">
</select>
</div>
</div>
<div class="col-md-12 col-lg-4 px-4">
<button id="addUserToClient" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Users.add")?></button>
</div>
</div>
<table id="tableOfClienteUsuarios" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
@ -1104,67 +1122,6 @@ function delete_direccion_envio(dataId){
<?=$this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
/****************************************
Contactos
*****************************************/
const lastColNrCU = $('#tableOfClienteUsuarios').find("tr:first th").length - 1;
var theTableCU = $('#tableOfClienteUsuarios').DataTable( {
serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
searching: false,
paging: true,
info: false,
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfClienteUsuarios') ?>',
data: {
//id_cliente: id,
id_cliente: 1,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columns: [
{ 'data': 'id' },
{ 'data': 'nombre' },
{ 'data': 'apellidos' },
{ 'data': 'email' },
{
data: actionBtns,
className: 'row-edit dt-center'
}
],
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNrCU]
},
{
"orderData": [ 0, 1 ],
"targets": 0
},
],
language: {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
}
} );
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">