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