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