| 17008 |
efrain |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
| 17019 |
efrain |
8 |
$routeAdd = $this->url('habits/users/add');
|
|
|
9 |
$routeUpload = $this->url('habits/users/upload');
|
| 17008 |
efrain |
10 |
$routeDatatable = $this->url('habits/users');
|
|
|
11 |
|
| 17019 |
efrain |
12 |
$allowAdd = $acl->isAllowed($roleName, 'habits/users/add') ? 1 : 0;
|
|
|
13 |
$allowDelete = $acl->isAllowed($roleName, 'habits/users/delete') ? 1 : 0;
|
|
|
14 |
$allowUpload = $acl->isAllowed($roleName, 'habits/users/upload') ? 1 : 0;
|
| 17008 |
efrain |
15 |
|
|
|
16 |
|
|
|
17 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
18 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
26 |
|
|
|
27 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
|
|
33 |
|
|
|
34 |
|
| 17019 |
efrain |
35 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
36 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
| 17008 |
efrain |
37 |
|
| 17019 |
efrain |
38 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
39 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
| 17008 |
efrain |
44 |
|
| 17019 |
efrain |
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
| 17008 |
efrain |
50 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
|
|
|
51 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
|
|
|
52 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
|
|
|
53 |
|
|
|
54 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
|
|
|
55 |
|
| 17019 |
efrain |
56 |
$this->headStyle()->captureStart();
|
|
|
57 |
echo <<<CSS
|
| 17008 |
efrain |
58 |
|
|
|
59 |
|
| 17019 |
efrain |
60 |
#gridTableUsers {
|
|
|
61 |
display: flex;
|
|
|
62 |
flex-flow: column;
|
|
|
63 |
width: 100%;
|
|
|
64 |
}
|
| 17008 |
efrain |
65 |
|
| 17019 |
efrain |
66 |
#gridTableUsers thead {
|
|
|
67 |
flex: 0 0 auto;
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
#gridTableUsers tbody {
|
|
|
71 |
flex: 1 1 auto;
|
|
|
72 |
display: block;
|
|
|
73 |
overflow-y: auto;
|
|
|
74 |
overflow-x: hidden;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
#gridTableUsers tr {
|
|
|
78 |
width: 100%;
|
|
|
79 |
display: table;
|
|
|
80 |
table-layout: fixed;
|
|
|
81 |
}
|
|
|
82 |
.imagen-contaner{
|
|
|
83 |
border:1px solid rgb(200,200,200);
|
|
|
84 |
border-radius:5px;
|
|
|
85 |
padding:10px;
|
|
|
86 |
display:flex;
|
|
|
87 |
flex-flow:column;
|
|
|
88 |
align-items:center;
|
|
|
89 |
}
|
|
|
90 |
CSS;
|
|
|
91 |
$this->headStyle()->captureEnd();
|
|
|
92 |
|
|
|
93 |
|
| 17008 |
efrain |
94 |
$this->inlineScript()->captureStart();
|
|
|
95 |
echo <<<JS
|
|
|
96 |
jQuery( document ).ready(function( $ ) {
|
|
|
97 |
var routeAdd = '';
|
|
|
98 |
var routeUpload = '';
|
|
|
99 |
var allowDelete = $allowDelete;
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
103 |
'processing': true,
|
|
|
104 |
'serverSide': true,
|
|
|
105 |
'searching': true,
|
|
|
106 |
'order': [[ 0, 'asc' ]],
|
|
|
107 |
'ordering': true,
|
|
|
108 |
'ordenable' : true,
|
|
|
109 |
'responsive': true,
|
|
|
110 |
'select' : false,
|
|
|
111 |
'paging': true,
|
|
|
112 |
'pagingType': 'simple_numbers',
|
|
|
113 |
'ajax': {
|
|
|
114 |
'url' : '$routeDatatable',
|
|
|
115 |
'type' : 'get',
|
|
|
116 |
'beforeSend': function (request) {
|
|
|
117 |
NProgress.start();
|
|
|
118 |
},
|
|
|
119 |
'dataFilter': function(response) {
|
|
|
120 |
var response = jQuery.parseJSON( response );
|
|
|
121 |
|
|
|
122 |
var json = {};
|
|
|
123 |
json.recordsTotal = 0;
|
|
|
124 |
json.recordsFiltered = 0;
|
|
|
125 |
json.data = [];
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
if(response.success) {
|
|
|
129 |
json.recordsTotal = response.data.total;
|
|
|
130 |
json.recordsFiltered = response.data.total;
|
|
|
131 |
json.data = response.data.items;
|
|
|
132 |
} else {
|
|
|
133 |
$.fn.showError(response.data)
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
return JSON.stringify( json );
|
|
|
137 |
}
|
|
|
138 |
},
|
|
|
139 |
'language' : {
|
|
|
140 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
141 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
142 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
143 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
144 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
145 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
146 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
147 |
'sInfoPostFix': '',
|
|
|
148 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
149 |
'sUrl': '',
|
|
|
150 |
'sInfoThousands': ',',
|
|
|
151 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
152 |
'oPaginate': {
|
|
|
153 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
154 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
155 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
156 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
157 |
},
|
|
|
158 |
'oAria': {
|
|
|
159 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
160 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
161 |
},
|
|
|
162 |
},
|
|
|
163 |
'drawCallback': function( settings ) {
|
|
|
164 |
NProgress.done();
|
|
|
165 |
|
|
|
166 |
},
|
|
|
167 |
'aoColumns': [
|
|
|
168 |
{ 'mDataProp': 'first_name' },
|
|
|
169 |
{ 'mDataProp': 'last_name' },
|
|
|
170 |
{ 'mDataProp': 'email' },
|
|
|
171 |
{ 'mDataProp': 'actions' },
|
|
|
172 |
],
|
|
|
173 |
'columnDefs': [
|
|
|
174 |
{
|
|
|
175 |
'targets': 0,
|
|
|
176 |
'className' : 'text-vertical-middle',
|
|
|
177 |
},
|
|
|
178 |
{
|
|
|
179 |
'targets': 1,
|
|
|
180 |
'orderable': false,
|
|
|
181 |
'className' : 'text-vertical-middle',
|
|
|
182 |
|
|
|
183 |
},
|
|
|
184 |
{
|
|
|
185 |
'targets': 2,
|
|
|
186 |
'orderable': false,
|
|
|
187 |
'className' : 'text-vertical-middle',
|
|
|
188 |
|
|
|
189 |
},
|
|
|
190 |
{
|
|
|
191 |
'targets': -1,
|
|
|
192 |
'orderable': false,
|
|
|
193 |
'render' : function ( data, type, row ) {
|
|
|
194 |
s = '';
|
|
|
195 |
|
|
|
196 |
if(allowDelete) {
|
|
|
197 |
s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';
|
|
|
198 |
}
|
|
|
199 |
return s;
|
|
|
200 |
}
|
|
|
201 |
}
|
|
|
202 |
],
|
|
|
203 |
});
|
|
|
204 |
|
|
|
205 |
var validator = $('#form').validate({
|
|
|
206 |
debug: true,
|
|
|
207 |
onclick: false,
|
|
|
208 |
onkeyup: false,
|
|
|
209 |
ignore: [],
|
|
|
210 |
rules: {
|
|
|
211 |
'user_id': {
|
|
|
212 |
required: true,
|
|
|
213 |
},
|
|
|
214 |
},
|
|
|
215 |
submitHandler: function(form)
|
|
|
216 |
{
|
|
|
217 |
NProgress.start();
|
|
|
218 |
$('#submitBtn').prop('disabled', true);
|
|
|
219 |
$.ajax({
|
|
|
220 |
'dataType' : 'json',
|
|
|
221 |
'accept' : 'application/json',
|
|
|
222 |
'method' : 'post',
|
|
|
223 |
'url' : $('#form').attr('action'),
|
|
|
224 |
'data' : {
|
|
|
225 |
'user_id' : $('#form #user_id').val(),
|
|
|
226 |
}
|
|
|
227 |
}).done(function(response) {
|
|
|
228 |
if(response['success']) {
|
|
|
229 |
$.fn.showSuccess(response['data']);
|
|
|
230 |
|
|
|
231 |
$('#modal').modal('hide');
|
|
|
232 |
|
|
|
233 |
|
|
|
234 |
gridTable.api().ajax.reload(null, false);
|
|
|
235 |
} else {
|
|
|
236 |
validator.resetForm();
|
|
|
237 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
238 |
$.fn.showError(response['data']);
|
|
|
239 |
} else {
|
|
|
240 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
241 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
242 |
});
|
|
|
243 |
}
|
|
|
244 |
}
|
|
|
245 |
$('#submitBtn').prop('disabled', false);
|
|
|
246 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
247 |
$.fn.showError(textStatus);
|
|
|
248 |
}).always(function() {
|
|
|
249 |
$('#submitBtn').prop('disabled', false);
|
|
|
250 |
NProgress.done();
|
|
|
251 |
});
|
|
|
252 |
return false;
|
|
|
253 |
},
|
|
|
254 |
invalidHandler: function(form, validator) {
|
|
|
255 |
|
|
|
256 |
}
|
|
|
257 |
});
|
|
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
|
261 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
262 |
e.preventDefault();
|
|
|
263 |
var action = $(this).data('href');
|
|
|
264 |
|
|
|
265 |
|
|
|
266 |
$('#form').attr('action', '$routeAdd');
|
|
|
267 |
$('#form #user_id').val('');
|
|
|
268 |
$('#form #user_id').trigger('change');
|
|
|
269 |
|
|
|
270 |
|
|
|
271 |
validator.resetForm();
|
|
|
272 |
$('#modal').modal('show');
|
|
|
273 |
|
|
|
274 |
return false;
|
|
|
275 |
});
|
|
|
276 |
|
|
|
277 |
|
|
|
278 |
|
|
|
279 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
280 |
e.preventDefault();
|
|
|
281 |
gridTable.api().ajax.reload(null, false);
|
|
|
282 |
|
|
|
283 |
return false;
|
|
|
284 |
});
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
|
288 |
|
| 17019 |
efrain |
289 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
| 17008 |
efrain |
290 |
e.preventDefault();
|
|
|
291 |
$('#modal').modal('hide');
|
| 17019 |
efrain |
292 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
293 |
});
|
| 17008 |
efrain |
294 |
|
| 17019 |
efrain |
295 |
|
|
|
296 |
|
| 17008 |
efrain |
297 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
298 |
e.preventDefault();
|
|
|
299 |
var action = $(this).data('href');
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
swal.fire({
|
|
|
303 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
304 |
icon: 'question',
|
|
|
305 |
cancelButtonText: 'LABEL_NO',
|
|
|
306 |
showCancelButton: true,
|
|
|
307 |
confirmButtonText: 'LABEL_YES'
|
|
|
308 |
}).then((result) => {
|
|
|
309 |
if (result.isConfirmed) {
|
|
|
310 |
|
|
|
311 |
NProgress.start();
|
|
|
312 |
$.ajax({
|
|
|
313 |
'dataType' : 'json',
|
|
|
314 |
'accept' : 'application/json',
|
|
|
315 |
'method' : 'post',
|
|
|
316 |
'url' : action,
|
|
|
317 |
}).done(function(response) {
|
|
|
318 |
if(response['success']) {
|
|
|
319 |
$.fn.showSuccess(response['data']);
|
|
|
320 |
gridTable.api().ajax.reload(null, false);
|
|
|
321 |
} else {
|
|
|
322 |
$.fn.showError(response['data']);
|
|
|
323 |
}
|
|
|
324 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
325 |
$.fn.showError(textStatus);
|
|
|
326 |
}).always(function() {
|
|
|
327 |
NProgress.done();
|
|
|
328 |
});
|
|
|
329 |
}
|
|
|
330 |
});
|
|
|
331 |
});
|
|
|
332 |
|
|
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
|
336 |
$('#form #user_id').select2({
|
|
|
337 |
theme: 'bootstrap-5',
|
|
|
338 |
width: '100%',
|
|
|
339 |
dropdownParent: $('#modal'),
|
|
|
340 |
});
|
|
|
341 |
|
|
|
342 |
|
| 17019 |
efrain |
343 |
var validatorUploadUsers = $('#form-upload-users').validate({
|
|
|
344 |
debug: true,
|
|
|
345 |
onclick: false,
|
|
|
346 |
onkeyup: false,
|
|
|
347 |
onfocusout: false,
|
|
|
348 |
ignore: [],
|
|
|
349 |
rules: {
|
|
|
350 |
'file' : {
|
|
|
351 |
required: true,
|
|
|
352 |
extension: 'xls|xlsx',
|
|
|
353 |
accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'
|
|
|
354 |
},
|
|
|
355 |
},
|
|
|
356 |
|
|
|
357 |
submitHandler: function(form)
|
|
|
358 |
{
|
|
|
359 |
NProgress.start();
|
|
|
360 |
var formdata = false;
|
|
|
361 |
if (window.FormData){
|
|
|
362 |
formdata = new FormData(form);
|
|
|
363 |
}
|
|
|
364 |
formdata.append('step','validation');
|
| 17008 |
efrain |
365 |
|
| 17019 |
efrain |
366 |
|
|
|
367 |
$.ajax({
|
|
|
368 |
'dataType' : 'json',
|
|
|
369 |
'accept' : 'application/json',
|
|
|
370 |
'method' : 'post',
|
|
|
371 |
'url' : '$routeUpload',
|
|
|
372 |
'data' : formdata,
|
|
|
373 |
'processData': false,
|
|
|
374 |
'contentType': false,
|
|
|
375 |
}).done(function(response) {
|
|
|
376 |
if(response['success']) {
|
|
|
377 |
|
|
|
378 |
$('#table-upload-users-key').val(response['data']['key']);
|
|
|
379 |
|
|
|
380 |
$('#gridTableUploadUsers tbody').empty();
|
|
|
381 |
|
|
|
382 |
$.each(response['data']['items'], function(index, item) {
|
|
|
383 |
|
|
|
384 |
|
|
|
385 |
var s = '<tr>';
|
|
|
386 |
s = s + '<td>' + item['first_name'] + '</td>';
|
|
|
387 |
s = s + '<td>' + item['last_name'] + '</td>';
|
|
|
388 |
s = s + '<td>' + item['email'] + '</td>';
|
|
|
389 |
s = s + '<td>' + item['password'] + '</td>';
|
|
|
390 |
s = s + '<td>' + item['is_adult'] + '</td>';
|
|
|
391 |
s = s + '</tr>';
|
|
|
392 |
|
|
|
393 |
$('#gridTableUploadUsers tbody').append(s);
|
|
|
394 |
|
|
|
395 |
|
|
|
396 |
});
|
|
|
397 |
|
|
|
398 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
399 |
$('#modalUploadUsers').modal('show');
|
|
|
400 |
|
|
|
401 |
|
|
|
402 |
|
|
|
403 |
} else {
|
|
|
404 |
validatorUploadUsers.resetForm();
|
|
|
405 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
406 |
$.fn.showError(response['data']);
|
|
|
407 |
} else {
|
|
|
408 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
409 |
$.fn.showFormErrorValidator('#form-upload-users #' + fieldname, errors);
|
|
|
410 |
});
|
|
|
411 |
}
|
|
|
412 |
}
|
|
|
413 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
414 |
$.fn.showError(textStatus);
|
|
|
415 |
}).always(function() {
|
|
|
416 |
|
|
|
417 |
NProgress.done();
|
|
|
418 |
});
|
|
|
419 |
return false;
|
|
|
420 |
},
|
|
|
421 |
invalidHandler: function(form, validator) {
|
|
|
422 |
|
|
|
423 |
}
|
| 17008 |
efrain |
424 |
});
|
| 17019 |
efrain |
425 |
|
|
|
426 |
|
|
|
427 |
$('#form-upload-users #file').fileinput({
|
|
|
428 |
theme: 'fa',
|
|
|
429 |
language: 'es',
|
|
|
430 |
showUpload: false,
|
|
|
431 |
dropZoneEnabled: false,
|
|
|
432 |
maxFileCount: 1,
|
|
|
433 |
allowedFileExtensions: ['xls', 'xlsx'],
|
|
|
434 |
});
|
|
|
435 |
|
|
|
436 |
$('body').on('click', 'button.btn-upload', function(e) {
|
|
|
437 |
e.preventDefault();
|
|
|
438 |
|
|
|
439 |
$('#form-upload-users #file').fileinput('reset');
|
|
|
440 |
$('#form-upload-users #file').val('');
|
|
|
441 |
|
|
|
442 |
$('#modalFormUploadUsers').modal('show');
|
|
|
443 |
});
|
|
|
444 |
|
|
|
445 |
$('body').on('click', 'button.btn-upload-users-step2', function(e) {
|
|
|
446 |
e.preventDefault();
|
|
|
447 |
NProgress.start();
|
|
|
448 |
|
|
|
449 |
$.ajax({
|
|
|
450 |
'dataType' : 'json',
|
|
|
451 |
'accept' : 'application/json',
|
|
|
452 |
'method' : 'post',
|
|
|
453 |
'url' : '$routeUpload',
|
|
|
454 |
'data' : {
|
|
|
455 |
'step' : 'process',
|
|
|
456 |
'key' : $('#table-upload-users-key').val(),
|
|
|
457 |
}
|
|
|
458 |
}).done(function(response) {
|
|
|
459 |
if(response['success']) {
|
|
|
460 |
if(response['data']['users_created'] == 1) {
|
|
|
461 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USER_CREATED');
|
|
|
462 |
} else {
|
|
|
463 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USERS_CREATED');
|
|
|
464 |
}
|
|
|
465 |
gridTable.api().ajax.reload(null, false);
|
|
|
466 |
$('#modalUploadUsers').modal('hide');
|
|
|
467 |
} else {
|
|
|
468 |
$.fn.showError(response['data']);
|
|
|
469 |
}
|
|
|
470 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
471 |
$.fn.showError(textStatus);
|
|
|
472 |
}).always(function() {
|
|
|
473 |
NProgress.done();
|
|
|
474 |
});
|
|
|
475 |
return false;
|
|
|
476 |
});
|
|
|
477 |
|
|
|
478 |
});
|
| 17008 |
efrain |
479 |
JS;
|
|
|
480 |
$this->inlineScript()->captureEnd();
|
|
|
481 |
?>
|
|
|
482 |
|
|
|
483 |
|
|
|
484 |
<div class="container">
|
|
|
485 |
<div class="card" id="">
|
|
|
486 |
<div class="card-header">
|
|
|
487 |
<h6 class="card-title">LABEL_USERS</h6>
|
|
|
488 |
</div>
|
|
|
489 |
<div class="card-body">
|
|
|
490 |
<div class="row">
|
|
|
491 |
<div class="col-12 mt-3">
|
|
|
492 |
|
|
|
493 |
<table id="gridTable" class="table table-bordered">
|
|
|
494 |
<thead>
|
|
|
495 |
<tr>
|
|
|
496 |
<th>LABEL_FIRST_NAME</th>
|
|
|
497 |
<th>LABEL_LAST_NAME</th>
|
|
|
498 |
<th>LABEL_EMAIL</th>
|
|
|
499 |
<th>LABEL_ACTIONS</th>
|
|
|
500 |
</tr>
|
|
|
501 |
</thead>
|
|
|
502 |
<tbody>
|
|
|
503 |
</tbody>
|
|
|
504 |
</table>
|
|
|
505 |
</div>
|
|
|
506 |
</div>
|
|
|
507 |
</div>
|
|
|
508 |
<div class="card-footer text-right">
|
|
|
509 |
<?php if ($allowAdd) : ?>
|
|
|
510 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
511 |
<?php endif; ?>
|
| 17019 |
efrain |
512 |
<?php if ($allowUpload) : ?>
|
|
|
513 |
<button type="button" class="btn btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button>
|
|
|
514 |
<?php endif; ?>
|
| 17008 |
efrain |
515 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
|
|
516 |
</div>
|
|
|
517 |
</div>
|
|
|
518 |
</div>
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
<!-- The Modal -->
|
|
|
523 |
<div class="modal" id="modal">
|
| 17019 |
efrain |
524 |
<div class="modal-dialog modal-lx">
|
| 17008 |
efrain |
525 |
<div class="modal-content">
|
|
|
526 |
|
|
|
527 |
<!-- Modal Header -->
|
|
|
528 |
<div class="modal-header">
|
| 17019 |
efrain |
529 |
<h6 class="modal-title">LABEL_USER</h6>
|
| 17008 |
efrain |
530 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
|
|
531 |
</div>
|
|
|
532 |
|
|
|
533 |
<!-- Modal body -->
|
|
|
534 |
<div class="modal-body">
|
|
|
535 |
|
|
|
536 |
<?php
|
|
|
537 |
$form = $this->form;
|
|
|
538 |
$form->setAttributes([
|
|
|
539 |
'method' => 'post',
|
|
|
540 |
'name' => 'form',
|
|
|
541 |
'id' => 'form'
|
|
|
542 |
]);
|
|
|
543 |
|
|
|
544 |
$form->prepare();
|
|
|
545 |
echo $this->form()->openTag($form);
|
|
|
546 |
|
|
|
547 |
?>
|
|
|
548 |
<div class="card-body">
|
|
|
549 |
|
|
|
550 |
<div class="row">
|
|
|
551 |
<div class="col-12 mt-3">
|
|
|
552 |
<?php
|
|
|
553 |
$element = $form->get('user_id');
|
|
|
554 |
$element->setOptions(['label' => 'LABEL_USER']);
|
|
|
555 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
556 |
|
|
|
557 |
echo $this->formLabel($element);
|
|
|
558 |
echo $this->formSelect($element);
|
|
|
559 |
?>
|
|
|
560 |
</div>
|
|
|
561 |
</div>
|
|
|
562 |
|
|
|
563 |
|
|
|
564 |
</div>
|
|
|
565 |
</div>
|
|
|
566 |
|
|
|
567 |
|
|
|
568 |
<!-- Modal footer -->
|
|
|
569 |
<div class="modal-footer text-right">
|
|
|
570 |
<button type="submit" id="submitBtn" form="form" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
571 |
<button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
|
|
|
572 |
</div>
|
|
|
573 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
574 |
</div>
|
|
|
575 |
|
|
|
576 |
|
|
|
577 |
</div>
|
| 17019 |
efrain |
578 |
</div>
|
|
|
579 |
|
|
|
580 |
|
|
|
581 |
<div class="modal" id="modalFormUploadUsers">
|
|
|
582 |
<div class="modal-dialog modal-xl">
|
|
|
583 |
<div class="modal-content">
|
|
|
584 |
|
|
|
585 |
<!-- Modal Header -->
|
|
|
586 |
<div class="modal-header">
|
|
|
587 |
<h6 class="modal-title">LABEL_UPLOAD</h6>
|
|
|
588 |
</div>
|
|
|
589 |
|
|
|
590 |
<?php
|
|
|
591 |
$form = $this->formUploadUsers;
|
|
|
592 |
$form->setAttributes([
|
|
|
593 |
'method' => 'post',
|
|
|
594 |
'name' => 'form-upload-users',
|
|
|
595 |
'id' => 'form-upload-users'
|
|
|
596 |
]);
|
|
|
597 |
|
|
|
598 |
$form->prepare();
|
|
|
599 |
echo $this->form()->openTag($form);
|
|
|
600 |
?>
|
|
|
601 |
<!-- Modal body -->
|
|
|
602 |
<div class="modal-body">
|
|
|
603 |
|
|
|
604 |
|
|
|
605 |
<div class="row">
|
|
|
606 |
<div class="col-12 mt-3">
|
|
|
607 |
|
|
|
608 |
|
|
|
609 |
<?php
|
|
|
610 |
$element = $form->get('file');
|
|
|
611 |
$element->setOptions(['label' => 'LABEL_EXCEL']);
|
|
|
612 |
echo $this->formLabel($element);
|
|
|
613 |
?>
|
|
|
614 |
<div class="file-loading">
|
|
|
615 |
<?php
|
|
|
616 |
|
|
|
617 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel']);
|
|
|
618 |
echo $this->formFile($element);
|
|
|
619 |
?>
|
|
|
620 |
</div>
|
|
|
621 |
</div>
|
|
|
622 |
</div>
|
|
|
623 |
|
|
|
624 |
|
|
|
625 |
|
|
|
626 |
|
|
|
627 |
</div>
|
|
|
628 |
<div class="modal-footer text-right">
|
|
|
629 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_UPLOAD</button>
|
|
|
630 |
<button type="button" class="btn btn-sm btn-light btn-cancel">LABEL_CANCEL</button>
|
|
|
631 |
</div>
|
|
|
632 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
633 |
</div>
|
|
|
634 |
</div>
|
|
|
635 |
</div>
|
|
|
636 |
|
|
|
637 |
|
|
|
638 |
|
|
|
639 |
<!-- The Modal -->
|
|
|
640 |
<div class="modal" id="modalUploadUsers">
|
|
|
641 |
<div class="modal-dialog modal-xl">
|
|
|
642 |
<div class="modal-content">
|
|
|
643 |
|
|
|
644 |
<!-- Modal Header -->
|
|
|
645 |
<div class="modal-header">
|
|
|
646 |
<h6 class="modal-title">LABEL_USERS_FOR_COMPANY</h6>
|
|
|
647 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
|
|
648 |
</div>
|
|
|
649 |
|
|
|
650 |
<!-- Modal body -->
|
|
|
651 |
<div class="modal-body">
|
|
|
652 |
<form>
|
|
|
653 |
<input type="hidden" name="table-upload-users-key" id="table-upload-users-key">
|
|
|
654 |
</form>
|
|
|
655 |
<div class="row">
|
|
|
656 |
<div class="col-12 mt-3" style="height: 300px;overflow: scroll;">
|
|
|
657 |
<table id="gridTableUploadUsers" style="width: 100%" class="table table-bordered">
|
|
|
658 |
<thead>
|
|
|
659 |
<tr>
|
|
|
660 |
<th>LABEL_FIRST_NAME</th>
|
|
|
661 |
<th>LABEL_LAST_NAME</th>
|
|
|
662 |
<th>LABEL_EMAIL</th>
|
|
|
663 |
<th>LABEL_PASSWORD</th>
|
|
|
664 |
<th>LABEL_IS_ADULT</th>
|
|
|
665 |
</tr>
|
|
|
666 |
</thead>
|
|
|
667 |
<tbody>
|
|
|
668 |
</tbody>
|
|
|
669 |
</table>
|
|
|
670 |
|
|
|
671 |
</div>
|
|
|
672 |
</div>
|
|
|
673 |
|
|
|
674 |
|
|
|
675 |
</div>
|
|
|
676 |
|
|
|
677 |
<!-- Modal footer -->
|
|
|
678 |
<div class="modal-footer text-right">
|
|
|
679 |
<button type="submit" class="btn btn-sm btn-primary btn-upload-users-step2">LABEL_SAVE</button>
|
|
|
680 |
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
|
|
|
681 |
</div>
|
|
|
682 |
|
|
|
683 |
</div>
|
|
|
684 |
</div>
|
| 17008 |
efrain |
685 |
</div>
|