| 15139 |
stevensc |
1 |
<?php
|
| 1 |
www |
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
$routeDatatable = $this->url('microlearning/content/capsules');
|
|
|
10 |
|
|
|
11 |
$allowAdd = $acl->isAllowed($roleName, 'microlearning/content/capsules/add') ? 1 : 0;
|
|
|
12 |
$allowEdit = $acl->isAllowed($roleName, 'microlearning/content/capsules/edit') ? 1 : 0;
|
|
|
13 |
$allowDelete = $acl->isAllowed($roleName, 'microlearning/content/capsules/delete') ? 1 : 0;
|
|
|
14 |
$allowUsers = $acl->isAllowed($roleName, 'microlearning/content/capsules/users') ? 1 : 0;
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
| 16905 |
efrain |
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'));
|
| 1 |
www |
21 |
|
| 16822 |
efrain |
22 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
| 1 |
www |
23 |
|
|
|
24 |
|
| 16822 |
efrain |
25 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
26 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
| 1 |
www |
27 |
|
| 16843 |
efrain |
28 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
29 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
| 16822 |
efrain |
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
31 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
| 1 |
www |
34 |
|
|
|
35 |
|
|
|
36 |
|
| 16929 |
efrain |
37 |
|
|
|
38 |
|
|
|
39 |
|
| 16822 |
efrain |
40 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
41 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
| 1 |
www |
42 |
|
| 16822 |
efrain |
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
44 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
46 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
| 1 |
www |
47 |
|
|
|
48 |
|
| 16822 |
efrain |
49 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
50 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 1 |
www |
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
| 16822 |
efrain |
56 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
|
|
|
57 |
|
|
|
58 |
|
| 1 |
www |
59 |
$this->headStyle()->captureStart();
|
|
|
60 |
echo <<<CSS
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
#gridTableUsers {
|
|
|
64 |
display: flex;
|
|
|
65 |
flex-flow: column;
|
|
|
66 |
width: 100%;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
#gridTableUsers thead {
|
|
|
70 |
flex: 0 0 auto;
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
#gridTableUsers tbody {
|
|
|
74 |
flex: 1 1 auto;
|
|
|
75 |
display: block;
|
|
|
76 |
overflow-y: auto;
|
|
|
77 |
overflow-x: hidden;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
#gridTableUsers tr {
|
|
|
81 |
width: 100%;
|
|
|
82 |
display: table;
|
|
|
83 |
table-layout: fixed;
|
|
|
84 |
}
|
| 6903 |
nelberth |
85 |
.imagen-contaner{
|
|
|
86 |
border:1px solid rgb(200,200,200);
|
|
|
87 |
border-radius:5px;
|
| 6917 |
nelberth |
88 |
padding:10px;
|
|
|
89 |
display:flex;
|
|
|
90 |
flex-flow:column;
|
|
|
91 |
align-items:center;
|
| 6903 |
nelberth |
92 |
}
|
| 1 |
www |
93 |
CSS;
|
|
|
94 |
$this->headStyle()->captureEnd();
|
|
|
95 |
|
|
|
96 |
$this->headLink()->captureStart();
|
|
|
97 |
|
|
|
98 |
$this->inlineScript()->captureStart();
|
|
|
99 |
echo <<<JS
|
|
|
100 |
jQuery( document ).ready(function( $ ) {
|
|
|
101 |
|
| 17062 |
stevensc |
102 |
// Configuración de validación de formularios
|
| 1 |
www |
103 |
$.validator.setDefaults({
|
|
|
104 |
debug: true,
|
|
|
105 |
highlight: function(element) {
|
|
|
106 |
$(element).addClass('is-invalid');
|
|
|
107 |
},
|
|
|
108 |
unhighlight: function(element) {
|
|
|
109 |
$(element).removeClass('is-invalid');
|
|
|
110 |
},
|
|
|
111 |
errorElement: 'span',
|
|
|
112 |
errorClass: 'error invalid-feedback',
|
|
|
113 |
errorPlacement: function(error, element) {
|
|
|
114 |
if(element.parent('.btn-file').length) {
|
|
|
115 |
error.insertAfter(element.parent().parent());
|
|
|
116 |
} else if(element.parent('.toggle').length) {
|
|
|
117 |
error.insertAfter(element.parent().parent());
|
|
|
118 |
} else {
|
|
|
119 |
error.insertAfter(element.parent());
|
|
|
120 |
}
|
|
|
121 |
}
|
|
|
122 |
});
|
|
|
123 |
|
| 17062 |
stevensc |
124 |
// Variables de permisos
|
| 1 |
www |
125 |
var allowEdit = $allowEdit;
|
|
|
126 |
var allowDelete = $allowDelete;
|
|
|
127 |
var allowUsers = $allowUsers;
|
|
|
128 |
|
| 17062 |
stevensc |
129 |
// Configuración de la tabla principal
|
|
|
130 |
var gridTable = $('#gridTable').dataTable({
|
| 1 |
www |
131 |
'processing': true,
|
|
|
132 |
'serverSide': true,
|
|
|
133 |
'searching': true,
|
|
|
134 |
'order': [[ 0, 'asc' ]],
|
|
|
135 |
'ordering': true,
|
|
|
136 |
'ordenable' : true,
|
|
|
137 |
'responsive': true,
|
|
|
138 |
'select' : false,
|
|
|
139 |
'paging': true,
|
|
|
140 |
'pagingType': 'simple_numbers',
|
|
|
141 |
'ajax': {
|
|
|
142 |
'url' : '$routeDatatable',
|
| 17061 |
stevensc |
143 |
'type' : 'get',
|
| 1 |
www |
144 |
'beforeSend': function (request) {
|
|
|
145 |
NProgress.start();
|
|
|
146 |
},
|
|
|
147 |
'dataFilter': function(response) {
|
| 17063 |
stevensc |
148 |
var json = {
|
|
|
149 |
recordsTotal: 0,
|
|
|
150 |
recordsFiltered: 0,
|
|
|
151 |
data: []
|
|
|
152 |
};
|
| 1 |
www |
153 |
|
|
|
154 |
if(response.success) {
|
| 17063 |
stevensc |
155 |
$('#form-add').attr('action', response.data.link_add);
|
| 1 |
www |
156 |
|
| 17063 |
stevensc |
157 |
json.recordsTotal = response.data.total;
|
|
|
158 |
json.recordsFiltered = response.data.total;
|
|
|
159 |
json.data = response.data.items;
|
| 1 |
www |
160 |
} else {
|
| 17063 |
stevensc |
161 |
$.fn.showError(response.data);
|
| 1 |
www |
162 |
}
|
|
|
163 |
|
| 17063 |
stevensc |
164 |
return JSON.stringify(json);
|
| 1 |
www |
165 |
}
|
|
|
166 |
},
|
|
|
167 |
'language' : {
|
|
|
168 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
169 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
170 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
171 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
172 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
173 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
174 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
175 |
'sInfoPostFix': '',
|
|
|
176 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
177 |
'sUrl': '',
|
|
|
178 |
'sInfoThousands': ',',
|
|
|
179 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
180 |
'oPaginate': {
|
|
|
181 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
182 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
183 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
184 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
185 |
},
|
|
|
186 |
'oAria': {
|
|
|
187 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
188 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
189 |
},
|
|
|
190 |
},
|
|
|
191 |
'drawCallback': function( settings ) {
|
| 17062 |
stevensc |
192 |
NProgress.done();
|
| 1 |
www |
193 |
},
|
|
|
194 |
'aoColumns': [
|
|
|
195 |
{ 'mDataProp': 'name' },
|
|
|
196 |
{ 'mDataProp': 'details' },
|
|
|
197 |
{ 'mDataProp': 'images' },
|
|
|
198 |
{ 'mDataProp': 'actions' },
|
|
|
199 |
],
|
|
|
200 |
'columnDefs': [
|
|
|
201 |
{
|
|
|
202 |
'targets': 0,
|
|
|
203 |
'className' : 'text-vertical-middle',
|
|
|
204 |
},
|
|
|
205 |
{
|
|
|
206 |
'targets': -3,
|
|
|
207 |
'orderable': false,
|
|
|
208 |
'render' : function ( data, type, row ) {
|
|
|
209 |
var s = '';
|
|
|
210 |
s += 'LABEL_STATUS: ' + data['status'] + '<br/>';
|
|
|
211 |
|
|
|
212 |
if(allowUsers && row['actions']['link_total_users'] ) {
|
| 16932 |
efrain |
213 |
s += 'LABEL_TOTAL_USERS: ' + data['total_users'] + ' <button class="btn btn-view-total-users" data-href="' + row['actions']['link_total_users'] + '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link-alt"></i></button> <br>';
|
| 1 |
www |
214 |
} else {
|
|
|
215 |
s += 'LABEL_TOTAL_USERS: ' + data['total_users'] + '<br/>';
|
|
|
216 |
}
|
|
|
217 |
if(allowUsers && row['actions']['link_total_users_actives'] ) {
|
| 16932 |
efrain |
218 |
s += 'LABEL_TOTAL_USERS_ACTIVE: ' + data['total_users_active'] + ' <button class="btn btn-view-total-users" data-href="' + row['actions']['link_total_users_actives'] + '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link-alt"></i></button> <br>';
|
| 1 |
www |
219 |
} else {
|
|
|
220 |
s += 'LABEL_TOTAL_USERS_ACTIVE: ' + data['total_users_active'] + '<br/>';
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
return s;
|
|
|
224 |
}
|
|
|
225 |
},
|
|
|
226 |
{
|
|
|
227 |
'targets': -2,
|
|
|
228 |
'orderable': false,
|
|
|
229 |
'render' : function ( data, type, row ) {
|
|
|
230 |
s = '';
|
|
|
231 |
|
| 6903 |
nelberth |
232 |
if( data['marketplace'] ) {
|
|
|
233 |
s = s + ' <img class="btn-view-image-marketplace" data-href="' + data['marketplace'] + '" data-toggle="tooltip" src="'+data['marketplace']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
|
| 1 |
www |
234 |
} else {
|
|
|
235 |
s = s + '';
|
|
|
236 |
}
|
| 6903 |
nelberth |
237 |
|
|
|
238 |
if( data['image'] ) {
|
|
|
239 |
s = s + ' <img class="btn-view-image-app" data-href="' + data['image'] + '" data-toggle="tooltip" src="'+data['image']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
|
| 1 |
www |
240 |
} else {
|
|
|
241 |
s = s + '';
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
|
|
|
245 |
|
| 6903 |
nelberth |
246 |
|
|
|
247 |
|
| 1 |
www |
248 |
return s;
|
|
|
249 |
}
|
|
|
250 |
},
|
|
|
251 |
{
|
|
|
252 |
'targets': -1,
|
|
|
253 |
'orderable': false,
|
|
|
254 |
'render' : function ( data, type, row ) {
|
|
|
255 |
s = '';
|
|
|
256 |
|
|
|
257 |
if(allowEdit && data['link_edit'] ) {
|
| 16906 |
efrain |
258 |
s = s + '<button class="btn btn-info btn-sm btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button> ';
|
| 1 |
www |
259 |
}
|
|
|
260 |
if(allowDelete && data['link_delete'] ) {
|
|
|
261 |
s = s + '<button class="btn btn-danger btn-sm btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';
|
|
|
262 |
}
|
|
|
263 |
|
|
|
264 |
return s;
|
|
|
265 |
}
|
|
|
266 |
}
|
| 17062 |
stevensc |
267 |
],
|
| 1 |
www |
268 |
});
|
|
|
269 |
|
|
|
270 |
|
| 17061 |
stevensc |
271 |
var seleccionarCampo;
|
| 16905 |
efrain |
272 |
var validatorAdd = $('#form-add').validate({
|
| 1 |
www |
273 |
debug: true,
|
|
|
274 |
onclick: false,
|
|
|
275 |
onkeyup: false,
|
|
|
276 |
ignore: [],
|
|
|
277 |
rules: {
|
|
|
278 |
'name': {
|
|
|
279 |
required: true,
|
|
|
280 |
maxlength: 128,
|
|
|
281 |
},
|
|
|
282 |
'description': {
|
|
|
283 |
updateCkeditor:function() {
|
|
|
284 |
CKEDITOR.instances.description_add.updateElement();
|
|
|
285 |
},
|
|
|
286 |
required: true
|
|
|
287 |
},
|
|
|
288 |
'file': {
|
|
|
289 |
required: true,
|
| 16905 |
efrain |
290 |
extension: 'jpg|jpeg|png',
|
|
|
291 |
accept: 'image/jpg,image/jpeg,image/png'
|
| 1 |
www |
292 |
},
|
|
|
293 |
'order' : {
|
|
|
294 |
required: true,
|
|
|
295 |
digits: true,
|
|
|
296 |
min: 1,
|
|
|
297 |
max: 250
|
|
|
298 |
},
|
|
|
299 |
'marketplace': {
|
| 16905 |
efrain |
300 |
required: false,
|
|
|
301 |
extension: 'jpg|jpeg|png',
|
|
|
302 |
accept: 'image/jpg,image/jpeg,image/png'
|
| 1 |
www |
303 |
},
|
|
|
304 |
'status' : {
|
|
|
305 |
required: true,
|
|
|
306 |
},
|
|
|
307 |
'privacy' : {
|
|
|
308 |
required: true,
|
|
|
309 |
},
|
|
|
310 |
'type' : {
|
|
|
311 |
required: true,
|
|
|
312 |
},
|
|
|
313 |
'cost' : {
|
|
|
314 |
required: function() {
|
| 16905 |
efrain |
315 |
return $('#form-add #type').val() == 's';
|
| 1 |
www |
316 |
},
|
|
|
317 |
'number' : true,
|
|
|
318 |
'min' : 0
|
|
|
319 |
}
|
|
|
320 |
},
|
|
|
321 |
submitHandler: function(form)
|
|
|
322 |
{
|
|
|
323 |
var formdata = false;
|
|
|
324 |
if (window.FormData){
|
|
|
325 |
formdata = new FormData(form); //form[0]);
|
|
|
326 |
}
|
|
|
327 |
|
| 16945 |
efrain |
328 |
|
| 6859 |
nelberth |
329 |
NProgress.start();
|
| 1 |
www |
330 |
$.ajax({
|
|
|
331 |
'dataType' : 'json',
|
|
|
332 |
'accept' : 'application/json',
|
|
|
333 |
'method' : 'post',
|
| 16905 |
efrain |
334 |
'url' : $('#form-add').attr('action'),
|
| 1 |
www |
335 |
'data' : formdata,
|
|
|
336 |
'processData': false,
|
|
|
337 |
'contentType': false,
|
|
|
338 |
}).done(function(response) {
|
|
|
339 |
if(response['success']) {
|
|
|
340 |
$.fn.showSuccess(response['data']);
|
| 16905 |
efrain |
341 |
|
|
|
342 |
gridTable.api().ajax.reload(null, false);
|
|
|
343 |
|
|
|
344 |
$('#row-add').hide();
|
|
|
345 |
$('#row-edit').hide();
|
|
|
346 |
$('#row-listing').show();
|
|
|
347 |
|
|
|
348 |
|
| 1 |
www |
349 |
} else {
|
|
|
350 |
validatorAdd.resetForm();
|
|
|
351 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
352 |
$.fn.showError(response['data']);
|
|
|
353 |
} else {
|
|
|
354 |
$.each(response['data'], function( fieldname, errors ) {
|
| 16905 |
efrain |
355 |
$.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
|
| 1 |
www |
356 |
});
|
|
|
357 |
}
|
|
|
358 |
}
|
|
|
359 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
| 6936 |
nelberth |
360 |
console.log(jqXHR)
|
| 1 |
www |
361 |
$.fn.showError(textStatus);
|
|
|
362 |
}).always(function() {
|
| 16945 |
efrain |
363 |
|
| 1 |
www |
364 |
NProgress.done();
|
|
|
365 |
});
|
|
|
366 |
return false;
|
|
|
367 |
},
|
|
|
368 |
invalidHandler: function(form, validator) {
|
|
|
369 |
|
|
|
370 |
}
|
|
|
371 |
});
|
|
|
372 |
|
| 16905 |
efrain |
373 |
var validatorEdit = $('#form-edit').validate({
|
| 1 |
www |
374 |
debug: true,
|
|
|
375 |
onclick: false,
|
|
|
376 |
onkeyup: false,
|
|
|
377 |
ignore: [],
|
|
|
378 |
rules: {
|
|
|
379 |
'name': {
|
|
|
380 |
required: true,
|
|
|
381 |
maxlength: 128,
|
|
|
382 |
},
|
|
|
383 |
'description': {
|
|
|
384 |
updateCkeditor:function() {
|
|
|
385 |
CKEDITOR.instances.description_edit.updateElement();
|
|
|
386 |
},
|
|
|
387 |
required: true
|
|
|
388 |
},
|
|
|
389 |
'file': {
|
| 16905 |
efrain |
390 |
required: false,
|
|
|
391 |
extension: 'jpg|jpeg|png',
|
|
|
392 |
accept: 'image/jpg,image/jpeg,image/png'
|
| 1 |
www |
393 |
},
|
|
|
394 |
'order' : {
|
|
|
395 |
required: true,
|
|
|
396 |
digits: true,
|
|
|
397 |
min: 1,
|
|
|
398 |
max: 250
|
|
|
399 |
},
|
|
|
400 |
'marketplace': {
|
| 16905 |
efrain |
401 |
required: false,
|
|
|
402 |
extension: 'jpg|jpeg|png',
|
|
|
403 |
accept: 'image/jpg,image/jpeg,image/png'
|
| 1 |
www |
404 |
},
|
|
|
405 |
'status' : {
|
|
|
406 |
required: true,
|
|
|
407 |
},
|
|
|
408 |
'privacy' : {
|
|
|
409 |
required: true,
|
|
|
410 |
},
|
|
|
411 |
'type' : {
|
|
|
412 |
required: true,
|
|
|
413 |
},
|
|
|
414 |
'cost' : {
|
|
|
415 |
required: function() {
|
| 16905 |
efrain |
416 |
return $('#form-edit #type').val() == 's';
|
| 1 |
www |
417 |
},
|
|
|
418 |
'number' : true,
|
|
|
419 |
'min' : 0
|
|
|
420 |
}
|
|
|
421 |
},
|
|
|
422 |
submitHandler: function(form)
|
|
|
423 |
{
|
|
|
424 |
var formdata = false;
|
|
|
425 |
if (window.FormData){
|
|
|
426 |
formdata = new FormData(form); //form[0]);
|
|
|
427 |
}
|
|
|
428 |
|
| 16945 |
efrain |
429 |
|
| 6992 |
nelberth |
430 |
NProgress.start();
|
| 1 |
www |
431 |
$.ajax({
|
|
|
432 |
'dataType' : 'json',
|
|
|
433 |
'accept' : 'application/json',
|
|
|
434 |
'method' : 'post',
|
| 16905 |
efrain |
435 |
'url' : $('#form-edit').attr('action'),
|
| 1 |
www |
436 |
'data' : formdata,
|
|
|
437 |
'processData': false,
|
|
|
438 |
'contentType': false,
|
|
|
439 |
}).done(function(response) {
|
|
|
440 |
if(response['success']) {
|
|
|
441 |
$.fn.showSuccess(response['data']);
|
| 16905 |
efrain |
442 |
|
| 1 |
www |
443 |
gridTable.api().ajax.reload(null, false);
|
| 16905 |
efrain |
444 |
|
|
|
445 |
$('#row-add').hide();
|
|
|
446 |
$('#row-edit').hide();
|
|
|
447 |
$('#row-listing').show();
|
|
|
448 |
|
|
|
449 |
|
| 1 |
www |
450 |
} else {
|
| 16905 |
efrain |
451 |
validatorEdit.resetForm();
|
| 1 |
www |
452 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
453 |
$.fn.showError(response['data']);
|
|
|
454 |
} else {
|
|
|
455 |
$.each(response['data'], function( fieldname, errors ) {
|
| 16905 |
efrain |
456 |
$.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
|
| 1 |
www |
457 |
});
|
|
|
458 |
}
|
|
|
459 |
}
|
|
|
460 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
| 16905 |
efrain |
461 |
|
| 1 |
www |
462 |
$.fn.showError(textStatus);
|
|
|
463 |
}).always(function() {
|
| 6996 |
nelberth |
464 |
|
| 16905 |
efrain |
465 |
|
| 1 |
www |
466 |
NProgress.done();
|
|
|
467 |
});
|
|
|
468 |
return false;
|
|
|
469 |
},
|
|
|
470 |
invalidHandler: function(form, validator) {
|
|
|
471 |
|
|
|
472 |
}
|
|
|
473 |
});
|
|
|
474 |
|
|
|
475 |
|
|
|
476 |
|
|
|
477 |
$('body').on('click', '.btn-view-image-marketplace', function(e) {
|
|
|
478 |
e.preventDefault();
|
|
|
479 |
|
|
|
480 |
$('#image-marketplace').attr('src', $(this).data('href'));
|
| 16905 |
efrain |
481 |
$('#modalPreviewMarketPlace').modal('show');
|
| 1 |
www |
482 |
return false;
|
|
|
483 |
});
|
|
|
484 |
|
|
|
485 |
$('body').on('click', '.btn-view-image-app', function(e) {
|
|
|
486 |
e.preventDefault();
|
|
|
487 |
|
|
|
488 |
$('#image-app').attr('src', $(this).data('href'));
|
| 16905 |
efrain |
489 |
$('#modalPreviewImage').modal('show');
|
| 1 |
www |
490 |
return false;
|
|
|
491 |
});
|
|
|
492 |
|
| 16905 |
efrain |
493 |
$('#form-add #order').inputNumberFormat({decimal: 0});
|
| 1 |
www |
494 |
|
|
|
495 |
|
|
|
496 |
|
|
|
497 |
|
|
|
498 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
499 |
e.preventDefault();
|
|
|
500 |
|
| 16905 |
efrain |
501 |
$('#form-add #name').val('');
|
|
|
502 |
$('#form-add #order').val('1');
|
| 1 |
www |
503 |
|
| 16905 |
efrain |
504 |
$('#form-add #privacy').val('');
|
|
|
505 |
$('#form-add #status').val('');
|
|
|
506 |
$('#form-add #cost').val('');
|
|
|
507 |
$('#form-add #form-row-cost').hide();
|
|
|
508 |
$('#form-add #file').fileinput('reset');
|
|
|
509 |
$('#form-add #file').val('');
|
|
|
510 |
$('#form-add #marketplace').fileinput('reset');
|
|
|
511 |
$('#form-add #marketplace').val('');
|
| 1 |
www |
512 |
|
|
|
513 |
CKEDITOR.instances.description_add.setData('');
|
|
|
514 |
validatorAdd.resetForm();
|
|
|
515 |
|
| 16905 |
efrain |
516 |
$('#row-listing').hide();
|
|
|
517 |
$('#row-edit').hide();
|
|
|
518 |
$('#row-add').show();
|
| 1 |
www |
519 |
});
|
|
|
520 |
|
|
|
521 |
|
| 16905 |
efrain |
522 |
$('#form-edit #order').inputNumberFormat({decimal: 0});
|
| 1 |
www |
523 |
|
| 6859 |
nelberth |
524 |
|
| 1 |
www |
525 |
|
| 6991 |
nelberth |
526 |
|
| 1 |
www |
527 |
|
|
|
528 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
529 |
e.preventDefault();
|
| 7045 |
nelberth |
530 |
NProgress.start();
|
| 1 |
www |
531 |
var url = $(this).data('href');
|
|
|
532 |
$.ajax({
|
|
|
533 |
'dataType' : 'json',
|
|
|
534 |
'accept' : 'application/json',
|
|
|
535 |
'method' : 'get',
|
|
|
536 |
'url' : url,
|
|
|
537 |
}).done(function(response) {
|
|
|
538 |
if(response['success']) {
|
| 6980 |
nelberth |
539 |
console.log(response)
|
| 16905 |
efrain |
540 |
$('#form-edit').attr('action',url);
|
|
|
541 |
$('#form-edit #name').val(response['data']['name']);
|
|
|
542 |
$('#form-edit #order').val(response['data']['order']);
|
|
|
543 |
$('#form-edit #privacy').val(response['data']['privacy']);
|
|
|
544 |
$('#form-edit #type').val(response['data']['type']);
|
|
|
545 |
$('#form-edit #status').val(response['data']['status']);
|
| 1 |
www |
546 |
|
|
|
547 |
if('s' == response['data']['type']) {
|
| 16905 |
efrain |
548 |
$('#form-edit #form-row-cost').show();
|
|
|
549 |
$('#form-edit #cost').val(response['data']['cost']);
|
| 1 |
www |
550 |
} else {
|
| 16905 |
efrain |
551 |
$('#form-edit #form-row-cost').hide();
|
|
|
552 |
$('#form-edit #cost').val('');
|
| 1 |
www |
553 |
}
|
| 16905 |
efrain |
554 |
|
| 16945 |
efrain |
555 |
$('#form-edit #file').fileinput('reset');
|
|
|
556 |
$('#form-edit #file').val('');
|
|
|
557 |
$('#form-edit #marketplace').fileinput('reset');
|
|
|
558 |
$('#form-edit #marketplace').val('');
|
| 1 |
www |
559 |
|
|
|
560 |
CKEDITOR.instances.description_edit.setData(response['data']['description']);
|
|
|
561 |
validatorEdit.resetForm();
|
| 15027 |
stevensc |
562 |
|
| 16905 |
efrain |
563 |
$('#row-listing').hide();
|
|
|
564 |
$('#row-add').hide();
|
|
|
565 |
$('#row-edit').show();
|
|
|
566 |
|
| 1 |
www |
567 |
} else {
|
|
|
568 |
validatorEdit.resetForm();
|
|
|
569 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
570 |
$.fn.showError(response['data']);
|
|
|
571 |
} else {
|
|
|
572 |
$.each(response['data'], function( fieldname, errors ) {
|
| 16905 |
efrain |
573 |
$.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
|
| 1 |
www |
574 |
});
|
|
|
575 |
}
|
|
|
576 |
}
|
|
|
577 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
578 |
$.fn.showError(textStatus);
|
|
|
579 |
}).always(function() {
|
|
|
580 |
NProgress.done();
|
|
|
581 |
});
|
|
|
582 |
});
|
|
|
583 |
|
| 6886 |
nelberth |
584 |
|
| 1 |
www |
585 |
|
|
|
586 |
|
| 8290 |
stevensc |
587 |
CKEDITOR.replace('description_add', {
|
|
|
588 |
toolbar: [
|
|
|
589 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
590 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
591 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
592 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
593 |
'/',
|
|
|
594 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
595 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
596 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
597 |
],
|
|
|
598 |
removePlugins: 'elementspath,Anchor',
|
|
|
599 |
heigth: 100
|
|
|
600 |
});
|
|
|
601 |
CKEDITOR.replace('description_edit', {
|
|
|
602 |
toolbar: [
|
|
|
603 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
604 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
605 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
606 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
607 |
'/',
|
|
|
608 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
609 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
610 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
611 |
],
|
|
|
612 |
removePlugins: 'elementspath,Anchor',
|
|
|
613 |
heigth: 100
|
|
|
614 |
});
|
| 1 |
www |
615 |
|
| 16905 |
efrain |
616 |
$('#form-add #type').change(function(e) {
|
| 1 |
www |
617 |
e.preventDefault();
|
|
|
618 |
|
|
|
619 |
if('s' == $(this).val()) {
|
| 16905 |
efrain |
620 |
$('#form-add #form-row-cost').show();
|
| 1 |
www |
621 |
} else {
|
| 16905 |
efrain |
622 |
$('#form-add #cost').val(0);
|
|
|
623 |
$('#form-add #form-row-cost').hide();
|
| 1 |
www |
624 |
}
|
|
|
625 |
|
|
|
626 |
});
|
|
|
627 |
|
| 16905 |
efrain |
628 |
$('#form-edit #type').change(function(e) {
|
| 1 |
www |
629 |
e.preventDefault();
|
|
|
630 |
|
|
|
631 |
if('s' == $(this).val()) {
|
| 16905 |
efrain |
632 |
$('#form-edit #form-row-cost').show();
|
| 1 |
www |
633 |
} else {
|
| 16905 |
efrain |
634 |
$('#form-edit #cost').val(0);
|
|
|
635 |
$('#form-edit #form-row-cost').hide();
|
| 1 |
www |
636 |
}
|
|
|
637 |
|
|
|
638 |
});
|
|
|
639 |
|
| 16905 |
efrain |
640 |
$('#form-add #order').inputNumberFormat({decimal: 0});
|
|
|
641 |
$('#form-add #cost').inputNumberFormat({decimal: 2});
|
| 1 |
www |
642 |
|
|
|
643 |
$('#form-filter #topic_uuid').change(function(e) {
|
|
|
644 |
e.preventDefault();
|
|
|
645 |
|
|
|
646 |
gridTable.api().ajax.reload(null, false);
|
|
|
647 |
|
|
|
648 |
});
|
|
|
649 |
|
|
|
650 |
|
|
|
651 |
|
|
|
652 |
|
|
|
653 |
|
|
|
654 |
$('body').on('click', 'button.btn-view-total-users', function(e) {
|
|
|
655 |
e.preventDefault();
|
|
|
656 |
|
|
|
657 |
var href = $(this).data('href');
|
|
|
658 |
NProgress.start();
|
|
|
659 |
$.ajax({
|
|
|
660 |
'dataType' : 'json',
|
|
|
661 |
'accept' : 'application/json',
|
|
|
662 |
'method' : 'get',
|
|
|
663 |
'url' : href,
|
|
|
664 |
}).done(function(response) {
|
|
|
665 |
if(response['success']) {
|
| 17061 |
stevensc |
666 |
$('#table-users-capsule').val(response['data']['capsule']);
|
| 1 |
www |
667 |
|
|
|
668 |
$('#gridTableUsers tbody').empty();
|
|
|
669 |
|
|
|
670 |
$.each(response['data']['items'], function(index, item) {
|
|
|
671 |
var s = '<tr>';
|
|
|
672 |
s = s + '<td>' + item['first_name'] + '</td>';
|
|
|
673 |
s = s + '<td>' + item['last_name'] + '</td>';
|
|
|
674 |
s = s + '<td>' + item['email'] + '</td>';
|
|
|
675 |
|
|
|
676 |
s = s + '<td>';
|
|
|
677 |
if(item['details']['access']) {
|
|
|
678 |
s = s + 'LABEL_ACCESS : ' + item['details']['access'] + '<br>';
|
|
|
679 |
}
|
|
|
680 |
if(item['details']['paid_from']) {
|
|
|
681 |
s = s + 'LABEL_PAID_FROM : ' + item['details']['paid_from'] + '<br>';
|
|
|
682 |
}
|
|
|
683 |
if(item['details']['paid_to']) {
|
|
|
684 |
s = s + 'LABEL_PAID_TO : ' + item['details']['paid_to'] + '<br>';
|
|
|
685 |
}
|
|
|
686 |
|
|
|
687 |
s = s + '</td>';
|
|
|
688 |
s = s + '</tr>';
|
|
|
689 |
|
|
|
690 |
$('#gridTableUsers tbody').append(s);
|
|
|
691 |
});
|
|
|
692 |
|
|
|
693 |
$('#notificationUsersModal').modal('show');
|
|
|
694 |
} else {
|
|
|
695 |
$.fn.showError(response['data']);
|
|
|
696 |
}
|
|
|
697 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
698 |
$.fn.showError(textStatus);
|
|
|
699 |
}).always(function() {
|
|
|
700 |
NProgress.done();
|
|
|
701 |
});
|
|
|
702 |
return false;
|
|
|
703 |
});
|
|
|
704 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
705 |
e.preventDefault();
|
|
|
706 |
gridTable.api().ajax.reload(null, false);
|
|
|
707 |
});
|
| 16822 |
efrain |
708 |
|
|
|
709 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
710 |
e.preventDefault();
|
|
|
711 |
var action = $(this).data('href');
|
|
|
712 |
|
|
|
713 |
|
|
|
714 |
swal.fire({
|
|
|
715 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
716 |
icon: 'question',
|
|
|
717 |
cancelButtonText: 'LABEL_NO',
|
|
|
718 |
showCancelButton: true,
|
|
|
719 |
confirmButtonText: 'LABEL_YES'
|
|
|
720 |
}).then((result) => {
|
|
|
721 |
if (result.isConfirmed) {
|
|
|
722 |
|
|
|
723 |
NProgress.start();
|
|
|
724 |
$.ajax({
|
|
|
725 |
'dataType' : 'json',
|
|
|
726 |
'accept' : 'application/json',
|
|
|
727 |
'method' : 'post',
|
|
|
728 |
'url' : action,
|
|
|
729 |
}).done(function(response) {
|
|
|
730 |
if(response['success']) {
|
|
|
731 |
$.fn.showSuccess(response['data']);
|
|
|
732 |
gridTable.api().ajax.reload(null, false);
|
|
|
733 |
} else {
|
|
|
734 |
$.fn.showError(response['data']);
|
|
|
735 |
}
|
|
|
736 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
737 |
$.fn.showError(textStatus);
|
|
|
738 |
}).always(function() {
|
|
|
739 |
NProgress.done();
|
|
|
740 |
});
|
|
|
741 |
}
|
|
|
742 |
});
|
|
|
743 |
});
|
| 1 |
www |
744 |
|
| 6682 |
nelberth |
745 |
|
| 16905 |
efrain |
746 |
$('#form-add #file').fileinput({
|
|
|
747 |
theme: 'fa',
|
|
|
748 |
language: 'es',
|
|
|
749 |
showUpload: false,
|
|
|
750 |
dropZoneEnabled: false,
|
|
|
751 |
maxFileCount: 1,
|
| 16928 |
efrain |
752 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
|
| 16905 |
efrain |
753 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
754 |
});
|
| 6682 |
nelberth |
755 |
|
| 16905 |
efrain |
756 |
$('#form-add #marketplace').fileinput({
|
|
|
757 |
theme: 'fa',
|
|
|
758 |
language: 'es',
|
|
|
759 |
showUpload: false,
|
|
|
760 |
dropZoneEnabled: false,
|
|
|
761 |
maxFileCount: 1,
|
| 16928 |
efrain |
762 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $marketplace_size',
|
| 16905 |
efrain |
763 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
764 |
});
|
|
|
765 |
|
|
|
766 |
$('#form-edit #file').fileinput({
|
|
|
767 |
theme: 'fa',
|
|
|
768 |
language: 'es',
|
|
|
769 |
showUpload: false,
|
|
|
770 |
dropZoneEnabled: false,
|
|
|
771 |
maxFileCount: 1,
|
| 16928 |
efrain |
772 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
|
| 16905 |
efrain |
773 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
774 |
});
|
| 6682 |
nelberth |
775 |
|
| 16945 |
efrain |
776 |
$('#form-edit #marketplace').fileinput({
|
| 16905 |
efrain |
777 |
theme: 'fa',
|
|
|
778 |
language: 'es',
|
|
|
779 |
showUpload: false,
|
|
|
780 |
dropZoneEnabled: false,
|
|
|
781 |
maxFileCount: 1,
|
| 16928 |
efrain |
782 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $marketplace_size',
|
| 16905 |
efrain |
783 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
784 |
});
|
|
|
785 |
|
|
|
786 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
787 |
e.preventDefault();
|
|
|
788 |
$('#row-add').hide();
|
|
|
789 |
$('#row-edit').hide();
|
|
|
790 |
$('#row-listing').show();
|
|
|
791 |
|
|
|
792 |
});
|
| 8583 |
nelberth |
793 |
|
| 1 |
www |
794 |
});
|
|
|
795 |
JS;
|
|
|
796 |
$this->inlineScript()->captureEnd();
|
|
|
797 |
?>
|
|
|
798 |
|
| 15139 |
stevensc |
799 |
|
| 16905 |
efrain |
800 |
<div class="container">
|
|
|
801 |
<div class="card" id="row-listing">
|
|
|
802 |
<div class="card-header">
|
|
|
803 |
<h6 class="card-title">LABEL_CAPSULES</h6>
|
|
|
804 |
</div>
|
|
|
805 |
<div class="card-body">
|
|
|
806 |
<div class="row">
|
|
|
807 |
<div class="col-12 mt-3">
|
| 17061 |
stevensc |
808 |
<table id="gridTable" class="table table-bordered">
|
| 15139 |
stevensc |
809 |
<thead>
|
|
|
810 |
<tr>
|
|
|
811 |
<th>LABEL_NAME</th>
|
|
|
812 |
<th>LABEL_DETAILS</th>
|
|
|
813 |
<th>LABEL_IMAGES</th>
|
|
|
814 |
<th>LABEL_ACTIONS</th>
|
|
|
815 |
</tr>
|
|
|
816 |
</thead>
|
| 16905 |
efrain |
817 |
<tbody>
|
|
|
818 |
</tbody>
|
|
|
819 |
</table>
|
|
|
820 |
</div>
|
|
|
821 |
</div>
|
|
|
822 |
</div>
|
|
|
823 |
<div class="card-footer text-right">
|
| 16992 |
efrain |
824 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
| 16905 |
efrain |
825 |
<?php if ($allowAdd) : ?>
|
|
|
826 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
827 |
<?php endif; ?>
|
|
|
828 |
</div>
|
| 15139 |
stevensc |
829 |
</div>
|
| 16905 |
efrain |
830 |
|
|
|
831 |
<div class="card" id="row-add" style="display: none">
|
|
|
832 |
<div class="card-header">
|
|
|
833 |
<h6 class="card-title">LABEL_ADD_CAPSULE</h6>
|
|
|
834 |
</div>
|
|
|
835 |
<?php
|
| 15139 |
stevensc |
836 |
$form = $this->formAdd;
|
|
|
837 |
$form->setAttributes([
|
|
|
838 |
'method' => 'post',
|
|
|
839 |
'action' => '',
|
| 16905 |
efrain |
840 |
'name' => 'form-add',
|
|
|
841 |
'id' => 'form-add',
|
| 15139 |
stevensc |
842 |
]);
|
| 1 |
www |
843 |
|
| 15139 |
stevensc |
844 |
$form->prepare();
|
|
|
845 |
echo $this->form()->openTag($form);
|
|
|
846 |
?>
|
| 16905 |
efrain |
847 |
<div class="card-body">
|
|
|
848 |
<div class="row">
|
|
|
849 |
<div class="col-12 mt-3">
|
|
|
850 |
<?php
|
|
|
851 |
$element = $form->get('name');
|
|
|
852 |
|
|
|
853 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
854 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
855 |
echo $this->formLabel($element);
|
|
|
856 |
echo $this->formText($element);
|
|
|
857 |
?>
|
|
|
858 |
</div>
|
|
|
859 |
</div>
|
|
|
860 |
<div class="row">
|
|
|
861 |
<div class="col-12 mt-3">
|
|
|
862 |
<?php
|
|
|
863 |
$element = $form->get('description');
|
|
|
864 |
$element->setAttributes(['id' => 'description_add', 'class' => 'form-control', 'rows' => '2', 'class' => 'form-control']);
|
|
|
865 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
866 |
echo $this->formLabel($element);
|
|
|
867 |
echo $this->formTextArea($element);
|
|
|
868 |
?>
|
|
|
869 |
</div>
|
|
|
870 |
</div>
|
|
|
871 |
<div class="row">
|
|
|
872 |
<div class="col-12 mt-3">
|
|
|
873 |
<?php
|
|
|
874 |
$element = $form->get('order');
|
|
|
875 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
876 |
$element->setOptions(['label' => 'LABEL_ORDER']);
|
|
|
877 |
echo $this->formLabel($element);
|
|
|
878 |
echo $this->formText($element);
|
|
|
879 |
?>
|
|
|
880 |
</div>
|
| 15139 |
stevensc |
881 |
</div>
|
| 16905 |
efrain |
882 |
<div class="row">
|
|
|
883 |
<div class="col-12 mt-3">
|
|
|
884 |
<?php
|
|
|
885 |
$element = $form->get('status');
|
|
|
886 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
887 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
888 |
echo $this->formLabel($element);
|
|
|
889 |
echo $this->formSelect($element);
|
|
|
890 |
?>
|
|
|
891 |
</div>
|
|
|
892 |
</div>
|
|
|
893 |
<div class="row">
|
|
|
894 |
<div class="col-12 mt-3">
|
|
|
895 |
<?php
|
|
|
896 |
$element = $form->get('privacy');
|
|
|
897 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
898 |
$element->setOptions(['label' => 'LABEL_PRIVACY']);
|
|
|
899 |
echo $this->formLabel($element);
|
|
|
900 |
echo $this->formSelect($element);
|
|
|
901 |
?>
|
|
|
902 |
</div>
|
|
|
903 |
</div>
|
|
|
904 |
<div class="row">
|
|
|
905 |
<div class="col-12 mt-3">
|
|
|
906 |
<?php
|
|
|
907 |
$element = $form->get('type');
|
|
|
908 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
909 |
$element->setOptions(['label' => 'LABEL_TYPE']);
|
|
|
910 |
echo $this->formLabel($element);
|
|
|
911 |
echo $this->formSelect($element);
|
|
|
912 |
?>
|
|
|
913 |
</div>
|
|
|
914 |
</div>
|
| 15139 |
stevensc |
915 |
|
| 16905 |
efrain |
916 |
<div class="row" id="form-row-cost">
|
|
|
917 |
<div class="col-12 mt-3">
|
|
|
918 |
<?php
|
|
|
919 |
$element = $form->get('cost');
|
|
|
920 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
921 |
$element->setOptions(['label' => 'LABEL_COST']);
|
|
|
922 |
echo $this->formLabel($element);
|
|
|
923 |
echo $this->formText($element);
|
|
|
924 |
?>
|
|
|
925 |
</div>
|
|
|
926 |
</div>
|
|
|
927 |
<div class="row">
|
|
|
928 |
<div class="col-12 mt-3">
|
|
|
929 |
<?php
|
|
|
930 |
$element = $form->get('file');
|
|
|
931 |
$element->setOptions(['label' => 'LABEL_IMAGE']);
|
|
|
932 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
933 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
934 |
echo $this->formLabel($element);
|
|
|
935 |
echo $this->formFile($element);
|
|
|
936 |
?>
|
|
|
937 |
</div>
|
|
|
938 |
</div>
|
|
|
939 |
<div class="row">
|
|
|
940 |
<div class="col-12 mt-3">
|
|
|
941 |
<?php
|
|
|
942 |
$element = $form->get('marketplace');
|
|
|
943 |
$element->setOptions(['label' => 'LABEL_MARKETPLACE']);
|
|
|
944 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
945 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
946 |
echo $this->formLabel($element);
|
|
|
947 |
echo $this->formFile($element);
|
|
|
948 |
?>
|
|
|
949 |
</div>
|
|
|
950 |
</div>
|
|
|
951 |
</div>
|
|
|
952 |
<div class="card-footer text-right">
|
|
|
953 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
954 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
|
|
955 |
</div>
|
|
|
956 |
<?php echo $this->form()->closeTag($form); ?>
|
| 15139 |
stevensc |
957 |
</div>
|
| 16905 |
efrain |
958 |
|
|
|
959 |
<div class="card" id="row-edit" style="display: none">
|
|
|
960 |
<div class="card-header">
|
|
|
961 |
<h6 class="card-title">LABEL_EDIT_CAPSULE</h6>
|
|
|
962 |
</div>
|
|
|
963 |
<?php
|
| 15139 |
stevensc |
964 |
$form = $this->formEdit;
|
|
|
965 |
$form->setAttributes([
|
| 16905 |
efrain |
966 |
'method' => 'post',
|
|
|
967 |
'name' => 'form-edit',
|
|
|
968 |
'id' => 'form-edit'
|
| 15139 |
stevensc |
969 |
]);
|
| 1 |
www |
970 |
|
| 15139 |
stevensc |
971 |
$form->prepare();
|
|
|
972 |
echo $this->form()->openTag($form);
|
|
|
973 |
?>
|
| 16905 |
efrain |
974 |
<div class="card-body">
|
|
|
975 |
<div class="row">
|
|
|
976 |
<div class="col-12 mt-3">
|
|
|
977 |
<?php
|
|
|
978 |
$element = $form->get('name');
|
|
|
979 |
|
|
|
980 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
981 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
982 |
echo $this->formLabel($element);
|
|
|
983 |
echo $this->formText($element);
|
|
|
984 |
?>
|
|
|
985 |
</div>
|
|
|
986 |
</div>
|
|
|
987 |
<div class="row">
|
|
|
988 |
<div class="col-12 mt-3">
|
|
|
989 |
<?php
|
|
|
990 |
$element = $form->get('description');
|
|
|
991 |
$element->setAttributes(['id' => 'description_edit', 'class' => 'form-control', 'rows' => '2', 'class' => 'form-control']);
|
|
|
992 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
993 |
echo $this->formLabel($element);
|
|
|
994 |
echo $this->formTextArea($element);
|
|
|
995 |
?>
|
|
|
996 |
</div>
|
|
|
997 |
</div>
|
|
|
998 |
<div class="row">
|
|
|
999 |
<div class="col-12 mt-3">
|
|
|
1000 |
<?php
|
|
|
1001 |
$element = $form->get('order');
|
|
|
1002 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1003 |
$element->setOptions(['label' => 'LABEL_ORDER']);
|
|
|
1004 |
echo $this->formLabel($element);
|
|
|
1005 |
echo $this->formText($element);
|
|
|
1006 |
?>
|
|
|
1007 |
</div>
|
| 15139 |
stevensc |
1008 |
</div>
|
| 16905 |
efrain |
1009 |
<div class="row">
|
|
|
1010 |
<div class="col-12 mt-3">
|
|
|
1011 |
<?php
|
|
|
1012 |
$element = $form->get('status');
|
|
|
1013 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1014 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
1015 |
echo $this->formLabel($element);
|
|
|
1016 |
echo $this->formSelect($element);
|
|
|
1017 |
?>
|
|
|
1018 |
</div>
|
|
|
1019 |
</div>
|
|
|
1020 |
<div class="row">
|
|
|
1021 |
<div class="col-12 mt-3">
|
|
|
1022 |
<?php
|
|
|
1023 |
$element = $form->get('privacy');
|
|
|
1024 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1025 |
$element->setOptions(['label' => 'LABEL_PRIVACY']);
|
|
|
1026 |
echo $this->formLabel($element);
|
|
|
1027 |
echo $this->formSelect($element);
|
|
|
1028 |
?>
|
|
|
1029 |
</div>
|
|
|
1030 |
</div>
|
|
|
1031 |
<div class="row">
|
|
|
1032 |
<div class="col-12 mt-3">
|
|
|
1033 |
<?php
|
|
|
1034 |
$element = $form->get('type');
|
|
|
1035 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1036 |
$element->setOptions(['label' => 'LABEL_TYPE']);
|
|
|
1037 |
echo $this->formLabel($element);
|
|
|
1038 |
echo $this->formSelect($element);
|
|
|
1039 |
?>
|
|
|
1040 |
</div>
|
|
|
1041 |
</div>
|
| 15139 |
stevensc |
1042 |
|
| 16905 |
efrain |
1043 |
<div class="row" id="form-row-cost">
|
|
|
1044 |
<div class="col-12 mt-3">
|
|
|
1045 |
<?php
|
|
|
1046 |
$element = $form->get('cost');
|
|
|
1047 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1048 |
$element->setOptions(['label' => 'LABEL_COST']);
|
|
|
1049 |
echo $this->formLabel($element);
|
|
|
1050 |
echo $this->formText($element);
|
|
|
1051 |
?>
|
|
|
1052 |
</div>
|
|
|
1053 |
</div>
|
|
|
1054 |
<div class="row">
|
|
|
1055 |
<div class="col-12 mt-3">
|
|
|
1056 |
<?php
|
|
|
1057 |
$element = $form->get('file');
|
|
|
1058 |
$element->setOptions(['label' => 'LABEL_IMAGE']);
|
|
|
1059 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1060 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
1061 |
echo $this->formLabel($element);
|
|
|
1062 |
echo $this->formFile($element);
|
|
|
1063 |
?>
|
|
|
1064 |
</div>
|
|
|
1065 |
</div>
|
|
|
1066 |
<div class="row">
|
|
|
1067 |
<div class="col-12 mt-3">
|
|
|
1068 |
<?php
|
|
|
1069 |
$element = $form->get('marketplace');
|
|
|
1070 |
$element->setOptions(['label' => 'LABEL_MARKETPLACE']);
|
|
|
1071 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1072 |
$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
|
|
|
1073 |
echo $this->formLabel($element);
|
|
|
1074 |
echo $this->formFile($element);
|
|
|
1075 |
?>
|
|
|
1076 |
</div>
|
|
|
1077 |
</div>
|
|
|
1078 |
</div>
|
|
|
1079 |
<div class="card-footer text-right">
|
|
|
1080 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
1081 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
|
|
1082 |
</div>
|
|
|
1083 |
<?php echo $this->form()->closeTag($form); ?>
|
| 15139 |
stevensc |
1084 |
</div>
|
| 16905 |
efrain |
1085 |
</div>
|
| 15139 |
stevensc |
1086 |
|
|
|
1087 |
|
|
|
1088 |
|
|
|
1089 |
|
|
|
1090 |
|
| 16905 |
efrain |
1091 |
|
| 1 |
www |
1092 |
<!-- The Modal -->
|
| 16905 |
efrain |
1093 |
<div class="modal" id="modalPreviewMarketPlace">
|
| 1 |
www |
1094 |
<div class="modal-dialog">
|
|
|
1095 |
<div class="modal-content">
|
| 15139 |
stevensc |
1096 |
<!-- Modal Header -->
|
|
|
1097 |
<div class="modal-header">
|
| 16845 |
efrain |
1098 |
<h6 class="modal-title">LABEL_IMAGE_MARKETPLACE</h6>
|
| 16822 |
efrain |
1099 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15139 |
stevensc |
1100 |
</div>
|
| 1 |
www |
1101 |
|
| 15139 |
stevensc |
1102 |
<!-- Modal body -->
|
|
|
1103 |
<div class="modal-body text-center">
|
|
|
1104 |
<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-marketplace" />
|
|
|
1105 |
</div>
|
|
|
1106 |
|
|
|
1107 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1108 |
<div class="modal-footer text-right">
|
| 15139 |
stevensc |
1109 |
<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
|
|
|
1110 |
</div>
|
|
|
1111 |
</div>
|
| 1 |
www |
1112 |
</div>
|
| 15139 |
stevensc |
1113 |
</div>
|
| 1 |
www |
1114 |
|
|
|
1115 |
|
|
|
1116 |
<!-- The Modal -->
|
| 16905 |
efrain |
1117 |
<div class="modal" id="modalPreviewImage">
|
| 1 |
www |
1118 |
<div class="modal-dialog ">
|
| 15139 |
stevensc |
1119 |
<div class="modal-content">
|
| 1 |
www |
1120 |
|
| 15139 |
stevensc |
1121 |
<!-- Modal Header -->
|
|
|
1122 |
<div class="modal-header">
|
| 16845 |
efrain |
1123 |
<h6 class="modal-title">LABEL_IMAGE</h6>
|
| 16822 |
efrain |
1124 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15139 |
stevensc |
1125 |
</div>
|
| 1 |
www |
1126 |
|
| 15139 |
stevensc |
1127 |
<!-- Modal body -->
|
|
|
1128 |
<div class="modal-body text-center">
|
| 1 |
www |
1129 |
<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-app" />
|
| 15139 |
stevensc |
1130 |
</div>
|
|
|
1131 |
|
|
|
1132 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1133 |
<div class="modal-footer text-right">
|
| 15139 |
stevensc |
1134 |
<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
|
|
|
1135 |
</div>
|
|
|
1136 |
</div>
|
| 1 |
www |
1137 |
</div>
|
| 15139 |
stevensc |
1138 |
</div>
|
| 1 |
www |
1139 |
|
|
|
1140 |
|
|
|
1141 |
|
| 15139 |
stevensc |
1142 |
|
|
|
1143 |
|
|
|
1144 |
|
| 1 |
www |
1145 |
<!-- The Modal -->
|
|
|
1146 |
<div class="modal" id="notificationUsersModal">
|
|
|
1147 |
<div class="modal-dialog modal-xl">
|
| 15139 |
stevensc |
1148 |
<div class="modal-content">
|
| 1 |
www |
1149 |
|
| 15139 |
stevensc |
1150 |
<!-- Modal Header -->
|
|
|
1151 |
<div class="modal-header">
|
| 16845 |
efrain |
1152 |
<h6 class="modal-title">LABEL_USERS</h6>
|
| 16822 |
efrain |
1153 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15139 |
stevensc |
1154 |
</div>
|
| 1 |
www |
1155 |
|
| 15139 |
stevensc |
1156 |
<!-- Modal body -->
|
|
|
1157 |
<div class="modal-body">
|
|
|
1158 |
<form>
|
| 16905 |
efrain |
1159 |
<div class="row">
|
|
|
1160 |
<div class="col-12 mt-3">
|
| 15139 |
stevensc |
1161 |
<label>LABEL_CAPSULE</label>
|
|
|
1162 |
<input type="text" readonly="readonly" id="table-users-capsule" class="form-control">
|
| 16905 |
efrain |
1163 |
</div>
|
|
|
1164 |
</div>
|
| 15139 |
stevensc |
1165 |
</form>
|
| 16905 |
efrain |
1166 |
<div class="row">
|
|
|
1167 |
<div class="col-12 mt-3">
|
|
|
1168 |
<div style="height: 300px;overflow: scroll;">
|
| 17061 |
stevensc |
1169 |
<table id="gridTableUsers" style="width: 100%" class="table table-bordered">
|
| 16905 |
efrain |
1170 |
<thead>
|
|
|
1171 |
<tr>
|
|
|
1172 |
<th>LABEL_FIRST_NAME</th>
|
|
|
1173 |
<th>LABEL_LAST_NAME</th>
|
|
|
1174 |
<th>LABEL_EMAIL</th>
|
|
|
1175 |
<th>LABEL_DETAILS</th>
|
|
|
1176 |
</tr>
|
|
|
1177 |
</thead>
|
|
|
1178 |
<tbody>
|
|
|
1179 |
</tbody>
|
|
|
1180 |
</table>
|
|
|
1181 |
</div>
|
|
|
1182 |
</div>
|
|
|
1183 |
</div>
|
| 15139 |
stevensc |
1184 |
</div>
|
| 1 |
www |
1185 |
|
| 15139 |
stevensc |
1186 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1187 |
<div class="modal-footer text-right">
|
| 15139 |
stevensc |
1188 |
<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
|
|
|
1189 |
</div>
|
|
|
1190 |
|
|
|
1191 |
</div>
|
| 15027 |
stevensc |
1192 |
</div>
|
| 15139 |
stevensc |
1193 |
</div>
|