Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16945 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
6
$routeDatatable = $this->url('microlearning/content/slides');
7
 
8
$allowAdd = $acl->isAllowed($roleName, 'microlearning/content/slides/add') ? 1 : 0;
9
$allowEdit = $acl->isAllowed($roleName, 'microlearning/content/slides/edit') ? 1 : 0;
10
$allowDelete = $acl->isAllowed($roleName, 'microlearning/content/slides/delete') ? 1 : 0;
11
 
12
 
16822 efrain 13
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
14
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
1 www 15
 
16
 
17
 
18
 
19
 
20
 
16822 efrain 21
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
22
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
12071 nelberth 23
 
16843 efrain 24
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
16822 efrain 26
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
28
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
29
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
1 www 30
 
31
 
16929 efrain 32
 
33
 
34
 
16822 efrain 35
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
36
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
1 www 37
 
16822 efrain 38
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
39
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
1 www 40
 
16822 efrain 41
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
42
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
43
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
44
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
1 www 45
 
46
 
16822 efrain 47
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
48
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
1 www 49
 
50
 
51
 
52
 
16822 efrain 53
 
54
 
1 www 55
$this->inlineScript()->captureStart();
56
echo <<<JS
57
 
58
 
59
jQuery( document ).ready(function( $ ) {
60
 
61
        var routeAdd = '';
62
 
63
        $.validator.setDefaults({
64
            debug: true,
65
            highlight: function(element) {
66
                $(element).addClass('is-invalid');
67
            },
68
            unhighlight: function(element) {
69
                $(element).removeClass('is-invalid');
70
            },
71
            errorElement: 'span',
72
            errorClass: 'error invalid-feedback',
73
            errorPlacement: function(error, element) {
6192 nelberth 74
 
1 www 75
            }
76
        });
77
 
78
 
79
    var allowEdit   = $allowEdit;
80
        var allowDelete = $allowDelete;
81
 
82
        var gridTable = $('#gridTable').dataTable( {
83
            'processing': true,
84
            'serverSide': true,
85
            'searching': true,
86
            'order': [[ 0, 'asc' ]],
87
            'ordering':  true,
88
            'ordenable' : true,
89
            'responsive': true,
90
            'select' : false,
91
        	'paging': true,
92
            'pagingType': 'simple_numbers',
93
 
94
    		'ajax': {
95
    			'url' : '$routeDatatable',
96
    			'type' : 'get',
97
                'data': function ( d ) {
98
                    d.topic_uuid = $('#form-filter #topic_uuid').val();
99
                    d.capsule_uuid = $('#form-filter #capsule_uuid').val();
100
 
101
                },
102
                'beforeSend': function (request) {
103
                  NProgress.start();
104
                },
105
                'dataFilter': function(response) {
106
                    var response = jQuery.parseJSON( response );
107
 
108
                    var json                = {};
109
                    json.recordsTotal       = 0;
110
                    json.recordsFiltered    = 0;
111
                    json.data               = [];
112
 
113
                    if(response.success) {
114
                        $('#form-capsule-add').attr('action', response.data.link_add );
115
 
116
                        if(response.data.capsules) {
117
                            $('#form-filter #capsule_uuid').empty();
118
                            $.each(response.data.capsules, function(index, value) {
119
                                  $('#form-filter #capsule_uuid').append('<option value="' + index + '">' + value + '</option>')
120
                            });
121
                        }
122
 
123
                        routeAdd = response.data.link_add;
124
                        if(response.data.link_add) {
125
 
126
                            $('button.btn-add').removeAttr('disabled');
127
                        } else {
128
                            $('button.btn-add').attr('disabled', 'disabled');
129
                        }
130
 
131
                        json.recordsTotal       = response.data.total;
132
                        json.recordsFiltered    = response.data.total;
133
                        json.data               = response.data.items;
134
                    } else {
135
                        $.fn.showError(response.data)
136
                    }
137
 
138
                    return JSON.stringify( json );
139
                }
140
    		},
141
            'language' : {
142
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
143
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
144
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
145
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
146
                'sInfo':           'LABEL_DATATABLE_SINFO',
147
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
148
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
149
                'sInfoPostFix':    '',
150
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
151
                'sUrl':            '',
152
                'sInfoThousands':  ',',
153
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
154
                'oPaginate': {
155
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
156
                    'sLast':     'LABEL_DATATABLE_SLAST',
157
                    'sNext':     'LABEL_DATATABLE_SNEXT',
158
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
159
                },
160
                'oAria': {
161
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
162
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
163
                },
164
            },
165
            'drawCallback': function( settings ) {
166
                NProgress.done();
16822 efrain 167
 
1 www 168
            },
169
            'aoColumns': [
170
                { 'mDataProp': 'name' },
171
                { 'mDataProp': 'details' },
172
                { 'mDataProp': 'media' },
173
                { 'mDataProp': 'actions' },
174
    	    ],
175
            'columnDefs': [
176
                {
177
                    'targets': 0,
178
                    'className' : 'text-vertical-middle',
179
                },
180
                {
181
                    'targets': -3,
182
                    'orderable': false,
183
                    'render' : function ( data, type, row ) {
184
                        var s = '';
185
                        s += 'LABEL_TYPE: ' + data['type']  + '<br/>';
186
                        return s;
187
                    }
188
                },
189
                {
190
                    'targets': -2,
191
                    'orderable': false,
192
                    'render' : function ( data, type, row ) {
193
                        s = '';
194
                        if( data['image'] )  {
195
                            s = s + '&nbsp; <img class="btn-view-image"" data-href="' + data['image'] + '" data-toggle="tooltip" src="'+data['image']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> ';
196
                        }
197
 
198
                        if( data['audio'] )  {
199
                            s = s + '&nbsp;<button class="btn btn-play-audio" data-href="' + data['audio'] + '" data-toggle="tooltip" title="LABEL_PLAY_AUDIO"><i class="fa fa-play"></i></button> <br>';
200
                        }
201
 
202
                        if( data['video'] )  {
16945 efrain 203
                            s = s + '&nbsp;<button class="btn btn-play-video" data-href="' + data['video'] + '" data-toggle="tooltip" title="LABEL_PLAY_VIDEO"><i class="fa fa-video"></i></button> <br>';
1 www 204
                        }
205
 
206
 
207
                        if( data['document'] )  {
208
                            s = s + '&nbsp;<button class="btn btn-view-document" data-href="' + data['document'] + '" data-toggle="tooltip" title="LABEL_VIEW_DOCUMENT"><i class="fa fa-file"></i></button> <br>';
209
                        }
210
 
211
                        if( data['text'] )  {
212
                            s = s + '&nbsp;<button class="btn btn-view-text" data-href="' + data['text'] + '" data-toggle="tooltip" title="LABEL_VIEW_TEXT"><i class="fa fa-text-width"></i></button> <br>';
213
                        }
214
 
215
                        return s;
216
                    }
217
                },
218
 
219
 
220
                {
221
                    'targets': -1,
222
                    'orderable': false,
223
                    'render' : function ( data, type, row ) {
224
                        s = '';
225
 
226
                        if(allowEdit && data['link_edit']  ) {
16906 efrain 227
                            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> Editar </button>&nbsp;';
1 www 228
                        }
229
                        if(allowDelete && data['link_delete']  ) {
230
                            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> Eliminar</button>&nbsp;';
231
                        }
232
                        return s;
233
                    }
234
                }
235
              ],
236
        });
16905 efrain 237
 
238
 
1 www 239
    var validatorTextAdd  = $('#form-slide-text-add').validate({
240
        debug: true,
241
        onclick: false,
242
        onkeyup: false,
243
        ignore: [],
244
        rules: {
245
            'name': {
246
                required: true,
247
                maxlength: 128,
248
            },
249
            'description': {
250
                updateCkeditor:function() {
251
                        CKEDITOR.instances.description_add.updateElement();
252
                },
253
                required: true
254
            },
255
           'background': {
256
                required: true,
16905 efrain 257
                extension: 'jpg|jpeg|png',
258
                accept: 'image/jpg,image/jpeg,image/png'
1 www 259
            },
260
            'order' : {
261
                required: true,
262
                digits: true,
263
                min: 1,
264
                max: 250
265
            }
266
        },
267
        submitHandler: function(form)
268
        {
269
 
270
            var formdata = false;
271
            if (window.FormData){
272
                formdata = new FormData(form); //form[0]);
273
            }
274
 
6591 nelberth 275
            NProgress.start();
1 www 276
            $.ajax({
277
                'dataType'  : 'json',
278
                'accept'    : 'application/json',
279
                'method'    : 'post',
280
                'url'       :  routeAdd,
281
                'data'      :  formdata,
282
                'processData': false,
283
                'contentType': false,
284
            }).done(function(response) {
285
                if(response['success']) {
286
                    $.fn.showSuccess(response['data']);
16906 efrain 287
 
1 www 288
 
289
                    gridTable.api().ajax.reload(null, false);
16906 efrain 290
 
291
    	    	    $('#row-text-add-box').hide();
292
                	$('#row-text-edit-box').hide();
293
                	$('#row-image-add-box').hide();
294
                	$('#row-image-edit-box').hide();
295
                	$('#row-video-add-box').hide();
296
                	$('#row-video-edit-box').hide();
297
                	$('#row-document-add-box').hide();
298
                	$('#row-document-edit-box').hide();
299
                	$('#row-audio-add-box').hide();
300
                	$('#row-audio-edit-box').hide();
301
                	$('#row-quizz-add-box').hide();
302
                    $('#row-quizz-edit-box').hide();
303
                    $('#row-listing').show();
1 www 304
                } else {
305
                    validatorTextAdd.resetForm();
306
                    if(jQuery.type(response['data']) == 'string') {
307
                        $.fn.showError(response['data']);
308
                    } else  {
309
                        $.each(response['data'], function( fieldname, errors ) {
310
                            $.fn.showFormErrorValidator('#form-slide-text-add #' + fieldname, errors);
311
                        });
312
                    }
313
                }
314
            }).fail(function( jqXHR, textStatus, errorThrown) {
315
                $.fn.showError(textStatus);
316
            }).always(function() {
317
                NProgress.done();
7060 nelberth 318
 
16906 efrain 319
 
1 www 320
            });
321
            return false;
322
        },
323
        invalidHandler: function(form, validator) {
324
 
325
        }
326
    });
327
 
328
    var validatorTextEdit = $('#form-slide-text-edit').validate({
329
        debug: true,
330
        onclick: false,
331
        onkeyup: false,
332
        ignore: [],
333
        rules: {
334
            'name': {
335
                required: true,
336
                maxlength: 128,
337
            },
338
            'description': {
339
                updateCkeditor:function() {
340
                        CKEDITOR.instances.description_edit.updateElement();
341
                },
342
                required: true
343
            },
344
           'background': {
16906 efrain 345
                required: false,
346
                extension: 'jpg|jpeg|png',
347
                accept: 'image/jpg,image/jpeg,image/png'
1 www 348
            },
349
            'order' : {
350
                required: true,
351
                digits: true,
352
                min: 1,
353
                max: 250
354
            }
355
        },
356
        submitHandler: function(form)
357
        {
358
            var formdata = false;
359
            if (window.FormData){
360
                formdata = new FormData(form); //form[0]);
361
            }
362
 
7060 nelberth 363
 
16906 efrain 364
 
6595 nelberth 365
            NProgress.start();
1 www 366
            $.ajax({
367
                'dataType'  : 'json',
368
                'accept'    : 'application/json',
369
                'method'    : 'post',
370
                'url'       :  $('#form-slide-text-edit').attr('action'),
371
                'data'      :  formdata,
372
                'processData': false,
373
                'contentType': false,
374
            }).done(function(response) {
375
                if(response['success']) {
376
                    $.fn.showSuccess(response['data']);
6595 nelberth 377
 
16906 efrain 378
 
1 www 379
                    gridTable.api().ajax.reload(null, false);
16906 efrain 380
 
381
    	    	    $('#row-text-add-box').hide();
382
                	$('#row-text-edit-box').hide();
383
                	$('#row-image-add-box').hide();
384
                	$('#row-image-edit-box').hide();
385
                	$('#row-video-add-box').hide();
386
                	$('#row-video-edit-box').hide();
387
                	$('#row-document-add-box').hide();
388
                	$('#row-document-edit-box').hide();
389
                	$('#row-audio-add-box').hide();
390
                	$('#row-audio-edit-box').hide();
391
                	$('#row-quizz-add-box').hide();
392
                    $('#row-quizz-edit-box').hide();
393
                    $('#row-listing').show();
1 www 394
                } else {
395
                    validatorTextEdit.resetForm();
396
                    if(jQuery.type(response['data']) == 'string') {
397
                        $.fn.showError(response['data']);
398
                    } else  {
399
                        $.each(response['data'], function( fieldname, errors ) {
400
                            $.fn.showFormErrorValidator('#form-slide-text-edit #' + fieldname, errors);
401
                        });
402
                    }
403
                }
404
            }).fail(function( jqXHR, textStatus, errorThrown) {
405
                $.fn.showError(textStatus);
406
            }).always(function() {
407
                NProgress.done();
7060 nelberth 408
 
16906 efrain 409
 
1 www 410
            });
411
            return false;
412
        },
413
        invalidHandler: function(form, validator) {
414
 
415
        }
416
    });
417
 
418
    var validatorImageAdd  = $('#form-slide-image-add').validate({
419
        debug: true,
420
        onclick: false,
421
        onkeyup: false,
422
        ignore: [],
423
        rules: {
424
            'name': {
425
                required: true,
426
                maxlength: 128,
427
            },
428
           'file': {
429
                required: true,
16906 efrain 430
                extension: 'jpg|jpeg|png',
431
                accept: 'image/jpg,image/jpeg,image/png'
1 www 432
            },
433
            'order' : {
434
                required: true,
435
                digits: true,
436
                min: 1,
437
                max: 250
438
            }
439
        },
440
        submitHandler: function(form)
441
        {
442
            var formdata = false;
443
            if (window.FormData){
444
                formdata = new FormData(form); //form[0]);
445
            }
446
 
7060 nelberth 447
 
16906 efrain 448
 
6499 nelberth 449
            NProgress.start();
1 www 450
            $.ajax({
451
                'dataType'  : 'json',
452
                'accept'    : 'application/json',
453
                'method'    : 'post',
454
                'url'       :  routeAdd,
455
                'data'      :  formdata,
456
                'processData': false,
457
                'contentType': false,
458
            }).done(function(response) {
6192 nelberth 459
                console.log(response)
1 www 460
                if(response['success']) {
461
                    $.fn.showSuccess(response['data']);
16906 efrain 462
 
1 www 463
 
464
                    gridTable.api().ajax.reload(null, false);
16906 efrain 465
 
466
    	    	    $('#row-text-add-box').hide();
467
                	$('#row-text-edit-box').hide();
468
                	$('#row-image-add-box').hide();
469
                	$('#row-image-edit-box').hide();
470
                	$('#row-video-add-box').hide();
471
                	$('#row-video-edit-box').hide();
472
                	$('#row-document-add-box').hide();
473
                	$('#row-document-edit-box').hide();
474
                	$('#row-audio-add-box').hide();
475
                	$('#row-audio-edit-box').hide();
476
                	$('#row-quizz-add-box').hide();
477
                    $('#row-quizz-edit-box').hide();
478
                    $('#row-listing').show();
1 www 479
                } else {
480
                    validatorImageAdd.resetForm();
481
                    if(jQuery.type(response['data']) == 'string') {
482
                        $.fn.showError(response['data']);
483
                    } else  {
484
                        $.each(response['data'], function( fieldname, errors ) {
485
                            $.fn.showFormErrorValidator('#form-slide-image-add #' + fieldname, errors);
486
                        });
487
                    }
488
                }
489
            }).fail(function( jqXHR, textStatus, errorThrown) {
490
                $.fn.showError(textStatus);
491
            }).always(function() {
492
                NProgress.done();
7060 nelberth 493
 
16906 efrain 494
 
1 www 495
            });
496
            return false;
497
        },
498
        invalidHandler: function(form, validator) {
499
 
500
        }
501
    });
502
 
503
    var validatorImageEdit = $('#form-slide-image-edit').validate({
504
        debug: true,
505
        onclick: false,
506
        onkeyup: false,
507
        ignore: [],
508
        rules: {
509
            'name': {
510
                required: true,
511
                maxlength: 128,
512
            },
513
            'file': {
16906 efrain 514
                required: false,
515
                extension: 'jpg|jpeg|png',
516
                accept: 'image/jpg,image/jpeg,image/png'
1 www 517
            },
518
            'order' : {
519
                required: true,
520
                digits: true,
521
                min: 1,
522
                max: 250
523
            }
524
        },
525
        submitHandler: function(form)
526
        {
527
            var formdata = false;
528
            if (window.FormData){
529
                formdata = new FormData(form); //form[0]);
530
            }
7060 nelberth 531
 
16906 efrain 532
 
6500 nelberth 533
            NProgress.start();
1 www 534
            $.ajax({
535
                'dataType'  : 'json',
536
                'accept'    : 'application/json',
537
                'method'    : 'post',
538
                'url'       :  $('#form-slide-image-edit').attr('action'),
539
                'data'      :  formdata,
540
                'processData': false,
541
                'contentType': false,
542
            }).done(function(response) {
543
                if(response['success']) {
544
                    $.fn.showSuccess(response['data']);
16906 efrain 545
 
1 www 546
 
547
                    gridTable.api().ajax.reload(null, false);
16906 efrain 548
 
549
    	    	    $('#row-text-add-box').hide();
550
                	$('#row-text-edit-box').hide();
551
                	$('#row-image-add-box').hide();
552
                	$('#row-image-edit-box').hide();
553
                	$('#row-video-add-box').hide();
554
                	$('#row-video-edit-box').hide();
555
                	$('#row-document-add-box').hide();
556
                	$('#row-document-edit-box').hide();
557
                	$('#row-audio-add-box').hide();
558
                	$('#row-audio-edit-box').hide();
559
                	$('#row-quizz-add-box').hide();
560
                    $('#row-quizz-edit-box').hide();
561
                    $('#row-listing').show();
1 www 562
                } else {
563
                    validatorImageEdit.resetForm();
564
                    if(jQuery.type(response['data']) == 'string') {
565
                        $.fn.showError(response['data']);
566
                    } else  {
567
                        $.each(response['data'], function( fieldname, errors ) {
568
                            $.fn.showFormErrorValidator('#form-slide-image-edit #' + fieldname, errors);
569
                        });
570
                    }
571
                }
572
            }).fail(function( jqXHR, textStatus, errorThrown) {
573
                $.fn.showError(textStatus);
574
            }).always(function() {
575
                NProgress.done();
7060 nelberth 576
 
16906 efrain 577
 
1 www 578
            });
579
            return false;
580
        },
581
        invalidHandler: function(form, validator) {
582
 
583
        }
584
    });
585
 
586
    var validatorVideoAdd  = $('#form-slide-video-add').validate({
587
        debug: true,
588
        onclick: false,
589
        onkeyup: false,
590
        ignore: [],
591
        rules: {
592
            'name': {
593
                required: true,
594
                maxlength: 128,
595
            },
596
           'file': {
597
                required: true,
598
                extension: 'webm,mp4,webm',
599
                accept: 'video/webm,video/mpeg,video/mp4'
600
            },
601
            'background': {
6620 nelberth 602
                required: true,
16906 efrain 603
                extension: 'jpg|jpeg|png',
604
                accept: 'image/jpg,image/jpeg,image/png'
1 www 605
            },
606
            'order' : {
607
                required: true,
608
                digits: true,
609
                min: 1,
610
                max: 250
611
            }
612
        },
613
        submitHandler: function(form)
614
        {
615
            var formdata = false;
616
            if (window.FormData){
617
                formdata = new FormData(form); //form[0]);
618
            }
619
 
7060 nelberth 620
 
16906 efrain 621
 
6620 nelberth 622
            NProgress.start();
1 www 623
            $.ajax({
624
                'dataType'  : 'json',
625
                'accept'    : 'application/json',
626
                'method'    : 'post',
627
                'url'       :  routeAdd,
628
                'data'      :  formdata,
629
                'processData': false,
630
                'contentType': false,
631
            }).done(function(response) {
632
                if(response['success']) {
633
                    $.fn.showSuccess(response['data']);
16906 efrain 634
 
635
 
1 www 636
                    gridTable.api().ajax.reload(null, false);
16906 efrain 637
 
638
    	    	    $('#row-text-add-box').hide();
639
                	$('#row-text-edit-box').hide();
640
                	$('#row-image-add-box').hide();
641
                	$('#row-image-edit-box').hide();
642
                	$('#row-video-add-box').hide();
643
                	$('#row-video-edit-box').hide();
644
                	$('#row-document-add-box').hide();
645
                	$('#row-document-edit-box').hide();
646
                	$('#row-audio-add-box').hide();
647
                	$('#row-audio-edit-box').hide();
648
                	$('#row-quizz-add-box').hide();
649
                    $('#row-quizz-edit-box').hide();
650
                    $('#row-listing').show();
1 www 651
                } else {
652
                    validatorVideoAdd.resetForm();
653
                    if(jQuery.type(response['data']) == 'string') {
654
                        $.fn.showError(response['data']);
655
                    } else  {
656
                        $.each(response['data'], function( fieldname, errors ) {
657
                            $.fn.showFormErrorValidator('#form-slide-video-add #' + fieldname, errors);
658
                        });
659
                    }
660
                }
661
            }).fail(function( jqXHR, textStatus, errorThrown) {
662
                $.fn.showError(textStatus);
663
            }).always(function() {
664
                NProgress.done();
16906 efrain 665
 
1 www 666
            });
667
            return false;
668
        },
669
        invalidHandler: function(form, validator) {
670
 
671
        }
672
    });
673
 
674
    var validatorVideoEdit = $('#form-slide-video-edit').validate({
675
        debug: true,
676
        onclick: false,
677
        onkeyup: false,
678
        ignore: [],
679
        rules: {
680
            'name': {
681
                required: true,
682
                maxlength: 128,
683
            },
684
            'file': {
685
                required: false,
686
                extension: 'webm,mp4,webm',
687
                accept: 'video/webm,video/mpeg,video/mp4'
688
            },
689
            'background': {
16906 efrain 690
                required: false,
691
                extension: 'jpg|jpeg|png',
692
                accept: 'image/jpg,image/jpeg,image/png'
1 www 693
            },
694
            'order' : {
695
                required: true,
696
                digits: true,
697
                min: 1,
698
                max: 250
699
            }
700
        },
701
        submitHandler: function(form)
702
        {
703
            var formdata = false;
704
            if (window.FormData){
705
                formdata = new FormData(form); //form[0]);
706
            }
707
 
7060 nelberth 708
 
16906 efrain 709
 
6650 nelberth 710
            NProgress.start();
1 www 711
            $.ajax({
712
                'dataType'  : 'json',
713
                'accept'    : 'application/json',
714
                'method'    : 'post',
715
                'url'       :  $('#form-slide-video-edit').attr('action'),
716
                'data'      :  formdata,
717
                'processData': false,
718
                'contentType': false,
719
            }).done(function(response) {
720
                if(response['success']) {
721
                    $.fn.showSuccess(response['data']);
16906 efrain 722
 
6643 nelberth 723
 
1 www 724
                    gridTable.api().ajax.reload(null, false);
16906 efrain 725
 
726
    	    	    $('#row-text-add-box').hide();
727
                	$('#row-text-edit-box').hide();
728
                	$('#row-image-add-box').hide();
729
                	$('#row-image-edit-box').hide();
730
                	$('#row-video-add-box').hide();
731
                	$('#row-video-edit-box').hide();
732
                	$('#row-document-add-box').hide();
733
                	$('#row-document-edit-box').hide();
734
                	$('#row-audio-add-box').hide();
735
                	$('#row-audio-edit-box').hide();
736
                	$('#row-quizz-add-box').hide();
737
                    $('#row-quizz-edit-box').hide();
738
                    $('#row-listing').show();
1 www 739
                } else {
740
                    validatorVideoEdit.resetForm();
741
                    if(jQuery.type(response['data']) == 'string') {
742
                        $.fn.showError(response['data']);
743
                    } else  {
744
                        $.each(response['data'], function( fieldname, errors ) {
745
                            $.fn.showFormErrorValidator('#form-slide-video-edit #' + fieldname, errors);
746
                        });
747
                    }
748
                }
749
            }).fail(function( jqXHR, textStatus, errorThrown) {
750
                $.fn.showError(textStatus);
751
            }).always(function() {
16906 efrain 752
 
1 www 753
                NProgress.done();
754
            });
755
            return false;
756
        },
757
        invalidHandler: function(form, validator) {
758
 
759
        }
760
    });
761
 
762
 
763
    var validatorDocumentAdd  = $('#form-slide-document-add').validate({
764
        debug: true,
765
        onclick: false,
766
        onkeyup: false,
767
        ignore: [],
768
        rules: {
769
            'name': {
770
                required: true,
771
                maxlength: 128,
772
            },
773
           'file': {
774
                required: true,
775
                extension: 'pdf',
776
                accept: 'application/pdf'
777
            },
778
           'background': {
779
                required: true,
16906 efrain 780
                extension: 'jpg|jpeg|png',
781
                accept: 'image/jpg,image/jpeg,image/png'
1 www 782
            },
783
            'order' : {
784
                required: true,
785
                digits: true,
786
                min: 1,
787
                max: 250
788
            }
789
        },
790
        submitHandler: function(form)
791
        {
792
            var formdata = false;
793
            if (window.FormData){
794
                formdata = new FormData(form); //form[0]);
795
            }
796
 
7060 nelberth 797
 
16906 efrain 798
 
6650 nelberth 799
            NProgress.start();
1 www 800
            $.ajax({
801
                'dataType'  : 'json',
802
                'accept'    : 'application/json',
803
                'method'    : 'post',
804
                'url'       :  routeAdd,
805
                'data'      :  formdata,
806
                'processData': false,
807
                'contentType': false,
808
            }).done(function(response) {
809
                if(response['success']) {
810
                    $.fn.showSuccess(response['data']);
16906 efrain 811
 
1 www 812
 
813
                    gridTable.api().ajax.reload(null, false);
16906 efrain 814
 
815
    	    	    $('#row-text-add-box').hide();
816
                	$('#row-text-edit-box').hide();
817
                	$('#row-image-add-box').hide();
818
                	$('#row-image-edit-box').hide();
819
                	$('#row-video-add-box').hide();
820
                	$('#row-video-edit-box').hide();
821
                	$('#row-document-add-box').hide();
822
                	$('#row-document-edit-box').hide();
823
                	$('#row-audio-add-box').hide();
824
                	$('#row-audio-edit-box').hide();
825
                	$('#row-quizz-add-box').hide();
826
                    $('#row-quizz-edit-box').hide();
827
                    $('#row-listing').show();
1 www 828
                } else {
829
                    validatorDocumentAdd.resetForm();
830
                    if(jQuery.type(response['data']) == 'string') {
831
                        $.fn.showError(response['data']);
832
                    } else  {
833
                        $.each(response['data'], function( fieldname, errors ) {
834
                            $.fn.showFormErrorValidator('#form-slide-document-add #' + fieldname, errors);
835
                        });
836
                    }
837
                }
838
            }).fail(function( jqXHR, textStatus, errorThrown) {
839
                $.fn.showError(textStatus);
840
            }).always(function() {
16906 efrain 841
 
1 www 842
                NProgress.done();
843
            });
844
            return false;
845
        },
846
        invalidHandler: function(form, validator) {
847
 
848
        }
849
    });
850
 
851
    var validatorDocumentEdit = $('#form-slide-document-edit').validate({
852
        debug: true,
853
        onclick: false,
854
        onkeyup: false,
855
        ignore: [],
856
        rules: {
857
            'name': {
858
                required: true,
859
                maxlength: 128,
860
            },
861
           'file': {
6667 nelberth 862
                required: false,
1 www 863
                extension: 'pdf',
864
                accept: 'application/pdf'
865
            },
866
           'background': {
16906 efrain 867
                required: false,
868
                extension: 'jpg|jpeg|png',
869
                accept: 'image/jpg,image/jpeg,image/png'
1 www 870
            },
871
            'order' : {
872
                required: true,
873
                digits: true,
874
                min: 1,
875
                max: 250
876
            }
877
        },
878
        submitHandler: function(form)
879
        {
880
            var formdata = false;
881
            if (window.FormData){
882
                formdata = new FormData(form); //form[0]);
883
            }
884
 
7060 nelberth 885
 
16906 efrain 886
 
6650 nelberth 887
            NProgress.start();
1 www 888
            $.ajax({
889
                'dataType'  : 'json',
890
                'accept'    : 'application/json',
891
                'method'    : 'post',
892
                'url'       :  $('#form-slide-document-edit').attr('action'),
893
                'data'      :  formdata,
894
                'processData': false,
895
                'contentType': false,
896
            }).done(function(response) {
897
                if(response['success']) {
898
                    $.fn.showSuccess(response['data']);
16906 efrain 899
 
1 www 900
 
901
                    gridTable.api().ajax.reload(null, false);
16906 efrain 902
 
903
    	    	    $('#row-text-add-box').hide();
904
                	$('#row-text-edit-box').hide();
905
                	$('#row-image-add-box').hide();
906
                	$('#row-image-edit-box').hide();
907
                	$('#row-video-add-box').hide();
908
                	$('#row-video-edit-box').hide();
909
                	$('#row-document-add-box').hide();
910
                	$('#row-document-edit-box').hide();
911
                	$('#row-audio-add-box').hide();
912
                	$('#row-audio-edit-box').hide();
913
                	$('#row-quizz-add-box').hide();
914
                    $('#row-quizz-edit-box').hide();
915
                    $('#row-listing').show();
1 www 916
                } else {
917
                    validatorDocumentEdit.resetForm();
918
                    if(jQuery.type(response['data']) == 'string') {
919
                        $.fn.showError(response['data']);
920
                    } else  {
921
                        $.each(response['data'], function( fieldname, errors ) {
922
                            $.fn.showFormErrorValidator('#form-slide-document-edit #' + fieldname, errors);
923
                        });
924
                    }
925
                }
926
            }).fail(function( jqXHR, textStatus, errorThrown) {
927
                $.fn.showError(textStatus);
928
            }).always(function() {
16906 efrain 929
 
1 www 930
                NProgress.done();
931
            });
932
            return false;
933
        },
934
        invalidHandler: function(form, validator) {
935
 
936
        }
937
    });
938
 
939
    var validatorAudioAdd  = $('#form-slide-audio-add').validate({
940
        debug: true,
941
        onclick: false,
942
        onkeyup: false,
943
        ignore: [],
944
        rules: {
945
            'name': {
946
                required: true,
947
                maxlength: 128,
948
            },
949
           'file': {
950
                required: true,
951
                extension: 'wav|mp3',
952
                accept: 'audio/wav, audio/mpeg'
953
            },
954
 
955
           'background': {
16906 efrain 956
                required: true,
957
                extension: 'jpg|jpeg|png',
958
                accept: 'image/jpg,image/jpeg,image/png'
1 www 959
            },
960
            'order' : {
961
                required: true,
962
                digits: true,
963
                min: 1,
964
                max: 250
965
            }
966
        },
967
        submitHandler: function(form)
968
        {
969
            var formdata = false;
970
            if (window.FormData){
971
                formdata = new FormData(form); //form[0]);
972
            }
973
 
7060 nelberth 974
 
16906 efrain 975
 
6650 nelberth 976
            NProgress.start();
1 www 977
            $.ajax({
978
                'dataType'  : 'json',
979
                'accept'    : 'application/json',
980
                'method'    : 'post',
981
                'url'       :  routeAdd,
982
                'data'      :  formdata,
983
                'processData': false,
984
                'contentType': false,
985
            }).done(function(response) {
986
                if(response['success']) {
987
                    $.fn.showSuccess(response['data']);
16906 efrain 988
 
1 www 989
 
990
                    gridTable.api().ajax.reload(null, false);
16906 efrain 991
 
992
    	    	    $('#row-text-add-box').hide();
993
                	$('#row-text-edit-box').hide();
994
                	$('#row-image-add-box').hide();
995
                	$('#row-image-edit-box').hide();
996
                	$('#row-video-add-box').hide();
997
                	$('#row-video-edit-box').hide();
998
                	$('#row-document-add-box').hide();
999
                	$('#row-document-edit-box').hide();
1000
                	$('#row-audio-add-box').hide();
1001
                	$('#row-audio-edit-box').hide();
1002
                	$('#row-quizz-add-box').hide();
1003
                    $('#row-quizz-edit-box').hide();
1004
                    $('#row-listing').show();
1 www 1005
                } else {
1006
                    validatorAudioAdd.resetForm();
1007
                    if(jQuery.type(response['data']) == 'string') {
1008
                        $.fn.showError(response['data']);
1009
                    } else  {
1010
                        $.each(response['data'], function( fieldname, errors ) {
1011
                            $.fn.showFormErrorValidator('#form-slide-audio-add #' + fieldname, errors);
1012
                        });
1013
                    }
1014
                }
1015
            }).fail(function( jqXHR, textStatus, errorThrown) {
1016
                $.fn.showError(textStatus);
1017
            }).always(function() {
1018
                NProgress.done();
7060 nelberth 1019
 
16906 efrain 1020
 
1 www 1021
            });
1022
            return false;
1023
        },
1024
        invalidHandler: function(form, validator) {
1025
 
1026
        }
1027
    });
1028
 
1029
    var validatorAudioEdit = $('#form-slide-audio-edit').validate({
1030
        debug: true,
1031
        onclick: false,
1032
        onkeyup: false,
1033
        ignore: [],
1034
        rules: {
1035
            'name': {
1036
                required: true,
1037
                maxlength: 128,
1038
            },
1039
           'file': {
6667 nelberth 1040
                required: false,
1 www 1041
                extension: 'wav|mp3',
1042
                accept: 'audio/wav, audio/mpeg'
1043
            },
1044
 
1045
           'background': {
16906 efrain 1046
                required: false,
1047
                extension: 'jpg|jpeg|png',
1048
                accept: 'image/jpg,image/jpeg,image/png'
1 www 1049
            },
1050
            'order' : {
1051
                required: true,
1052
                digits: true,
1053
                min: 1,
1054
                max: 250
1055
            }
1056
        },
1057
        submitHandler: function(form)
1058
        {
1059
            var formdata = false;
1060
            if (window.FormData){
1061
                formdata = new FormData(form); //form[0]);
1062
            }
1063
 
7060 nelberth 1064
 
16906 efrain 1065
 
6650 nelberth 1066
            NProgress.start();
1 www 1067
            $.ajax({
1068
                'dataType'  : 'json',
1069
                'accept'    : 'application/json',
1070
                'method'    : 'post',
1071
                'url'       :  $('#form-slide-audio-edit').attr('action'),
1072
                'data'      :  formdata,
1073
                'processData': false,
1074
                'contentType': false,
1075
            }).done(function(response) {
1076
                if(response['success']) {
1077
                    $.fn.showSuccess(response['data']);
16906 efrain 1078
 
1 www 1079
 
1080
                    gridTable.api().ajax.reload(null, false);
16906 efrain 1081
 
1082
    	    	    $('#row-text-add-box').hide();
1083
                	$('#row-text-edit-box').hide();
1084
                	$('#row-image-add-box').hide();
1085
                	$('#row-image-edit-box').hide();
1086
                	$('#row-video-add-box').hide();
1087
                	$('#row-video-edit-box').hide();
1088
                	$('#row-document-add-box').hide();
1089
                	$('#row-document-edit-box').hide();
1090
                	$('#row-audio-add-box').hide();
1091
                	$('#row-audio-edit-box').hide();
1092
                	$('#row-quizz-add-box').hide();
1093
                    $('#row-quizz-edit-box').hide();
1094
                    $('#row-listing').show();
1 www 1095
                } else {
1096
                    validatorAudioEdit.resetForm();
1097
                    if(jQuery.type(response['data']) == 'string') {
1098
                        $.fn.showError(response['data']);
1099
                    } else  {
1100
                        $.each(response['data'], function( fieldname, errors ) {
1101
                            $.fn.showFormErrorValidator('#form-slide-audio-edit #' + fieldname, errors);
1102
                        });
1103
                    }
1104
                }
1105
            }).fail(function( jqXHR, textStatus, errorThrown) {
1106
                $.fn.showError(textStatus);
1107
            }).always(function() {
16906 efrain 1108
 
1 www 1109
                NProgress.done();
1110
            });
1111
            return false;
1112
        },
1113
        invalidHandler: function(form, validator) {
1114
 
1115
        }
1116
    });
1117
 
1118
    var validatorQuizzAdd  = $('#form-slide-quizz-add').validate({
1119
        debug: true,
1120
        onclick: false,
1121
        onkeyup: false,
1122
        ignore: [],
1123
        rules: {
1124
            'name': {
1125
                required: true,
1126
                maxlength: 128,
1127
            },
1128
           'file': {
1129
                required: true,
1130
                extension: 'wav|mp3',
1131
                accept: 'quizz/wav, quizz/mpeg'
1132
            },
6667 nelberth 1133
            'background': {
1134
                required: true,
16906 efrain 1135
                extension: 'jpg|jpeg|png',
1136
                accept: 'image/jpg,image/jpeg,image/png'
6667 nelberth 1137
            },
1 www 1138
            'quiz_id': {
1139
                required: true,
1140
            },
1141
            'order' : {
1142
                required: true,
1143
                digits: true,
1144
                min: 1,
1145
                max: 250
1146
            }
1147
        },
1148
        submitHandler: function(form)
1149
        {
1150
 
7060 nelberth 1151
 
16906 efrain 1152
 
6650 nelberth 1153
            NProgress.start();
1 www 1154
            var formdata = false;
1155
            if (window.FormData){
1156
                formdata = new FormData(form); //form[0]);
1157
            }
1158
 
1159
            $.ajax({
1160
                'dataType'  : 'json',
1161
                'accept'    : 'application/json',
1162
                'method'    : 'post',
1163
                'url'       :  routeAdd,
1164
                'data'      :  formdata,
1165
                'processData': false,
1166
                'contentType': false,
1167
            }).done(function(response) {
1168
                if(response['success']) {
1169
                    $.fn.showSuccess(response['data']);
16906 efrain 1170
 
1 www 1171
 
1172
                    gridTable.api().ajax.reload(null, false);
16906 efrain 1173
 
1174
    	    	    $('#row-text-add-box').hide();
1175
                	$('#row-text-edit-box').hide();
1176
                	$('#row-image-add-box').hide();
1177
                	$('#row-image-edit-box').hide();
1178
                	$('#row-video-add-box').hide();
1179
                	$('#row-video-edit-box').hide();
1180
                	$('#row-document-add-box').hide();
1181
                	$('#row-document-edit-box').hide();
1182
                	$('#row-audio-add-box').hide();
1183
                	$('#row-audio-edit-box').hide();
1184
                	$('#row-quizz-add-box').hide();
1185
                    $('#row-quizz-edit-box').hide();
1186
                    $('#row-listing').show();
1 www 1187
                } else {
1188
                    validatorQuizzAdd.resetForm();
1189
                    if(jQuery.type(response['data']) == 'string') {
1190
                        $.fn.showError(response['data']);
1191
                    } else  {
1192
                        $.each(response['data'], function( fieldname, errors ) {
1193
                            $.fn.showFormErrorValidator('#form-slide-quizz-add #' + fieldname, errors);
1194
                        });
1195
                    }
1196
                }
1197
            }).fail(function( jqXHR, textStatus, errorThrown) {
1198
                $.fn.showError(textStatus);
1199
            }).always(function() {
1200
                NProgress.done();
7060 nelberth 1201
 
16906 efrain 1202
 
1 www 1203
            });
1204
            return false;
1205
        },
1206
        invalidHandler: function(form, validator) {
1207
 
1208
        }
1209
    });
1210
 
1211
    var validatorQuizzEdit = $('#form-slide-quizz-edit').validate({
1212
        debug: true,
1213
        onclick: false,
1214
        onkeyup: false,
1215
        ignore: [],
1216
        rules: {
1217
            'name': {
1218
                required: true,
1219
                maxlength: 128,
1220
            },
1221
           'background': {
16906 efrain 1222
                required: false,
1223
                extension: 'jpg|jpeg|png',
1224
                accept: 'image/jpg,image/jpeg,image/png',
1 www 1225
            },
1226
            'quiz_id': {
1227
                required: true,
1228
            },
1229
            'order' : {
1230
                required: true,
1231
                digits: true,
1232
                min: 1,
1233
                max: 250
1234
            }
1235
        },
1236
        submitHandler: function(form)
1237
        {
1238
 
16906 efrain 1239
 
6650 nelberth 1240
            NProgress.start();
1 www 1241
            var formdata = false;
1242
            if (window.FormData){
1243
                formdata = new FormData(form); //form[0]);
1244
            }
1245
            $.ajax({
1246
                'dataType'  : 'json',
1247
                'accept'    : 'application/json',
1248
                'method'    : 'post',
6673 nelberth 1249
                'url'       :  $('#form-slide-quizz-edit').attr('action'),
1 www 1250
                'data'      :  formdata,
1251
                'processData': false,
1252
                'contentType': false,
1253
            }).done(function(response) {
1254
                if(response['success']) {
1255
                    $.fn.showSuccess(response['data']);
16906 efrain 1256
 
1 www 1257
 
1258
                    gridTable.api().ajax.reload(null, false);
16906 efrain 1259
 
1260
    	    	    $('#row-text-add-box').hide();
1261
                	$('#row-text-edit-box').hide();
1262
                	$('#row-image-add-box').hide();
1263
                	$('#row-image-edit-box').hide();
1264
                	$('#row-video-add-box').hide();
1265
                	$('#row-video-edit-box').hide();
1266
                	$('#row-document-add-box').hide();
1267
                	$('#row-document-edit-box').hide();
1268
                	$('#row-audio-add-box').hide();
1269
                	$('#row-audio-edit-box').hide();
1270
                	$('#row-quizz-add-box').hide();
1271
                    $('#row-quizz-edit-box').hide();
1272
                    $('#row-listing').show();
1 www 1273
                } else {
1274
                    validatorQuizzEdit.resetForm();
1275
                    if(jQuery.type(response['data']) == 'string') {
1276
                        $.fn.showError(response['data']);
1277
                    } else  {
1278
                        $.each(response['data'], function( fieldname, errors ) {
1279
                            $.fn.showFormErrorValidator('#form-slide-quizz-edit #' + fieldname, errors);
1280
                        });
1281
                    }
1282
                }
1283
            }).fail(function( jqXHR, textStatus, errorThrown) {
1284
                $.fn.showError(textStatus);
1285
            }).always(function() {
1286
                NProgress.done();
7060 nelberth 1287
 
16906 efrain 1288
 
1 www 1289
            });
1290
            return false;
1291
        },
1292
        invalidHandler: function(form, validator) {
1293
 
1294
        }
1295
    });
6591 nelberth 1296
 
1 www 1297
    $('body').on('click', 'button.btn-edit', function(e) {
1298
        e.preventDefault();
6651 nelberth 1299
        NProgress.start();
1 www 1300
        var url = $(this).data('href');
1301
        $.ajax({
1302
            'dataType'  : 'json',
1303
            'accept'    : 'application/json',
1304
            'method'    : 'get',
1305
            'url'       :  url,
1306
        }).done(function(response) {
1307
            if(response['success']) {
1308
 
16906 efrain 1309
                $('#row-listing').hide();
1310
 
1311
	    	    $('#row-text-add-box').hide();
1312
            	$('#row-text-edit-box').hide();
1313
            	$('#row-image-add-box').hide();
1314
            	$('#row-image-edit-box').hide();
1315
            	$('#row-video-add-box').hide();
1316
            	$('#row-video-edit-box').hide();
1317
            	$('#row-document-add-box').hide();
1318
            	$('#row-document-edit-box').hide();
1319
            	$('#row-audio-add-box').hide();
1320
            	$('#row-audio-edit-box').hide();
1321
            	$('#row-quizz-add-box').hide();
1322
                $('#row-quizz-edit-box').hide();
1323
 
1324
 
1 www 1325
                if(response['data']['type'] == 'text') {
1326
                    $('#form-slide-text-edit').attr('action',url);
1327
                    $('#form-slide-text-edit #name').val(response['data']['name']);
1328
                    $('#form-slide-text-edit #order').val(response['data']['order']);
16906 efrain 1329
                    $('#form-slide-text-edit #file').fileinput('reset');
1330
                    $('#form-slide-text-edit #file').val('');
1331
 
1 www 1332
                    CKEDITOR.instances.description_edit.setData(response['data']['description']);
1333
                    validatorTextEdit.resetForm();
1334
 
1335
 
16906 efrain 1336
                    $('#row-text-edit-box').show();
6595 nelberth 1337
 
1 www 1338
                }
1339
                if(response['data']['type'] == 'image') {
6510 nelberth 1340
                    console.log(response['data']['file'])
1 www 1341
                    $('#form-slide-image-edit').attr('action',url);
1342
                    $('#form-slide-image-edit #name').val(response['data']['name']);
1343
                    $('#form-slide-image-edit #order').val(response['data']['order']);
16906 efrain 1344
                    $('#form-slide-image-edit #background').fileinput('reset');
1345
                    $('#form-slide-image-edit #background').val('');
1 www 1346
                    validatorImageEdit.resetForm();
1347
 
16906 efrain 1348
                    $('#row-image-edit-box').show();
1 www 1349
 
1350
                }
1351
                if(response['data']['type'] == 'video') {
1352
                    $('#form-slide-video-edit').attr('action',url);
1353
                    $('#form-slide-video-edit #name').val(response['data']['name']);
1354
                    $('#form-slide-video-edit #order').val(response['data']['order']);
1355
                    $('#form-slide-video-edit #file').fileinput('reset');
16906 efrain 1356
                    $('#form-slide-video-edit #file').val('');
1357
                    $('#form-slide-video-edit #background').fileinput('reset');
1358
                    $('#form-slide-video-edit #background').val('');
1359
 
1 www 1360
 
16906 efrain 1361
                   $('#row-video-edit-box').show();
1 www 1362
 
1363
                }
1364
                if(response['data']['type'] == 'document') {
1365
                    $('#form-slide-document-edit').attr('action',url);
1366
                    $('#form-slide-document-edit #name').val(response['data']['name']);
1367
                    $('#form-slide-document-edit #order').val(response['data']['order']);
1368
                    $('#form-slide-document-edit #file').fileinput('reset');
1369
                    $('#form-slide-document-edit #file').val('');
16906 efrain 1370
                    $('#form-slide-document-edit #background').fileinput('reset');
1371
                    $('#form-slide-document-edit #background').val('');
1 www 1372
                    validatorDocumentEdit.resetForm();
1373
 
16906 efrain 1374
                    $('#row-document-edit-box').show();
1 www 1375
 
1376
                }
1377
                if(response['data']['type'] == 'audio') {
1378
                    $('#form-slide-audio-edit').attr('action',url);
1379
                    $('#form-slide-audio-edit #name').val(response['data']['name']);
1380
                    $('#form-slide-audio-edit #order').val(response['data']['order']);
1381
                    $('#form-slide-audio-edit #file').fileinput('reset');
1382
                    $('#form-slide-audio-edit #file').val('');
16905 efrain 1383
                    $('#form-slide-audio-edit #background').fileinput('reset');
1384
                    $('#form-slide-audio-edit #background').val('');
1 www 1385
                    validatorAudioEdit.resetForm();
1386
 
16906 efrain 1387
                    $('#row-audio-edit-box').show();
1 www 1388
 
6613 nelberth 1389
 
1 www 1390
                }
1391
                if(response['data']['type'] == 'quiz') {
1392
                    $('#form-slide-quizz-edit').attr('action',url);
1393
                    $('#form-slide-quizz-edit #name').val(response['data']['name']);
1394
                    $('#form-slide-quizz-edit #order').val(response['data']['order']);
1395
                    $('#form-slide-quizz-edit #quiz_id').val(response['data']['quiz_id']);
16906 efrain 1396
                    $('#form-slide-quizz-edit #background').fileinput('reset');
1397
                    $('#form-slide-quizz-edit #background').val('');
1 www 1398
                    validatorQuizzEdit.resetForm();
1399
 
16906 efrain 1400
                    $('#row-quizz-add-box').show();
1 www 1401
 
1402
                }
1403
 
1404
            } else {
1405
                validatorTextEdit.resetForm();
1406
                if(jQuery.type(response['data']) == 'string') {
1407
                    $.fn.showError(response['data']);
1408
                } else  {
1409
                    $.each(response['data'], function( fieldname, errors ) {
1410
                        $.fn.showFormErrorValidator('#form-slide-image-edit #' + fieldname, errors);
1411
                    });
1412
                }
1413
            }
1414
        }).fail(function( jqXHR, textStatus, errorThrown) {
1415
            $.fn.showError(textStatus);
1416
        }).always(function() {
1417
            NProgress.done();
1418
        });
1419
    });
16905 efrain 1420
 
16906 efrain 1421
    $(".btn-cancel").on("click", function(e){
1 www 1422
        e.preventDefault();
1423
 
16905 efrain 1424
 
16906 efrain 1425
    	$('#row-text-add-box').hide();
1426
    	$('#row-text-edit-box').hide();
1427
    	$('#row-image-add-box').hide();
1428
    	$('#row-image-edit-box').hide();
1429
    	$('#row-video-add-box').hide();
1430
    	$('#row-video-edit-box').hide();
1431
    	$('#row-document-add-box').hide();
1432
    	$('#row-document-edit-box').hide();
1433
    	$('#row-audio-add-box').hide();
1434
    	$('#row-audio-edit-box').hide();
1435
    	$('#row-quizz-add-box').hide();
1436
        $('#row-quizz-edit-box').hide();
1 www 1437
 
16906 efrain 1438
        $('#modal-play-video-box').modal('hide');
1439
        $('#modal-play-audio-box').modal('hide');
16910 efrain 1440
 
16905 efrain 1441
 
1 www 1442
         document.getElementById('microlearning-play-video').pause();
1443
         document.getElementById('microlearning-play-audio').pause();
16906 efrain 1444
 
1445
        $('#row-listing').show();
1 www 1446
 
1447
        return false;
1448
    });
1449
 
16910 efrain 1450
    $('#btn-add-quizz').click(function(e) {
1 www 1451
        e.preventDefault();
16906 efrain 1452
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1453
 
1454
 
1455
        $('#form-slide-quizz-add #name').val('');
1456
        $('#form-slide-quizz-add #order').val('1');
1457
        $('#form-slide-quizz-add #quiz_id').val('');
16905 efrain 1458
        $('#form-slide-quizz-add #file').fileinput('reset');
1459
        $('#form-slide-quizz-add #file').val('');
1 www 1460
        CKEDITOR.instances.description_add.setData('');
1461
        validatorQuizzAdd.resetForm();
1462
 
1463
 
16905 efrain 1464
        $('#row-listing').hide();
16906 efrain 1465
    	$('#row-quizz-add-box').show();
1466
 
1 www 1467
 
1468
        return false;
1469
    });
1470
 
16910 efrain 1471
    $('#btn-add-text').click(function(e) {
1 www 1472
        e.preventDefault();
1473
 
16906 efrain 1474
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1475
 
1476
        $('#form-slide-text-add #name').val('');
1477
        $('#form-slide-text-add #order').val('1');
16905 efrain 1478
        $('#form-slide-text-add #file').fileinput('reset');
1479
        $('#form-slide-text-add #file').val('');
1480
 
1 www 1481
        CKEDITOR.instances.description_add.setData('');
1482
        validatorTextAdd.resetForm();
1483
 
16905 efrain 1484
        $('#row-listing').hide();
16906 efrain 1485
    	$('#row-text-add-box').show();
1486
 
1 www 1487
    });
1488
 
1489
 
16910 efrain 1490
    $('#btn-add-image').click(function(e) {
1 www 1491
        e.preventDefault();
1492
 
16906 efrain 1493
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1494
        $('#form-slide-image-add #name').val('');
1495
        $('#form-slide-image-add #order').val('1');
16905 efrain 1496
        $('#form-slide-image-add #file').fileinput('reset');
1497
        $('#form-slide-image-add #file').val('');
6112 nelberth 1498
 
1 www 1499
        validatorImageAdd.resetForm();
1500
 
16905 efrain 1501
        $('#row-listing').hide();
16906 efrain 1502
    	$('#row-image-add-box').show();
1503
 
6122 nelberth 1504
 
1 www 1505
        return false;
1506
    });
1507
 
16910 efrain 1508
    $('#btn-add-video').click(function(e) {
1 www 1509
        e.preventDefault();
1510
 
16906 efrain 1511
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1512
        $('#form-slide-video-add #name').val('');
1513
        $('#form-slide-video-add #order').val('1');
1514
        $('#form-slide-video-add #file').fileinput('reset');
1515
        $('#form-slide-video-add #file').val('');
16905 efrain 1516
        $('#form-slide-video-add #background').fileinput('reset');
1517
        $('#form-slide-video-add #backgroud').val('');
1 www 1518
        validatorVideoAdd.resetForm();
1519
 
6616 nelberth 1520
 
16905 efrain 1521
        $('#row-listing').hide();
16906 efrain 1522
    	$('#row-video-add-box').show();
1523
 
1 www 1524
 
1525
        return false;
1526
    });
1527
 
16910 efrain 1528
    $('#btn-add-document').click(function(e) {
1 www 1529
        e.preventDefault();
1530
 
1531
 
16906 efrain 1532
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1533
        $('#form-slide-document-add #name').val('');
1534
        $('#form-slide-document-add #order').val('1');
1535
        $('#form-slide-document-add #file').fileinput('reset');
1536
        $('#form-slide-document-add #file').val('');
16905 efrain 1537
        $('#form-slide-document-add #background').fileinput('reset');
1538
        $('#form-slide-document-add #background').val('');
1 www 1539
        validatorDocumentAdd.resetForm();
1540
 
16905 efrain 1541
        $('#row-listing').hide();
16906 efrain 1542
    	$('#row-document-add-box').show();
1543
 
1 www 1544
 
1545
        return false;
1546
    });
1547
 
16910 efrain 1548
    $('#btn-add-audio').click(function(e) {
1 www 1549
        e.preventDefault();
1550
 
16906 efrain 1551
        $('#modal-add-capsule-type-box').modal('hide');
1 www 1552
        $('#form-slide-audio-add #name').val('');
1553
        $('#form-slide-audio-add #order').val('1');
1554
        $('#form-slide-audio-add #file').fileinput('reset');
1555
        $('#form-slide-audio-add #file').val('');
16905 efrain 1556
        $('#form-slide-audio-add #background').fileinput('reset');
1557
        $('#form-slide-audio-add #background').val('');
1 www 1558
        validatorAudioAdd.resetForm();
1559
 
16905 efrain 1560
        $('#row-listing').hide();
16906 efrain 1561
    	$('#row-audio-add-box').show();
1562
 
1 www 1563
 
1564
        return false;
1565
    });
1566
 
16905 efrain 1567
 
1 www 1568
 
16906 efrain 1569
    $('#modal-play-video-box, #modal-play-audio-box').on("hide.bs.modal", function() {
1 www 1570
 
1571
 
1572
        document.getElementById('microlearning-play-video').pause();
1573
        document.getElementById('microlearning-play-audio').pause();
1574
    })
1575
 
1576
 
1577
    $('#form-slide-text-add #order').inputNumberFormat({decimal: 0});
16906 efrain 1578
    $('#form-slide-text-edit #order').inputNumberFormat({decimal: 0});
1 www 1579
 
16906 efrain 1580
    $('#form-slide-text-add #background').fileinput({
1581
        theme: 'fa',
1582
        language: 'es',
1583
        showUpload: false,
1584
        dropZoneEnabled: false,
1585
        maxFileCount: 1,
16928 efrain 1586
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1587
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1588
    });
1 www 1589
 
1590
 
16906 efrain 1591
    $('#form-slide-text-edit #background').fileinput({
1592
        theme: 'fa',
1593
        language: 'es',
1594
        showUpload: false,
1595
        dropZoneEnabled: false,
1596
        maxFileCount: 1,
16928 efrain 1597
       msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1598
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1599
    });
1 www 1600
 
6591 nelberth 1601
 
16906 efrain 1602
 
1 www 1603
    $('#form-slide-image-add #order').inputNumberFormat({decimal: 0});
16906 efrain 1604
    $('#form-slide-image-edit #order').inputNumberFormat({decimal: 0});
1 www 1605
 
16906 efrain 1606
    $('#form-slide-image-add #file').fileinput({
1607
        theme: 'fa',
1608
        language: 'es',
1609
        showUpload: false,
1610
        dropZoneEnabled: false,
1611
        maxFileCount: 1,
16928 efrain 1612
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1613
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1614
    });
1 www 1615
 
1616
 
16906 efrain 1617
    $('#form-slide-image-edit #file').fileinput({
1618
        theme: 'fa',
1619
        language: 'es',
1620
        showUpload: false,
1621
        dropZoneEnabled: false,
1622
        maxFileCount: 1,
16928 efrain 1623
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1624
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1625
    });
1 www 1626
 
1627
    $('#form-slide-video-add #order').inputNumberFormat({decimal: 0});
16906 efrain 1628
    $('#form-slide-video-edit #order').inputNumberFormat({decimal: 0});
1 www 1629
 
1630
    $('#form-slide-video-add #file').fileinput({
12077 nelberth 1631
        theme: 'fa',
1 www 1632
        language: 'es',
1633
        showUpload: false,
1634
        dropZoneEnabled: false,
1635
        maxFileCount: 1,
1636
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1637
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1638
    });
1639
 
1640
 
1641
    $('#form-slide-video-edit #file').fileinput({
12077 nelberth 1642
        theme: 'fa',
1 www 1643
        language: 'es',
1644
        showUpload: false,
1645
        dropZoneEnabled: false,
1646
        maxFileCount: 1,
1647
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1648
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1649
    });
1650
 
16906 efrain 1651
    $('#form-slide-video-add #background').fileinput({
1652
        theme: 'fa',
1653
        language: 'es',
1654
        showUpload: false,
1655
        dropZoneEnabled: false,
1656
        maxFileCount: 1,
16928 efrain 1657
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1658
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1659
    });
1 www 1660
 
6591 nelberth 1661
 
16906 efrain 1662
    $('#form-slide-video-edit #background').fileinput({
1663
        theme: 'fa',
1664
        language: 'es',
1665
        showUpload: false,
1666
        dropZoneEnabled: false,
1667
        maxFileCount: 1,
16928 efrain 1668
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1669
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1670
    });
1671
 
1672
 
1 www 1673
 
1674
 
1675
    $('#form-slide-document-add #order').inputNumberFormat({decimal: 0});
1676
 
1677
    $('#form-slide-document-add #file').fileinput({
12077 nelberth 1678
        theme: 'fa',
1 www 1679
        language: 'es',
1680
        showUpload: false,
1681
        dropZoneEnabled: false,
1682
        maxFileCount: 1,
1683
        allowedFileExtensions: ['pdf'],
1684
        msgPlaceholder: 'Documentos de extensión pdf',
1685
    });
1686
 
1687
 
1688
 
6591 nelberth 1689
 
1 www 1690
    $('#form-slide-document-edit #order').inputNumberFormat({decimal: 0});
1691
 
1692
    $('#form-slide-document-edit #file').fileinput({
12077 nelberth 1693
        theme: 'fa',
1 www 1694
        language: 'es',
1695
        showUpload: false,
1696
        dropZoneEnabled: false,
1697
        maxFileCount: 1,
1698
        allowedFileExtensions: ['pdf'],
1699
        msgPlaceholder: 'Documentos de extensión pdf',
1700
    });
1701
 
16906 efrain 1702
    $('#form-slide-document-add #background').fileinput({
1703
        theme: 'fa',
1704
        language: 'es',
1705
        showUpload: false,
1706
        dropZoneEnabled: false,
1707
        maxFileCount: 1,
16928 efrain 1708
       msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1709
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1710
    });
1 www 1711
 
1712
 
16906 efrain 1713
    $('#form-slide-document-edit #background').fileinput({
1714
        theme: 'fa',
1715
        language: 'es',
1716
        showUpload: false,
1717
        dropZoneEnabled: false,
1718
        maxFileCount: 1,
16928 efrain 1719
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1720
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1721
    });
6591 nelberth 1722
 
16906 efrain 1723
 
1 www 1724
    $('#form-slide-audio-add #order').inputNumberFormat({decimal: 0});
1725
 
1726
    $('#form-slide-audio-add #file').fileinput({
12077 nelberth 1727
        theme: 'fa',
1 www 1728
        language: 'es',
1729
        showUpload: false,
1730
        dropZoneEnabled: false,
1731
        maxFileCount: 1,
1732
        allowedFileExtensions: ['wav', 'mp3'],
1733
        msgPlaceholder: 'Audios de extensión wav y mp3',
1734
    });
1735
 
1736
 
1737
 
6591 nelberth 1738
 
1 www 1739
    $('#form-slide-audio-edit #order').inputNumberFormat({decimal: 0});
1740
 
1741
    $('#form-slide-audio-edit #file').fileinput({
12077 nelberth 1742
        theme: 'fa',
1 www 1743
        language: 'es',
1744
        showUpload: false,
1745
        dropZoneEnabled: false,
1746
        maxFileCount: 1,
1747
        allowedFileExtensions: ['wav', 'mp3'],
1748
        msgPlaceholder: 'Audios de extensión wav y mp3',
1749
    });
1750
 
16906 efrain 1751
    $('#form-slide-audio-add #background').fileinput({
1752
        theme: 'fa',
1753
        language: 'es',
1754
        showUpload: false,
1755
        dropZoneEnabled: false,
1756
        maxFileCount: 1,
16928 efrain 1757
        msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1758
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1759
    });
1 www 1760
 
1761
 
16906 efrain 1762
    $('#form-slide-audio-edit #background').fileinput({
1763
        theme: 'fa',
1764
        language: 'es',
1765
        showUpload: false,
1766
        dropZoneEnabled: false,
1767
        maxFileCount: 1,
16928 efrain 1768
       msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1769
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1770
    });
6591 nelberth 1771
 
16906 efrain 1772
 
1773
 
1 www 1774
    $('#form-slide-quizz-add #order').inputNumberFormat({decimal: 0});
1775
 
1776
 
1777
 
6591 nelberth 1778
 
1 www 1779
    $('#form-slide-quizz-edit #order').inputNumberFormat({decimal: 0});
1780
 
6591 nelberth 1781
 
1 www 1782
 
16906 efrain 1783
    $('#form-slide-quizz-add #background').fileinput({
1784
        theme: 'fa',
1785
        language: 'es',
1786
        showUpload: false,
1787
        dropZoneEnabled: false,
1788
        maxFileCount: 1,
16928 efrain 1789
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1790
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1791
    });
1 www 1792
 
16906 efrain 1793
 
1794
    $('#form-slide-quizz-edit #background').fileinput({
1795
        theme: 'fa',
1796
        language: 'es',
1797
        showUpload: false,
1798
        dropZoneEnabled: false,
1799
        maxFileCount: 1,
16928 efrain 1800
        msgPlaceholder:  'LABEL_RECOMMENDED_SIZE $image_size',
16906 efrain 1801
        allowedFileExtensions: ['jpeg', 'jpg', 'png'],
1802
    });
1 www 1803
 
1804
 
1805
 
1806
 
1807
 
8290 stevensc 1808
    CKEDITOR.replace('description_add', {
1809
        toolbar: [
1810
                    { name: 'editing', items: ['Scayt'] },
1811
                    { name: 'links', items: ['Link', 'Unlink'] },
1812
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1813
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
1814
                    '/',
1815
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
1816
                    { name: 'styles', items: ['Styles', 'Format'] },
1817
                    { name: 'tools', items: ['Maximize'] }
1818
                ],
1819
                removePlugins: 'elementspath,Anchor',
1820
                heigth: 100
1821
    });
1822
    CKEDITOR.replace('description_edit',{
1823
        toolbar: [
1824
                    { name: 'editing', items: ['Scayt'] },
1825
                    { name: 'links', items: ['Link', 'Unlink'] },
1826
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1827
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
1828
                    '/',
1829
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
1830
                    { name: 'styles', items: ['Styles', 'Format'] },
1831
                    { name: 'tools', items: ['Maximize'] }
1832
                ],
1833
                removePlugins: 'elementspath,Anchor',
1834
                heigth: 100
1835
    });
1 www 1836
 
1837
 
1838
   $('body').on('click', '.btn-view-image', function(e) {
1839
        e.preventDefault();
1840
 
16906 efrain 1841
        $('#modal-view-image-box').modal('show');
1 www 1842
 
1843
        $('#image-view').attr('src', $(this).data('href'));
1844
 
1845
        return false;
1846
    });
1847
 
1848
 
1849
    $('body').on('click', '.btn-play-video', function(e) {
1850
        e.preventDefault();
1851
 
1852
        $('#microlearning-play-video').attr('src', $(this).data('href'));
16906 efrain 1853
        $('#modal-play-video-box').modal('show');
1 www 1854
 
1855
        return false;
1856
    });
1857
 
1858
    $('body').on('click', '.btn-play-audio', function(e) {
1859
        e.preventDefault();
1860
 
1861
 
1862
        $('#microlearning-play-audio').attr('src', $(this).data('href'));
16906 efrain 1863
        $('#modal-play-audio-box').modal('show');
1 www 1864
 
1865
        return false;
1866
    });
1867
 
1868
    $('body').on('click', '.btn-view-document', function(e) {
1869
        e.preventDefault();
1870
 
1871
 
1872
        $('#document-view').attr('src', $(this).data('href'));
16906 efrain 1873
        $('#modal-view-document-box').modal('show');
1 www 1874
 
1875
        return false;
1876
    });
1877
 
1878
    $('body').on('click', '.btn-view-text', function(e) {
1879
        e.preventDefault();
1880
 
1881
        var url = $(this).data('href');
1882
        $.ajax({
1883
            'dataType'  : 'json',
1884
            'accept'    : 'application/json',
1885
            'method'    : 'get',
1886
            'url'       :  url,
1887
        }).done(function(response) {
1888
            if(response['success']) {
1889
                $('#document-text').html( response['data']  );
1890
            }
1891
 
1892
        }).fail(function( jqXHR, textStatus, errorThrown) {
1893
            $.fn.showError(textStatus);
1894
        }).always(function() {
1895
            NProgress.done();
1896
        });
1897
 
1898
 
16906 efrain 1899
        $('#modal-view-text-box').modal('show');
1 www 1900
 
1901
        return false;
1902
    });
1903
 
1904
 
1905
 
1906
    $('#form-filter #topic_uuid').change(function(e) {
1907
        e.preventDefault();
1908
 
1909
        $('#form-filter #capsule_uuid').empty();
1910
        gridTable.api().ajax.reload(null, false);
1911
    })
1912
 
1913
 
1914
    $('#form-filter #capsule_uuid').change(function(e) {
1915
        e.preventDefault();
1916
 
1917
        gridTable.api().ajax.reload(null, false);
1918
    })
1919
 
1920
    $('button.btn-add').click(function(e) {
1921
        e.preventDefault()
1922
 
16906 efrain 1923
        $('#modal-add-capsule-type-box').modal('show');
1 www 1924
 
1925
    } );
1926
 
16822 efrain 1927
    $('body').on('click', 'button.btn-delete', function(e) {
1928
        e.preventDefault();
1929
        var action = $(this).data('href');
1 www 1930
 
1931
 
16822 efrain 1932
          swal.fire({
1933
            title: 'LABEL_ARE_YOU_SURE',
1934
            icon: 'question',
1935
            cancelButtonText: 'LABEL_NO',
1936
            showCancelButton: true,
1937
            confirmButtonText: 'LABEL_YES'
1938
          }).then((result) => {
1939
            if (result.isConfirmed) {
1940
 
1941
                    NProgress.start();
1942
                    $.ajax({
1943
                        'dataType'  : 'json',
1944
                        'accept'    : 'application/json',
1945
                        'method'    : 'post',
1946
                        'url'       :  action,
1947
                    }).done(function(response) {
1948
                        if(response['success']) {
1949
                            $.fn.showSuccess(response['data']);
1950
                            gridTable.api().ajax.reload(null, false);
1951
                        } else {
1952
                            $.fn.showError(response['data']);
1953
                        }
1954
                    }).fail(function( jqXHR, textStatus, errorThrown) {
1955
                        $.fn.showError(textStatus);
1956
                    }).always(function() {
1957
                        NProgress.done();
1958
                    });
1959
            }
1960
       });
1961
    });
1962
 
1963
 
1 www 1964
    $('body').on('click', 'button.btn-refresh', function(e) {
1965
        e.preventDefault();
1966
        gridTable.api().ajax.reload(null, false);
1967
    });
1968
 
6113 nelberth 1969
 
1 www 1970
});
1971
JS;
1972
$this->inlineScript()->captureEnd();
1973
?>
1974
 
16905 efrain 1975
<div class="container">
1976
	<div class="card" id="row-listing">
1977
	 	<div class="card-header">
1978
	 		<h6 class="card-title">LABEL_SLIDES</h6>
1979
	 	</div>
1980
	 	<div class="card-body">
1 www 1981
 
16905 efrain 1982
	 			<?php
1983
                $form = $this->form;
1984
                $form->setAttributes([
1985
                    'name'    => 'form-filter',
1986
                    'id'      => 'form-filter',
1987
                ]);
1 www 1988
 
16905 efrain 1989
                $form->prepare();
1990
                echo $this->form()->openTag($form);
1991
                ?>
1992
             	<div class="row">
1993
                	<div class="col-md-6 mt-3">
1994
               			<?php
1995
                        $element = $form->get('topic_uuid');
1996
                        $element->setOptions(['label' => 'LABEL_TOPIC']);
1997
 
1998
                        $element->setAttributes(['class' => 'form-control']);
1999
                        echo $this->formLabel($element);
2000
                        echo $this->formSelect($element);
1 www 2001
                        ?>
16905 efrain 2002
                   	</div>
2003
 
2004
         	    	<div class="col-md-6 mt-3">
2005
        				<?php
2006
                        $element = $form->get('capsule_uuid');
2007
                        $element->setOptions(['label' => 'LABEL_CAPSULE']);
2008
                        $element->setAttributes(['class' => 'form-control']);
2009
                        echo $this->formLabel($element);
2010
                        echo $this->formSelect($element);
2011
                        ?>
2012
                	</div>
2013
              	</div>
2014
 
2015
				<?php echo $this->form()->closeTag($form); ?>
2016
 
2017
 
2018
				<div class="row">
2019
    	 	 		<div class="col-12 mt-3">
2020
 
2021
    	 	 			<table id="gridTable" class="table   table-bordered">
1 www 2022
                      		<thead>
2023
        						<tr>
2024
                                	<th>LABEL_NAME</th>
2025
                                  	<th>LABEL_DETAILS</th>
2026
                                  	<th>LABEL_MEDIA</th>
2027
                                  	<th>LABEL_ACTIONS</th>
2028
                                </tr>
2029
                       		</thead>
2030
                         	<tbody>
2031
                         	</tbody>
2032
                    	</table>
16905 efrain 2033
 
2034
  					</div>
2035
				</div>
2036
		</div>
1 www 2037
 
16905 efrain 2038
	 	<div class="card-footer text-right">
16992 efrain 2039
	 	     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH  </button>
16905 efrain 2040
			<?php if($allowAdd) : ?>
16910 efrain 2041
			<div class="btn-group dropup">
2042
            	<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2043
            		<i class="fa fa-plus"></i> LABEL_ADD
2044
            	</button>
2045
            	<div class="dropdown-menu">
2046
 
2047
            		<a class="dropdown-item" href="#" id="btn-add-image"><i class="fa fa-image mr-2" aria-hidden="true"></i> LABEL_IMAGE </a>
2048
                   	<a class="dropdown-item" href="#" id="btn-add-text"><i class="fa fa-file mr-2" aria-hidden="true"></i> LABEL_TEXT </a>
2049
                    <a class="dropdown-item" href="#" id="btn-add-video"><i class="fa fa-video mr-2" aria-hidden="true"></i> LABEL_VIDEO </a>
2050
                    <a class="dropdown-item" href="#" id="btn-add-document"><i class="fa fa-file mr-2" aria-hidden="true"></i> LABEL_DOCUMENT </a>
2051
                    <a class="dropdown-item" href="#" id="btn-add-audio"><i class="fa fa-music mr-2" aria-hidden="true"></i> LABEL_AUDIO </a>
2052
                    <a class="dropdown-item" href="#" id="btn-add-quizz"><i class="fa fa-question mr-2" aria-hidden="true"></i> LABEL_QUIZ </a>
2053
 
2054
 
2055
            	</div>
2056
            </div>
2057
 
2058
 
16905 efrain 2059
			<?php endif; ?>
2060
	 	</div>
2061
	</div>
6528 nelberth 2062
 
16905 efrain 2063
 
16906 efrain 2064
	<div class="card" id="row-text-add-box" style="display: none">
16905 efrain 2065
	 	<div class="card-header">
2066
	 		<h6 class="card-title">LABEL_ADD_TEXT_SLIDE</h6>
2067
	 	</div>
2068
	 	<?php
1 www 2069
    	    $form = $this->formTextAdd;
2070
    	    $form->setAttributes([
2071
    	       'method'    => 'post',
2072
    	       'name'      => 'form-slide-text-add',
2073
    	       'id'        => 'form-slide-text-add'
2074
    	    ]);
2075
    	    $form->prepare();
2076
    	    echo $this->form()->openTag($form);
2077
 
2078
    	    $element = $form->get('type');
2079
    	    echo $this->formHidden($element);
2080
 
2081
    	    ?>
16905 efrain 2082
	 	<div class="card-body">
1 www 2083
 
16905 efrain 2084
	 		<div class="row">
2085
	 	         <div class="col-12 mt-3">
1 www 2086
    				<?php
2087
                        $element = $form->get('name');
2088
                        $element->setAttributes(['class' => 'form-control']);
2089
                        $element->setOptions(['label' => 'LABEL_NAME']);
2090
                        echo $this->formLabel($element);
2091
                        echo $this->formText($element);
2092
                    ?>
16905 efrain 2093
	 	         </div>
2094
	 	     </div>
2095
	 		<div class="row">
2096
	 	         <div class="col-12 mt-3">
1 www 2097
                	<?php
2098
                    $element = $form->get('description');
2099
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 2100
                    $element->setAttributes(['id' => 'description_add', 'rows' => '2',  'class' => 'form-control']);
1 www 2101
                    echo $this->formLabel($element);
2102
                    echo $this->formTextArea($element);
2103
                    ?>
16905 efrain 2104
	 	         </div>
2105
	 	     </div>
2106
	 		<div class="row">
2107
	 	         <div class="col-12 mt-3">
1 www 2108
    				<?php
2109
                        $element = $form->get('order');
2110
                        $element->setAttributes(['class' => 'form-control']);
2111
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2112
                        echo $this->formLabel($element);
2113
                        echo $this->formText($element);
2114
                    ?>
2115
				</div>
16906 efrain 2116
			</div>
16905 efrain 2117
	 		<div class="row">
2118
	 	         <div class="col-12 mt-3">
6529 nelberth 2119
                <?php
2120
                    $element = $form->get('background');
16905 efrain 2121
                    $element->setAttributes([ 'class' => 'form-control']);
2122
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2123
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2124
					echo $this->formLabel($element);
2125
                    echo $this->formFile($element);
2126
                ?>
2127
	 	         </div>
2128
	 	     </div>
2129
	 	</div>
2130
	 	<div class="card-footer text-right">
2131
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2132
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2133
	 	</div>
2134
	 	<?php echo $this->form()->closeTag($form); ?>
2135
	</div>
2136
 
16906 efrain 2137
	<div class="card" id="row-text-edit-box" style="display: none">
16905 efrain 2138
	 	<div class="card-header">
2139
	 		<h6 class="card-title">LABEL_EDIT_TEXT_SLIDE</h6>
2140
	 	</div>
2141
	 	<?php
1 www 2142
    	    $form = $this->formTextEdit;
2143
    	    $form->setAttributes([
2144
    	       'method'    => 'post',
2145
    	       'name'      => 'form-slide-text-edit',
2146
    	       'id'        => 'form-slide-text-edit'
2147
    	    ]);
2148
    	    $form->prepare();
2149
    	    echo $this->form()->openTag($form);
2150
 
2151
    	    $element = $form->get('type');
2152
    	    echo $this->formHidden($element);
2153
 
6595 nelberth 2154
    	    ?>
16905 efrain 2155
	 	<div class="card-body">
1 www 2156
 
16905 efrain 2157
	 		<div class="row">
2158
	 	         <div class="col-12 mt-3">
1 www 2159
    				<?php
2160
                        $element = $form->get('name');
2161
                        $element->setAttributes(['class' => 'form-control']);
2162
                        $element->setOptions(['label' => 'LABEL_NAME']);
2163
                        echo $this->formLabel($element);
2164
                        echo $this->formText($element);
2165
                    ?>
16905 efrain 2166
	 	         </div>
2167
	 	     </div>
2168
 
2169
	 		<div class="row">
2170
	 	         <div class="col-12 mt-3">
1 www 2171
                	<?php
2172
                    $element = $form->get('description');
2173
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 2174
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2',  'class' => 'form-control']);
1 www 2175
                    echo $this->formLabel($element);
2176
                    echo $this->formTextArea($element);
2177
                    ?>
16905 efrain 2178
	 	         </div>
2179
	 	     </div>
2180
 
2181
	 		<div class="row">
2182
	 	         <div class="col-12 mt-3">
1 www 2183
    				<?php
2184
                        $element = $form->get('order');
2185
                        $element->setAttributes(['class' => 'form-control']);
2186
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2187
                        echo $this->formLabel($element);
2188
                        echo $this->formText($element);
2189
                    ?>
16905 efrain 2190
	 	         </div>
2191
	 	     </div>
2192
 
2193
	 		<div class="row">
2194
	 	         <div class="col-12 mt-3">
6595 nelberth 2195
                <?php
2196
                    $element = $form->get('background');
16905 efrain 2197
                    $element->setAttributes([ 'class' => 'form-control']);
2198
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2199
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2200
					echo $this->formLabel($element);
2201
                    echo $this->formFile($element);
2202
                ?>
2203
	 	         </div>
2204
	 	     </div>
2205
	 	</div>
2206
	 	<div class="card-footer text-right">
2207
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2208
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2209
	 	</div>
2210
	 	<?php echo $this->form()->closeTag($form); ?>
2211
 
2212
	</div>
2213
 
6595 nelberth 2214
 
16905 efrain 2215
 
1 www 2216
 
2217
 
16906 efrain 2218
	<div class="card" id="row-image-add-box" style="display: none">
16905 efrain 2219
	 	<div class="card-header">
2220
	 		<h6 class="card-title">LABEL_ADD_IMAGE_SLIDE</h6>
2221
	 	</div>
2222
		<?php
1 www 2223
    	    $form = $this->formImageAdd;
2224
    	    $form->setAttributes([
2225
    	       'method'    => 'post',
2226
    	        'name'      => 'form-slide-image-add',
2227
    	        'id'        => 'form-slide-image-add'
2228
    	    ]);
2229
    	    $form->prepare();
2230
    	    echo $this->form()->openTag($form);
2231
 
2232
    	    $element = $form->get('type');
2233
    	    echo $this->formHidden($element);
2234
 
2235
    	    ?>
16905 efrain 2236
	 	<div class="card-body">
1 www 2237
 
16905 efrain 2238
	 		<div class="row">
2239
	 	         <div class="col-12 mt-3">
1 www 2240
    				<?php
2241
                        $element = $form->get('name');
2242
                        $element->setAttributes(['class' => 'form-control']);
2243
                        $element->setOptions(['label' => 'LABEL_NAME']);
2244
                        echo $this->formLabel($element);
2245
                        echo $this->formText($element);
2246
                    ?>
16905 efrain 2247
	 	         </div>
2248
	 	     </div>
2249
	 		<div class="row">
2250
	 	         <div class="col-12 mt-3">
6137 nelberth 2251
 
6134 nelberth 2252
                <?php
2253
                    $element = $form->get('file');
16905 efrain 2254
					$element->setAttributes([ 'class' => 'form-control']);
2255
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2256
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2257
					echo $this->formLabel($element);
2258
                    echo $this->formFile($element);
6134 nelberth 2259
                ?>
16905 efrain 2260
	 	         </div>
2261
	 	     </div>
2262
	 		<div class="row">
2263
	 	         <div class="col-12 mt-3">
1 www 2264
    				<?php
2265
                        $element = $form->get('order');
2266
                        $element->setAttributes(['class' => 'form-control']);
2267
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2268
                        echo $this->formLabel($element);
2269
                        echo $this->formText($element);
2270
                    ?>
16905 efrain 2271
	 	         </div>
2272
	 	     </div>
2273
	 	</div>
2274
	 	<div class="card-footer text-right">
2275
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2276
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2277
	 	</div>
2278
	 	<?php echo $this->form()->closeTag($form); ?>
2279
	</div>
2280
 
2281
 
16906 efrain 2282
	<div class="card" id="row-image-edit-box" style="display: none">
16905 efrain 2283
	 	<div class="card-header">
2284
	 		<h6 class="card-title">LABEL_EDIT_IMAGE_SLIDE</h6>
2285
	 	</div>
2286
	 	 <?php
6505 nelberth 2287
    	    $form = $this->formImageEdit;
2288
    	    $form->setAttributes([
2289
    	       'method'    => 'post',
2290
    	       'name'      => 'form-slide-image-edit',
2291
    	       'id'        => 'form-slide-image-edit'
2292
    	    ]);
2293
    	    $form->prepare();
2294
    	    echo $this->form()->openTag($form);
2295
 
2296
    	    $element = $form->get('type');
2297
    	    echo $this->formHidden($element);
2298
 
2299
    	    ?>
16905 efrain 2300
	 	<div class="card-body">
6505 nelberth 2301
 
16905 efrain 2302
	 		<div class="row">
2303
	 	         <div class="col-12 mt-3">
6505 nelberth 2304
    				<?php
2305
                        $element = $form->get('name');
2306
                        $element->setAttributes(['class' => 'form-control']);
2307
                        $element->setOptions(['label' => 'LABEL_NAME']);
2308
                        echo $this->formLabel($element);
2309
                        echo $this->formText($element);
2310
                    ?>
16905 efrain 2311
	 	         </div>
2312
	 	     </div>
6505 nelberth 2313
 
16905 efrain 2314
	 		<div class="row">
2315
	 	         <div class="col-12 mt-3">
6505 nelberth 2316
                <?php
2317
                    $element = $form->get('file');
16905 efrain 2318
					$element->setAttributes([ 'class' => 'form-control']);
2319
					$element->setOptions(['label' => 'LABEL_IMAGE']);
2320
					$element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2321
					echo $this->formLabel($element);
2322
                    echo $this->formFile($element);
6505 nelberth 2323
                ?>
16905 efrain 2324
	 	         </div>
2325
	 	     </div>
2326
	 		<div class="row">
2327
	 	         <div class="col-12 mt-3">
6505 nelberth 2328
    				<?php
2329
                        $element = $form->get('order');
2330
                        $element->setAttributes(['class' => 'form-control']);
2331
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2332
                        echo $this->formLabel($element);
2333
                        echo $this->formText($element);
2334
                    ?>
2335
				</div>
16905 efrain 2336
	 	     </div>
2337
	 	</div>
2338
	 	<div class="card-footer text-right">
2339
			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2340
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2341
	 	</div>
2342
	 	<?php echo $this->form()->closeTag($form); ?>
2343
	</div>
2344
 
16906 efrain 2345
	<div class="card" id="row-video-add-box" style="display: none">
16905 efrain 2346
	 	<div class="card-header">
2347
	 		<h6 class="card-title">LABEL_ADD_VIDEO_SLIDE</h6>
2348
	 	</div>
2349
	 	<?php
1 www 2350
    	    $form = $this->formVideoAdd;
2351
    	    $form->setAttributes([
2352
    	       'method'    => 'post',
2353
    	        'name'      => 'form-slide-video-add',
2354
    	        'id'        => 'form-slide-video-add'
2355
    	    ]);
2356
    	    $form->prepare();
2357
    	    echo $this->form()->openTag($form);
2358
 
2359
    	    $element = $form->get('type');
2360
    	    echo $this->formHidden($element);
2361
 
2362
    	    ?>
16905 efrain 2363
	 	<div class="card-body">
2364
	 		<div class="row">
2365
	 	         <div class="col-12 mt-3">
2366
	 	         </div>
2367
	 	     </div>
2368
 
2369
	 		<div class="row">
2370
	 	         <div class="col-12 mt-3">
1 www 2371
    				<?php
2372
                        $element = $form->get('name');
2373
                        $element->setAttributes(['class' => 'form-control']);
2374
                        $element->setOptions(['label' => 'LABEL_NAME']);
2375
                        echo $this->formLabel($element);
2376
                        echo $this->formText($element);
2377
                    ?>
16905 efrain 2378
	 	         </div>
2379
	 	     </div>
2380
	 		<div class="row">
2381
	 	         <div class="col-12 mt-3">
1 www 2382
    				<?php
2383
                        $element = $form->get('order');
2384
                        $element->setAttributes(['class' => 'form-control']);
2385
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2386
                        echo $this->formLabel($element);
2387
                        echo $this->formText($element);
2388
                    ?>
16905 efrain 2389
	 	         </div>
2390
	 	     </div>
2391
	 		<div class="row">
2392
	 	         <div class="col-12 mt-3">
1 www 2393
 
2394
                 		<?php
2395
                        $element = $form->get('file');
2396
                        $element->setAttributes(['class' => 'form-control']);
2397
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
2398
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
2399
                        echo $this->formLabel($element);
16905 efrain 2400
                        echo $this->formFile($element);
1 www 2401
                        ?>
16905 efrain 2402
	 	         </div>
2403
	 	     </div>
2404
	 		<div class="row">
2405
	 	         <div class="col-12 mt-3">
2406
                 		<?php
2407
                        $element = $form->get('background');
2408
                        $element->setAttributes(['class' => 'form-control']);
2409
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2410
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2411
                        echo $this->formLabel($element);
2412
                        echo $this->formFile($element);
2413
                        ?>
2414
 
2415
	 	         </div>
2416
	 	     </div>
2417
	 	</div>
2418
	 	<div class="card-footer text-right">
2419
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2420
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2421
	 	</div>
2422
	 	<?php echo $this->form()->closeTag($form); ?>
2423
	</div>
2424
 
2425
 
16906 efrain 2426
	<div class="card" id="row-video-edit-box" style="display: none">
16905 efrain 2427
	 	<div class="card-header">
2428
	 		<h6 class="card-title">>LABEL_EDIT_VIDEO_SLIDE</h6>
2429
	 	</div>
2430
	 	<?php
2431
    	 	$form = $this->formVideoEdit;
2432
    	 	$form->setAttributes([
2433
    	 	    'method'    => 'post',
2434
    	 	    'name'      => 'form-slide-video-edit',
2435
    	 	    'id'        => 'form-slide-video-edit'
2436
    	 	]);
1 www 2437
    	    $form->prepare();
2438
    	    echo $this->form()->openTag($form);
2439
 
2440
    	    $element = $form->get('type');
2441
    	    echo $this->formHidden($element);
2442
 
2443
    	    ?>
16905 efrain 2444
	 	<div class="card-body">
2445
	 		<div class="row">
2446
	 	         <div class="col-12 mt-3">
2447
	 	         </div>
2448
	 	     </div>
2449
 
2450
	 		<div class="row">
2451
	 	         <div class="col-12 mt-3">
1 www 2452
    				<?php
2453
                        $element = $form->get('name');
2454
                        $element->setAttributes(['class' => 'form-control']);
2455
                        $element->setOptions(['label' => 'LABEL_NAME']);
2456
                        echo $this->formLabel($element);
2457
                        echo $this->formText($element);
2458
                    ?>
16905 efrain 2459
	 	         </div>
2460
	 	     </div>
2461
	 		<div class="row">
2462
	 	         <div class="col-12 mt-3">
1 www 2463
    				<?php
2464
                        $element = $form->get('order');
2465
                        $element->setAttributes(['class' => 'form-control']);
2466
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2467
                        echo $this->formLabel($element);
2468
                        echo $this->formText($element);
2469
                    ?>
16905 efrain 2470
	 	         </div>
2471
	 	     </div>
2472
	 		<div class="row">
2473
	 	         <div class="col-12 mt-3">
2474
 
1 www 2475
                 		<?php
2476
                        $element = $form->get('file');
2477
                        $element->setAttributes(['class' => 'form-control']);
2478
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
2479
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
2480
                        echo $this->formLabel($element);
16905 efrain 2481
                        echo $this->formFile($element);
1 www 2482
                        ?>
16905 efrain 2483
	 	         </div>
2484
	 	     </div>
2485
	 		<div class="row">
2486
	 	         <div class="col-12 mt-3">
2487
                 		<?php
2488
                        $element = $form->get('background');
2489
                        $element->setAttributes(['class' => 'form-control']);
2490
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2491
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2492
                        echo $this->formLabel($element);
2493
                        echo $this->formFile($element);
2494
                        ?>
2495
 
2496
	 	         </div>
2497
	 	     </div>
2498
	 	</div>
2499
	 	<div class="card-footer text-right">
2500
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2501
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2502
	 	</div>
2503
	 	<?php echo $this->form()->closeTag($form); ?>
2504
	</div>
2505
 
2506
 
16906 efrain 2507
	<div class="card" id="row-document-add-box" style="display: none">
16905 efrain 2508
	 	<div class="card-header">
2509
	 		<h6 class="card-title">LABEL_ADD_DOCUMENT_SLIDE</h6>
2510
	 	</div>
2511
	 	<?php
1 www 2512
    	    $form = $this->formDocumentAdd;
2513
    	    $form->setAttributes([
2514
    	       'method'    => 'post',
2515
    	        'name'      => 'form-slide-document-add',
2516
    	        'id'        => 'form-slide-document-add'
2517
    	    ]);
2518
    	    $form->prepare();
2519
    	    echo $this->form()->openTag($form);
2520
 
2521
    	    $element = $form->get('type');
2522
    	    echo $this->formHidden($element);
2523
 
2524
    	    ?>
16905 efrain 2525
	 	<div class="card-body">
1 www 2526
 
16905 efrain 2527
 
2528
	 		<div class="row">
2529
	 	         <div class="col-12 mt-3">
1 www 2530
    				<?php
2531
                        $element = $form->get('name');
2532
                        $element->setAttributes(['class' => 'form-control']);
2533
                        $element->setOptions(['label' => 'LABEL_NAME']);
2534
                        echo $this->formLabel($element);
2535
                        echo $this->formText($element);
2536
                    ?>
16905 efrain 2537
	 	         </div>
2538
	 	     </div>
2539
	 		<div class="row">
2540
	 	         <div class="col-12 mt-3">
1 www 2541
    				<?php
2542
                        $element = $form->get('order');
2543
                        $element->setAttributes(['class' => 'form-control']);
2544
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2545
                        echo $this->formLabel($element);
2546
                        echo $this->formText($element);
2547
                    ?>
16905 efrain 2548
	 	         </div>
2549
	 	     </div>
2550
	 		<div class="row">
2551
	 	         <div class="col-12 mt-3">
1 www 2552
 
2553
                 		<?php
2554
                        $element = $form->get('file');
2555
                        $element->setAttributes(['class' => 'form-control']);
2556
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
2557
                        $element->setAttributes(['accept' => 'application/pdf']);
2558
                        echo $this->formLabel($element);
16905 efrain 2559
                        echo $this->formFile($element);
1 www 2560
                        ?>
16905 efrain 2561
 
1 www 2562
 
16905 efrain 2563
	 	         </div>
2564
	 	     </div>
2565
	 		<div class="row">
2566
	 	         <div class="col-12 mt-3">
2567
                 		<?php
2568
                        $element = $form->get('background');
2569
                        $element->setAttributes(['class' => 'form-control']);
2570
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2571
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2572
                        echo $this->formLabel($element);
2573
                        echo $this->formFile($element);
2574
                        ?>
6656 nelberth 2575
 
16905 efrain 2576
	 	         </div>
2577
	 	     </div>
2578
	 	</div>
2579
	 	<div class="card-footer text-right">
2580
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2581
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2582
	 	</div>
2583
	 	<?php echo $this->form()->closeTag($form); ?>
2584
	</div>
2585
 
2586
 
16906 efrain 2587
	<div class="card" id="row-document-edit-box" style="display: none">
16905 efrain 2588
	 	<div class="card-header">
2589
	 		<h6 class="card-title">LABEL_EDIT_DOCUMENT_SLIDE</h6>
2590
	 	</div>
2591
	 	<?php
2592
    	 	$form = $this->formDocumentEdit;
2593
    	 	$form->setAttributes([
2594
    	 	    'method'    => 'post',
2595
    	 	    'name'      => 'form-slide-document-edit',
2596
    	 	    'id'        => 'form-slide-document-edit'
2597
    	 	]);
1 www 2598
    	    $form->prepare();
2599
    	    echo $this->form()->openTag($form);
2600
 
2601
    	    $element = $form->get('type');
2602
    	    echo $this->formHidden($element);
2603
 
2604
    	    ?>
16905 efrain 2605
	 	<div class="card-body">
1 www 2606
 
16905 efrain 2607
 
2608
	 		<div class="row">
2609
	 	         <div class="col-12 mt-3">
1 www 2610
    				<?php
2611
                        $element = $form->get('name');
2612
                        $element->setAttributes(['class' => 'form-control']);
2613
                        $element->setOptions(['label' => 'LABEL_NAME']);
2614
                        echo $this->formLabel($element);
2615
                        echo $this->formText($element);
2616
                    ?>
16905 efrain 2617
	 	         </div>
2618
	 	     </div>
2619
	 		<div class="row">
2620
	 	         <div class="col-12 mt-3">
1 www 2621
    				<?php
2622
                        $element = $form->get('order');
2623
                        $element->setAttributes(['class' => 'form-control']);
2624
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2625
                        echo $this->formLabel($element);
2626
                        echo $this->formText($element);
2627
                    ?>
16905 efrain 2628
	 	         </div>
2629
	 	     </div>
2630
	 		<div class="row">
2631
	 	         <div class="col-12 mt-3">
1 www 2632
 
2633
                 		<?php
2634
                        $element = $form->get('file');
2635
                        $element->setAttributes(['class' => 'form-control']);
2636
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
2637
                        $element->setAttributes(['accept' => 'application/pdf']);
2638
                        echo $this->formLabel($element);
16905 efrain 2639
                        echo $this->formFile($element);
1 www 2640
                        ?>
16905 efrain 2641
 
1 www 2642
 
16905 efrain 2643
	 	         </div>
2644
	 	     </div>
2645
	 		<div class="row">
2646
	 	         <div class="col-12 mt-3">
2647
                 		<?php
2648
                        $element = $form->get('background');
2649
                        $element->setAttributes(['class' => 'form-control']);
2650
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2651
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2652
                        echo $this->formLabel($element);
2653
                        echo $this->formFile($element);
2654
                        ?>
6656 nelberth 2655
 
16905 efrain 2656
	 	         </div>
2657
	 	     </div>
2658
	 	</div>
2659
	 	<div class="card-footer text-right">
2660
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2661
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2662
	 	</div>
2663
	 	<?php echo $this->form()->closeTag($form); ?>
2664
	</div>
2665
 
16906 efrain 2666
	<div class="card" id="row-audio-add-box" style="display: none">
16905 efrain 2667
	 	<div class="card-header">
2668
	 		<h6 class="card-title">LABEL_ADD_AUDIO_SLIDE</h6>
2669
	 	</div>
2670
	 	<?php
1 www 2671
    	    $form = $this->formAudioAdd;
2672
    	    $form->setAttributes([
2673
    	       'method'    => 'post',
2674
    	        'name'      => 'form-slide-audio-add',
2675
    	        'id'        => 'form-slide-audio-add'
2676
    	    ]);
2677
    	    $form->prepare();
2678
    	    echo $this->form()->openTag($form);
2679
 
2680
    	    $element = $form->get('type');
2681
    	    echo $this->formHidden($element);
2682
 
2683
    	    ?>
16905 efrain 2684
	 	<div class="card-body">
2685
	 		<div class="row">
2686
	 	         <div class="col-12 mt-3">
2687
	 	         </div>
2688
	 	     </div>
2689
 
2690
	 		<div class="row">
2691
	 	         <div class="col-12 mt-3">
1 www 2692
    				<?php
2693
                        $element = $form->get('name');
2694
                        $element->setAttributes(['class' => 'form-control']);
2695
                        $element->setOptions(['label' => 'LABEL_NAME']);
2696
                        echo $this->formLabel($element);
2697
                        echo $this->formText($element);
2698
                    ?>
16905 efrain 2699
	 	         </div>
2700
	 	     </div>
2701
	 		<div class="row">
2702
	 	         <div class="col-12 mt-3">
1 www 2703
    				<?php
2704
                        $element = $form->get('order');
2705
                        $element->setAttributes(['class' => 'form-control']);
2706
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2707
                        echo $this->formLabel($element);
2708
                        echo $this->formText($element);
2709
                    ?>
16905 efrain 2710
	 	         </div>
2711
	 	     </div>
2712
	 		<div class="row">
2713
	 	         <div class="col-12 mt-3">
1 www 2714
 
2715
                 		<?php
2716
                        $element = $form->get('file');
2717
                        $element->setAttributes(['class' => 'form-control']);
2718
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
2719
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
2720
                        echo $this->formLabel($element);
16905 efrain 2721
                        echo $this->formFile($element);
2722
 
1 www 2723
                        ?>
16905 efrain 2724
	 	         </div>
2725
	 	     </div>
2726
	 		<div class="row">
2727
	 	         <div class="col-12 mt-3">
2728
                 		<?php
2729
                        $element = $form->get('background');
2730
                        $element->setAttributes(['class' => 'form-control']);
2731
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2732
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2733
                        echo $this->formLabel($element);
2734
                        echo $this->formFile($element);
2735
                        ?>
2736
 
2737
	 	         </div>
2738
	 	     </div>
2739
	 	</div>
2740
	 	<div class="card-footer text-right">
2741
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2742
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2743
	 	</div>
2744
	 	<?php echo $this->form()->closeTag($form); ?>
2745
	</div>
2746
 
2747
 
16906 efrain 2748
	<div class="card" id="row-audio-edit-box" style="display: none">
16905 efrain 2749
	 	<div class="card-header">
2750
	 		<h6 class="card-title">LABEL_EDIT_AUDIO_SLIDE</h6>
2751
	 	</div>
2752
	 	<?php
2753
    	 	$form = $this->formAudioEdit;
2754
    	 	$form->setAttributes([
2755
    	 	    'method'    => 'post',
2756
    	 	    'name'      => 'form-slide-audio-edit',
2757
    	 	    'id'        => 'form-slide-audio-edit'
2758
    	 	]);
1 www 2759
    	    $form->prepare();
2760
    	    echo $this->form()->openTag($form);
2761
 
2762
    	    $element = $form->get('type');
2763
    	    echo $this->formHidden($element);
2764
 
2765
    	    ?>
16905 efrain 2766
	 	<div class="card-body">
2767
	 		<div class="row">
2768
	 	         <div class="col-12 mt-3">
2769
	 	         </div>
2770
	 	     </div>
2771
 
2772
	 		<div class="row">
2773
	 	         <div class="col-12 mt-3">
1 www 2774
    				<?php
2775
                        $element = $form->get('name');
2776
                        $element->setAttributes(['class' => 'form-control']);
16905 efrain 2777
                        $element->setOptions(['label' => 'LABEL_NAME']);
1 www 2778
                        echo $this->formLabel($element);
2779
                        echo $this->formText($element);
2780
                    ?>
16905 efrain 2781
	 	         </div>
2782
	 	     </div>
2783
	 		<div class="row">
2784
	 	         <div class="col-12 mt-3">
1 www 2785
    				<?php
2786
                        $element = $form->get('order');
2787
                        $element->setAttributes(['class' => 'form-control']);
2788
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2789
                        echo $this->formLabel($element);
2790
                        echo $this->formText($element);
2791
                    ?>
16905 efrain 2792
	 	         </div>
2793
	 	     </div>
2794
	 		<div class="row">
2795
	 	         <div class="col-12 mt-3">
1 www 2796
 
2797
                 		<?php
2798
                        $element = $form->get('file');
2799
                        $element->setAttributes(['class' => 'form-control']);
2800
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
2801
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
2802
                        echo $this->formLabel($element);
16905 efrain 2803
                        echo $this->formFile($element);
2804
 
1 www 2805
                        ?>
16905 efrain 2806
	 	         </div>
2807
	 	     </div>
2808
	 		<div class="row">
2809
	 	         <div class="col-12 mt-3">
2810
                 		<?php
2811
                        $element = $form->get('background');
2812
                        $element->setAttributes(['class' => 'form-control']);
2813
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2814
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2815
                        echo $this->formLabel($element);
2816
                        echo $this->formFile($element);
2817
                        ?>
2818
 
2819
	 	         </div>
2820
	 	     </div>
2821
	 	</div>
2822
	 	<div class="card-footer text-right">
2823
	 	      <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2824
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2825
	 	</div>
2826
	 	<?php echo $this->form()->closeTag($form); ?>
2827
	</div>
2828
 
2829
 
16906 efrain 2830
	<div class="card" id="row-quizz-add-box" style="display: none">
16905 efrain 2831
	 	<div class="card-header">
2832
	 		<h6 class="card-title">LABEL_ADD_QUIZ_SLIDE</h6>
2833
	 	</div>
2834
	 	<?php
1 www 2835
    	    $form = $this->formQuizzAdd;
2836
    	    $form->setAttributes([
2837
    	       'method'    => 'post',
2838
    	        'name'      => 'form-slide-quizz-add',
2839
    	        'id'        => 'form-slide-quizz-add'
2840
    	    ]);
2841
    	    $form->prepare();
2842
    	    echo $this->form()->openTag($form);
2843
 
2844
    	    $element = $form->get('type');
2845
    	    echo $this->formHidden($element);
2846
 
2847
    	    ?>
16905 efrain 2848
	 	<div class="card-body">
1 www 2849
 
16905 efrain 2850
	 		<div class="row">
2851
	 	         <div class="col-12 mt-3">
1 www 2852
    				<?php
2853
                        $element = $form->get('name');
2854
                        $element->setAttributes(['class' => 'form-control']);
2855
                        $element->setOptions(['label' => 'LABEL_NAME']);
2856
                        echo $this->formLabel($element);
2857
                        echo $this->formText($element);
2858
                    ?>
16905 efrain 2859
	 	         </div>
2860
	 	     </div>
2861
	 		<div class="row">
2862
	 	         <div class="col-12 mt-3">
1 www 2863
    				<?php
2864
                        $element = $form->get('order');
2865
                        $element->setAttributes(['class' => 'form-control']);
2866
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2867
                        echo $this->formLabel($element);
2868
                        echo $this->formText($element);
2869
                    ?>
16905 efrain 2870
	 	         </div>
2871
	 	     </div>
6657 nelberth 2872
 
16905 efrain 2873
	 		<div class="row">
2874
	 	         <div class="col-12 mt-3">
1 www 2875
    				<?php
2876
                        $element = $form->get('quiz_id');
2877
                        $element->setAttributes(['class' => 'form-control']);
2878
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
2879
                        echo $this->formLabel($element);
2880
                        echo $this->formSelect($element);
2881
                    ?>
16905 efrain 2882
	 	         </div>
2883
	 	     </div>
2884
 
2885
			<div class="row">
2886
	 	         <div class="col-12 mt-3">
2887
                 		<?php
2888
                        $element = $form->get('background');
2889
                        $element->setAttributes(['class' => 'form-control']);
2890
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2891
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2892
                        echo $this->formLabel($element);
2893
                        echo $this->formFile($element);
2894
                        ?>
2895
 
2896
	 	         </div>
2897
	 	     </div>
2898
	 	</div>
2899
	 	<div class="card-footer text-right">
2900
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2901
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2902
	 	</div>
2903
	 	<?php echo $this->form()->closeTag($form); ?>
2904
	</div>
2905
 
16906 efrain 2906
	<div class="card" id="row-quizz-edit-box" style="display: none">
16905 efrain 2907
	 	<div class="card-header">
2908
	 		<h6 class="card-title">LABEL_EDIT_QUIZ_SLIDE</h6>
2909
	 	</div>
2910
	 	<?php
2911
    	 	$form = $this->formQuizzEdit;
2912
    	 	$form->setAttributes([
2913
    	 	    'method'    => 'post',
2914
    	 	    'name'      => 'form-slide-quizz-edit',
2915
    	 	    'id'        => 'form-slide-quizz-edit'
2916
    	 	]);
1 www 2917
    	    $form->prepare();
2918
    	    echo $this->form()->openTag($form);
2919
 
2920
    	    $element = $form->get('type');
2921
    	    echo $this->formHidden($element);
2922
 
2923
    	    ?>
16905 efrain 2924
	 	<div class="card-body">
1 www 2925
 
16905 efrain 2926
	 		<div class="row">
2927
	 	         <div class="col-12 mt-3">
1 www 2928
    				<?php
2929
                        $element = $form->get('name');
2930
                        $element->setAttributes(['class' => 'form-control']);
2931
                        $element->setOptions(['label' => 'LABEL_NAME']);
2932
                        echo $this->formLabel($element);
2933
                        echo $this->formText($element);
2934
                    ?>
16905 efrain 2935
	 	         </div>
2936
	 	     </div>
2937
	 		<div class="row">
2938
	 	         <div class="col-12 mt-3">
1 www 2939
    				<?php
2940
                        $element = $form->get('order');
2941
                        $element->setAttributes(['class' => 'form-control']);
2942
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2943
                        echo $this->formLabel($element);
2944
                        echo $this->formText($element);
2945
                    ?>
16905 efrain 2946
	 	         </div>
2947
	 	     </div>
6657 nelberth 2948
 
16905 efrain 2949
	 		<div class="row">
2950
	 	         <div class="col-12 mt-3">
1 www 2951
    				<?php
2952
                        $element = $form->get('quiz_id');
2953
                        $element->setAttributes(['class' => 'form-control']);
2954
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
2955
                        echo $this->formLabel($element);
2956
                        echo $this->formSelect($element);
2957
                    ?>
16905 efrain 2958
	 	         </div>
2959
	 	     </div>
2960
 
2961
			<div class="row">
2962
	 	         <div class="col-12 mt-3">
2963
                 		<?php
2964
                        $element = $form->get('background');
2965
                        $element->setAttributes(['class' => 'form-control']);
2966
                        $element->setOptions(['label' => 'LABEL_IMAGE']);
2967
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
2968
                        echo $this->formLabel($element);
2969
                        echo $this->formFile($element);
2970
                        ?>
2971
 
2972
	 	         </div>
2973
	 	     </div>
2974
	 	</div>
2975
	 	<div class="card-footer text-right">
2976
	 	     <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2977
      		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2978
	 	</div>
2979
	 	<?php echo $this->form()->closeTag($form); ?>
2980
	</div>
2981
</div>
1 www 2982
 
16905 efrain 2983
 
2984
 
1 www 2985
 
2986
 
2987
 
2988
<!-- The Modal -->
16906 efrain 2989
<div class="modal" id="modal-play-video-box" >
1 www 2990
	<div class="modal-dialog ">
2991
    	<div class="modal-content">
2992
 
2993
            <!-- Modal Header -->
2994
      		<div class="modal-header">
16845 efrain 2995
        		<h6 class="modal-title">LABEL_PLAY_VIDEO</h6>
16822 efrain 2996
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 2997
      		</div>
2998
 
2999
            <!-- Modal body -->
3000
            <div class="modal-body">
3001
				<video src=""  style="width: 300px; height: auto" controls preload="false" autoplay="false"  poster="" id="microlearning-play-video"></video>
3002
      		</div>
3003
 
3004
            <!-- Modal footer -->
16891 efrain 3005
      		<div class="modal-footer text-right">
16822 efrain 3006
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3007
          	</div>
3008
         </div>
3009
	</div>
3010
</div>
3011
 
3012
 
3013
 
3014
 
3015
 
3016
<!-- The Modal -->
16906 efrain 3017
<div class="modal" id="modal-play-audio-box" >
1 www 3018
	<div class="modal-dialog ">
3019
    	<div class="modal-content">
3020
 
3021
            <!-- Modal Header -->
3022
      		<div class="modal-header">
16845 efrain 3023
        		<h6 class="modal-title">LABEL_PLAY_AUDIO</h6>
16822 efrain 3024
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3025
      		</div>
3026
 
3027
            <!-- Modal body -->
3028
            <div class="modal-body">
3029
				<audio src="" controls autoplay="false"  id="microlearning-play-audio" >
3030
                  Your browser does not support the <code>audio</code> element.
3031
                </audio>
3032
      		</div>
3033
 
3034
            <!-- Modal footer -->
16891 efrain 3035
      		<div class="modal-footer text-right">
16822 efrain 3036
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3037
          	</div>
3038
         </div>
3039
	</div>
3040
</div>
3041
 
3042
 
3043
<!-- The Modal -->
16906 efrain 3044
<div class="modal" id="modal-view-image-box">
1 www 3045
	<div class="modal-dialog ">
3046
    	<div class="modal-content">
3047
 
3048
            <!-- Modal Header -->
3049
      		<div class="modal-header">
16845 efrain 3050
        		<h6 class="modal-title">LABEL_IMAGE</h6>
16822 efrain 3051
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3052
      		</div>
3053
 
3054
            <!-- Modal body -->
3055
            <div class="modal-body text-center">
3056
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-view" />
3057
      		</div>
3058
 
3059
            <!-- Modal footer -->
16891 efrain 3060
      		<div class="modal-footer text-right">
16822 efrain 3061
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3062
          	</div>
3063
         </div>
3064
	</div>
3065
</div>
3066
 
3067
 
3068
<!-- The Modal -->
16906 efrain 3069
<div class="modal" id="modal-view-document-box">
1 www 3070
	<div class="modal-dialog ">
3071
    	<div class="modal-content">
3072
 
3073
            <!-- Modal Header -->
3074
      		<div class="modal-header">
16845 efrain 3075
        		<h6 class="modal-title">LABEL_DOCUMENT</h6>
16822 efrain 3076
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3077
      		</div>
3078
 
3079
            <!-- Modal body -->
3080
            <div class="modal-body text-center">
3081
            	<iframe id="document-view" style="width: 450px; height: 300px; scroll: auto">
3082
 
3083
            	</iframe>
3084
       	</div>
3085
 
3086
            <!-- Modal footer -->
16891 efrain 3087
      		<div class="modal-footer text-right">
16822 efrain 3088
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3089
          	</div>
3090
         </div>
3091
	</div>
3092
</div>
3093
 
3094
 
3095
<!-- The Modal -->
16906 efrain 3096
<div class="modal" id="modal-view-text-box">
1 www 3097
	<div class="modal-dialog modal-xl">
3098
    	<div class="modal-content">
3099
 
3100
            <!-- Modal Header -->
3101
      		<div class="modal-header">
16845 efrain 3102
        		<h6 class="modal-title">LABEL_TEXT</h6>
16822 efrain 3103
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 3104
      		</div>
3105
 
3106
            <!-- Modal body -->
3107
            <div class="modal-body" >
3108
            	<div id="document-text" style="width: 100%; height: 300px; scroll: auto; overflow: auto;">
3109
 
3110
 
3111
            	</div>
3112
 
3113
       	</div>
3114
 
3115
            <!-- Modal footer -->
16891 efrain 3116
      		<div class="modal-footer text-right">
16822 efrain 3117
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 3118
          	</div>
3119
         </div>
3120
	</div>
3121
</div>
3122
 
3123
 
3124
 
3125
 
3126
 
3127
 
3128