Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
251 geraldo 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
261 geraldo 7
$routeAdd = $this->url('self-evaluation/forms/add');
262 geraldo 8
$routeDatatable = $this->url('self-evaluation/reviews');
251 geraldo 9
$routeDashboard = $this->url('dashboard');
10
 
261 geraldo 11
$allowEdit = $acl->isAllowed($roleName, 'self-evaluation/forms/edit') ? 1 : 0;
251 geraldo 12
 
13
 
14
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
15
 
16
 
17
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
18
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
19
 
20
 
21
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
22
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
24
 
25
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
26
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
27
 
28
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
32
 
33
 
34
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
35
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
36
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
38
 
39
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
40
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
41
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
42
 
43
 
44
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
45
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
46
 
47
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
48
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
49
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
261 geraldo 50
 
251 geraldo 51
// bootbox Alert //
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
261 geraldo 53
 
251 geraldo 54
// JsRender //
55
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
56
 
261 geraldo 57
// Page Styles
58
$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
251 geraldo 59
 
60
$this->inlineScript()->captureStart();
61
echo <<<JS
62
    const classFormGenerator = function() {
63
    this.id = 0,
64
        this.table = '',
65
        this.name = '',
66
        this.text = '',
67
        this.status = 'a',
68
        this.sections = [],
69
        this.clear = function() {
70
            this.sections = [];
71
            this.render();
72
        },
73
        /**
74
         * Render array sections
75
         */
76
        this.renderSection = function(slug_section) {
77
            var s = '';
78
            for (i = 0; i < this.sections.length; i++) {
79
                if (slug_section != this.sections[i].slug_section) {
80
                    continue;
81
                }
82
                for (j = 0; j < this.sections[i].questions.length; j++) {
83
                    this.sections[i].questions[j].position = j;
84
                    if (this.sections[i].questions[j].type == 'simple' || this.sections[i].questions[j].type == 'multiple' || this.sections[i].questions[j].type == 'rating-open') {
85
                        this.sections[i].questions[j].options.sort(function(a, b) {
86
                            if (a.position > b.position) {
87
                                return 1;
88
                            }
89
                            if (a.position < b.position) {
90
                                return -1;
91
                            }
92
                            return 0;
93
                        });
94
                        for (k = 0; k < this.sections[i].questions[j].options.length; k++) {
95
                            this.sections[i].questions[j].options[k].position = j;
96
                        }
97
                    }
98
                }
99
            }
100
            $('[data-toggle="tooltip"]').tooltip();
101
        },
102
        this.render = function() {
103
            this.sections.sort(function(a, b) {
104
                if (a.position > b.position) {
105
                    return 1;
106
                }
107
                if (a.position < b.position) {
108
                    return -1;
109
                }
110
                return 0;
111
            });
112
            var s = '';
113
            for (i = 0; i < this.sections.length; i++) {
114
                this.sections[i].position = i;
115
                this.sections[i].questions.sort(function(a, b) {
116
                    if (a.position > b.position) {
117
                        return 1;
118
                    }
119
                    if (a.position < b.position) {
120
                        return -1;
121
                    }
122
                    return 0;
123
                });
124
                for (j = 0; j < this.sections[i].questions.length; j++) {
125
                    this.sections[i].questions[j].position = j;
126
                    if (this.sections[i].questions[j].type == 'simple' || this.sections[i].questions[j].type == 'multiple' || this.sections[i].questions[j].type == 'rating-open') {
127
                        this.sections[i].questions[j].options.sort(function(a, b) {
128
                            if (a.position > b.position) {
129
                                return 1;
130
                            }
131
                            if (a.position < b.position) {
132
                                return -1;
133
                            }
134
                            return 0;
135
                        });
136
                        for (k = 0; k < this.sections[i].questions[j].options.length; k++) {
137
                            this.sections[i].questions[j].options[k].position = j;
138
                        }
139
                    }
140
                }
141
            }
142
            $('[data-toggle="tooltip"]').tooltip();
266 geraldo 143
        };
144
    }
264 geraldo 145
 
146
 
251 geraldo 147
 
148
function htmlEntities(str) {
149
    return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
150
}
151
jQuery(document).ready(function($) {
152
    var objFormGenerator = new classFormGenerator();
153
    objFormGenerator.render();
154
    var allowEdit = $allowEdit;
155
    /**
156
     * Get rows and set data table
157
     */
158
    var tableForm = $('#gridTable').dataTable({
159
        'processing': true,
160
        'serverSide': true,
161
        'searching': true,
162
        'order': [
163
            [0, 'asc']
164
        ],
165
        'ordering': true,
166
        'ordenable': true,
167
        'responsive': true,
168
        'select': false,
169
        'paging': true,
170
        'pagingType': 'simple_numbers',
171
        'ajax': {
172
            'url': '$routeDatatable',
173
            'type': 'get',
174
            'beforeSend': function(request) {
175
                NProgress.start();
176
            },
177
            'dataFilter': function(response) {
178
                var response = jQuery.parseJSON(response);
179
                var json = {};
180
                json.recordsTotal = 0;
181
                json.recordsFiltered = 0;
182
                json.data = [];
183
                if (response.success) {
184
                    json.recordsTotal = response.data.total;
185
                    json.recordsFiltered = response.data.total;
186
                    json.data = response.data.items;
187
                } else {
188
                    $.fn.showError(response.data)
189
                }
190
                return JSON.stringify(json);
191
            }
192
        },
193
        'language': {
194
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
195
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
196
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
197
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
198
            'sInfo': 'LABEL_DATATABLE_SINFO',
199
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
200
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
201
            'sInfoPostFix': '',
202
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
203
            'sUrl': '',
204
            'sInfoThousands': ',',
205
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
206
            'oPaginate': {
207
                'sFirst': 'LABEL_DATATABLE_SFIRST',
208
                'sLast': 'LABEL_DATATABLE_SLAST',
209
                'sNext': 'LABEL_DATATABLE_SNEXT',
210
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
211
            },
212
            'oAria': {
213
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
214
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
215
            },
216
        },
217
        'drawCallback': function(settings) {
218
            NProgress.done();
219
            $('button.btn-delete').confirmation({
220
                rootSelector: 'button.btn-delete',
221
                title: 'LABEL_ARE_YOU_SURE',
222
                singleton: true,
223
                btnOkLabel: 'LABEL_YES',
224
                btnCancelLabel: 'LABEL_NO',
225
                onConfirm: function(value) {
226
                    action = $(this).data('href');
227
                    NProgress.start();
228
                    $.ajax({
229
                        'dataType': 'json',
230
                        'accept': 'application/json',
231
                        'method': 'post',
232
                        'url': action,
233
                    }).done(function(response) {
234
                        if (response['success']) {
235
                            $.fn.showSuccess(response['data']);
236
                            tableForm.fnDraw();
237
                        } else {
238
                            $.fn.showError(response['data']);
239
                        }
240
                    }).fail(function(jqXHR, textStatus, errorThrown) {
241
                        $.fn.showError(textStatus);
242
                    }).always(function() {
243
                        NProgress.done();
244
                    });
245
                },
246
            });
247
        },
294 geraldo 248
        'aoColumns': [
249
            {
250
                'mDataProp': 'user'
251
            },{
251 geraldo 252
                'mDataProp': 'name'
253
            },
254
            {
255
                'mDataProp': 'language'
256
            },
257
            {
258
                'mDataProp': 'status'
259
            },
260
            {
294 geraldo 261
                'mDataProp': 'link_edit'
251 geraldo 262
            },
263
        ],
294 geraldo 264
        'columnDefs': [
265
            {
251 geraldo 266
                'targets': 0,
267
                'className': 'text-vertical-middle',
294 geraldo 268
            },{
269
                'targets': 1,
270
                'className': 'text-vertical-middle',
251 geraldo 271
            },
272
            {
294 geraldo 273
                'targets': -1,
251 geraldo 274
                'className': 'text-vertical-middle',
275
            },
276
            {
292 geraldo 277
                'targets': -2,
278
                'orderable': false,
279
                'className': 'text-center',
293 geraldo 280
                'className': 'text-vertical-middle',
251 geraldo 281
            },
282
            {
283
                'targets': -1,
284
                'orderable': false,
285
                'render': function(data, type, row) {
286
                    s = '';
287
                    if (allowEdit) {
293 geraldo 288
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
251 geraldo 289
                    }
290
                    return s;
291
                }
292
            }
293
        ],
294
    });
295
    /**
296
     * Clicked on edit form
297
     */
298
    $('body').on('click', 'button.btn-edit-form', function(e) {
299
        e.preventDefault();
300
        form_id = $(this).data('id')
301
        var action = $(this).data('href');
302
        $.ajax({
303
            'dataType': 'json',
304
            'accept': 'application/json',
305
            'method': 'get',
306
            'url': action,
307
        }).done(function(response) {
308
            if (response['success']) {
309
                validatorForm.resetForm();
310
                $('#form-main').attr('action', action);
311
                $('#form-main #form-id').val(response['data']['id']),
312
                $('#form-main #form-continue').val('0');
313
                $('#form-main #form-name').val(response['data']['name']),
314
 
304 geraldo 315
 
251 geraldo 316
                /*-------------Render Sections -------*/
317
 
318
                objFormGenerator.clear();
319
                objFormGenerator.sections = response['data']['content'] || [];
320
                objFormGenerator.render();
321
                renderSectionData(objFormGenerator.sections);
322
 
254 geraldo 323
                $('#row-forms').hide();
251 geraldo 324
                $('#row-edit').show();
325
                $('#form-main #form-name').focus();
326
 
327
            } else {
328
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
329
            }
330
        }).fail(function(jqXHR, textStatus, errorThrown) {
331
            $.fn.showError(textStatus);
332
        });
333
    });
304 geraldo 334
 
251 geraldo 335
    //IMPORTANT: update CKEDITOR textarea with actual content before submit
336
    $("#form-main").on('submit', function() {
337
        for (var instanceName in CKEDITOR.instances) {
338
            CKEDITOR.instances[instanceName].updateElement();
339
        }
340
    })
341
    /**
342
     * Validate rules form
343
     */
344
    var validatorForm = $("#form-main").validate({
345
        ignore: [],
346
        errorClass: 'help-block',
347
        errorElement: 'span',
348
        rules: {
349
            'form-name': {
350
                required: true,
351
                minlength: 2,
352
                maxlength: 50
353
            },
354
            'form-description': {
355
                required: true,
356
            },
357
            'form-text': {
358
                required: true,
359
            },
360
            'form-language': {
361
                required: true,
362
            },
363
            'forrm-status': {
364
                required: true,
365
            },
366
        },
367
        highlight: function(element) {
368
            $(element).closest('.form-group').addClass('has-error');
369
        },
370
        unhighlight: function(element) {
371
            $(element).closest('.form-group').removeClass('has-error');
372
        },
373
        errorPlacement: function(error, element) {
374
            if (element.attr("data-error-container")) {
375
                error.appendTo(element.attr("data-error-container"));
376
            } else {
377
                error.insertAfter(element);
378
            }
379
        },
380
        invalidHandler: function(form, validator) {
381
            if (!validator.numberOfInvalids())
382
                return;
383
            $('html, body').animate({
384
                scrollTop: $(validator.errorList[0].element).offset().top - 100
385
            }, 1000);
386
        },
387
        submitHandler: function(form) {
388
            var error = false;
389
            if (objFormGenerator.sections.length == 0) {
390
                $.fn.showError('ERROR_SECCTIONS');
391
                return false;
392
            } else {
393
                for (i = 0; i < objFormGenerator.sections.length; i++) {
394
                    if (objFormGenerator.sections[i].questions.length == 0) {
395
                        $.fn.showError('ERROR_QUESTIONS'.replace('%s', objFormGenerator.sections[i].name));
396
                        return false;
397
                    }
398
                    var valueSection = parseInt(objFormGenerator.sections[i].value);
399
                    var totalValueQuestion = 0;
400
                    for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
401
                        valueQuestion = parseInt(objFormGenerator.sections[i].questions[j].value);
402
                        totalValueQuestion = totalValueQuestion + valueQuestion;
403
                        if (objFormGenerator.sections[i].questions[j].type == 'simple' ||
404
                            objFormGenerator.sections[i].questions[j].type == 'multiple' ||
405
                            objFormGenerator.sections[i].questions[j].type == 'rating-open') {
406
                            var questionNumber = j + 1;
407
                            var numberCorrect = 0;
408
                            if (objFormGenerator.sections[i].questions[j].options.length == 0) {
409
                                $.fn.showError('ERROR_OPTIONS'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
410
                                return false;
411
                            }
412
                            var totalOption = 0;
413
                            var maxOption = 0;
414
                            for (k = 0; k < objFormGenerator.sections[i].questions[j].options.length; k++) {
415
                                if (objFormGenerator.sections[i].questions[j].type == 'simple' || objFormGenerator.sections[i].questions[j].type == 'multiple') {
416
                                    if (objFormGenerator.sections[i].questions[j].options[k].correct == 1) {
417
                                        numberCorrect++;
418
                                    }
419
                                }
420
                                if (objFormGenerator.sections[i].questions[j].type == 'multiple' && objFormGenerator.sections[i].questions[j].options[k].correct == 1) {
421
                                    totalOption = totalOption + parseInt(objFormGenerator.sections[i].questions[j].options[k].value);
422
                                }
423
                                if (objFormGenerator.sections[i].questions[j].type == 'rating-open') {
424
                                    if (parseInt(objFormGenerator.sections[i].questions[j].options[k].value) > maxOption) {
425
                                        maxOption = parseInt(objFormGenerator.sections[i].questions[j].options[k].value);
426
                                    }
427
                                }
428
                            }
429
                            if (objFormGenerator.sections[i].questions[j].type == 'simple' || objFormGenerator.sections[i].questions[j].type == 'multiple') {
430
                                if (numberCorrect == 0) {
431
                                    $.fn.showError('ERROR_OPTIONS_CORRECT'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
432
                                    return false;
433
                                }
434
                                if (
435
                                    objFormGenerator.sections[i].questions[j].type == 'simple' && numberCorrect > 1) {
436
                                    $.fn.showError('ERROR_OPTIONS_DUPLICATE_CORRECT'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
437
                                    return false;
438
                                }
439
                                if (objFormGenerator.sections[i].questions[j].type == 'multiple' && numberCorrect == 1) {
440
                                    $.fn.showError('ERROR_OPTIONS_ONE_CORRECT'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
441
                                    return false;
442
                                }
443
                            }
444
                            if (objFormGenerator.sections[i].questions[j].type == 'multiple' && totalOption != valueQuestion) {
445
                                $.fn.showError('ERROR_OPTIONS_SUM_VALUES'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
446
                                return false;
447
                            }
448
                            if (objFormGenerator.sections[i].questions[j].type == 'rating-open' && maxOption > valueQuestion) {
449
                                $.fn.showError('ERROR_OPTIONS_MAX_OPTION'.replace('%s', objFormGenerator.sections[i].name).replace('%n', questionNumber));
450
                                return false;
451
                            }
452
                        }
453
                    }
454
                    if (valueSection != totalValueQuestion) {
455
                        $.fn.showError('ERROR_VALUE_SECTIONS'.replace('%s', objFormGenerator.sections[i].name));
456
                        return false;
457
                    }
458
                }
459
                var formId = parseInt($('#form-main #form-id').val());
460
                var formContinue = parseInt($('#form-main #form-continue').val());
461
                var data = {
462
                    'id': formId,
463
                    'name': $('#form-main #form-name').val(),
464
                    'description': $('#form-main #form-description').val(),
465
                    'text': $('#form-main #form-text').val(),
466
                    'language': $('#form-main #form-language').val(),
467
                    'status': $('#form-main #form-status').val(),
468
                    'content': JSON.stringify(objFormGenerator.sections)
469
                }
470
                $.ajax({
471
                    'dataType': 'json',
472
                    'method': 'post',
473
                    'url': $('#form-main').attr('action'),
474
                    'data': data,
475
                }).done(function(response) {
476
                    if (response['success']) {
477
                        $.fn.showSuccess(response['data']);
478
                        if (formContinue == 1) {
479
                            $('#form-main').attr('action',response['action_edit']);
480
                            $('#form-main #form-id').val(response['id']);
481
                            $('#form-main #form-continue').val(0);
482
                        } else {
483
                            $('#row-edit').hide();
254 geraldo 484
                            $('#row-forms').show();
251 geraldo 485
                        /*---------- Reset Form -------- */
486
                        $('#form-main')[0].reset();
487
                        /*--------Reset Sections ----------*/
488
                        clearSectionData();
489
                        /* ------- Refresh Table -----------*/
490
 
491
                        }
492
                        tableForm.fnDraw();
493
                    } else {
494
                        $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
495
                    }
496
                }).fail(function(jqXHR, textStatus, errorThrown) {
497
                    $.fn.showError(textStatus);
498
                });
499
                return false;
500
            }
501
        }
502
    });
264 geraldo 503
 
251 geraldo 504
    /**
505
     * Clicked cancel new/edit Form
506
     */
507
    $('button.btn-edit-cancel').click(function(e) {
508
        e.preventDefault();
509
        $('#row-edit').hide();
254 geraldo 510
        $('#row-forms').show();
251 geraldo 511
    });
512
    /**
513
     * Clicked save and continue new Form
514
     */
515
    $('button.btn-form-save-continue').click(function(e) {
516
        e.preventDefault();
517
        $('#form-main #form-continue').val('1')
518
        $('#form-main').submit();
519
    });
520
    /**
521
     * Clicked save and close new/edit Form
522
     */
523
    $('button.btn-form-save-close').click(function(e) {
524
        e.preventDefault();
525
        $('#form-main #form-continue').val('0')
526
        $('#form-main').submit();
527
    });
528
    /**
529
     * Modal Settings
530
     */
531
    $('#modal-section, #modal-question, #modal-option').modal({
532
        backdrop: 'static',
533
        keyboard: false,
534
        show: false
535
    });
536
    /**
537
     * Get Question type
538
     */
539
    const getQuestionTypeBySlug = (slug_section, slug_question) => {
540
        for (i = 0; i < objFormGenerator.sections.length; i++) {
541
            if (slug_section == objFormGenerator.sections[i].slug_section) {
542
                for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
543
                    if (slug_question == objFormGenerator.sections[i].questions[j].slug_question) {
544
                        return objFormGenerator.sections[i].questions[j].type;
545
                    }
546
                }
547
            }
548
        }
549
    }
550
    /**
551
     * Remove Html Tags
552
     */
553
    const removeTags = (str) => str.toString().replace( /(<([^>]+)>)/ig, '')
554
    /**
555
     * Render Sections data
556
     */
557
    const renderSectionData = (data) => $("#rows").html($("#sectionTemplate").render(data, {
558
        getType: getQuestionTypeBySlug,
559
        removeTags: removeTags
560
    }));
561
 
562
 
563
    /**
564
     * Clear Div Section data
565
     */
566
    const clearSectionData = () => $("#rows").html('');
567
    /**
568
     * Clicked refresh button
569
     */
570
    $('button.btn-refresh').click(function(e) {
571
        tableForm.fnDraw();
572
    });
573
 
574
});
575
JS;
576
$this->inlineScript()->captureEnd();
577
?>
578
 
579
<!-- Content Header (Page header) -->
580
<section class="content-header">
581
    <div class="container-fluid">
582
        <div class="row mb-2">
583
            <div class="col-sm-12">
264 geraldo 584
                <h1>LABEL_REVIEWS</h1>
251 geraldo 585
            </div>
586
        </div>
587
    </div>
588
    <!-- /.container-fluid -->
589
</section>
590
<section class="content">
254 geraldo 591
    <div class="container-fluid" id="row-forms">
251 geraldo 592
        <div class="row">
593
            <div class="col-12">
594
                <div class="card">
595
                    <div class="card-body">
596
                        <table id="gridTable" class="table   table-hover">
597
                            <thead>
598
                                <tr>
294 geraldo 599
                                <th>LABEL_USER</th>
251 geraldo 600
                                    <th>LABEL_NAME</th>
601
                                    <th>LABEL_LANGUAGE</th>
294 geraldo 602
                                    <th>LABEL_STATUS</th>
251 geraldo 603
                                    <th>LABEL_ACTIONS</th>
604
                                </tr>
605
                            </thead>
606
                            <tbody></tbody>
607
                        </table>
608
                    </div>
609
                    <div class="card-footer clearfix">
610
                        <div style="float:right;">
611
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
612
                        </div>
613
                    </div>
614
                </div>
615
            </div>
616
        </div>
617
    </div>
618
 
619
    <!-- Create/Edit Form -->
620
 
621
    <div class="row" id="row-edit" style="display: none">
622
        <div class="col-xs-12 col-md-12">
623
            <form action="#" name="form-main" id="form-main">
261 geraldo 624
                <input type="hidden" name="form-id" id="form-id" value="0" />
251 geraldo 625
                <div class="form-group">
261 geraldo 626
                    <label for="form-name">LABEL_FIRST_NAME</label>
303 geraldo 627
                    <div></div>
261 geraldo 628
                </div>
629
                <div class="form-group">
630
                    <label for="form-status">LABEL_STATUS</label>
631
                    <select name="form-status" id="form-status" class="form-control">
632
                        <option value="<?php echo $status_inactive; ?>">LABEL_INACTIVE</option>
633
                        <option value="<?php echo $status_active; ?>">LABEL_ACTIVE</option>
634
                    </select>
303 geraldo 635
                </div>
261 geraldo 636
                <div class="row">
637
                    <div class="col-xs-12 col-md-12">
638
                        <div class="panel-group" id="rows"></div>
639
                    </div>
640
                </div>
641
                <div class="form-group">
251 geraldo 642
                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
643
                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
644
                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
645
                </div>
646
            </form>
647
        </div>
648
    </div>
649
 
261 geraldo 650
    <!-- Create/Edit Form-->
251 geraldo 651
 
264 geraldo 652
 
261 geraldo 653
 
251 geraldo 654
    <!---Template Sections --->
655
    <script id="sectionTemplate" type="text/x-jsrender">
656
    <div class="panel panel-default" id="panel-{{:slug_section}}">
657
        <div class="panel-heading">
658
            <h4 class="panel-title">
659
                <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:slug_section}}" href="#collapse-{{:slug_section}}">
660
                    <span class="section-name{{:slug_section}}">
661
                        {{:name}}
662
                    </span>
663
                </a>
664
            </h4>
665
        </div>
666
        <div id="collapse-{{:slug_section}}" class="panel-collapse in collapse show">
667
            <div class="panel-body">
668
                <div class="table-responsive">
669
                    <table class="table table-bordered">
670
                        <thead>
671
                            <tr>
305 geraldo 672
                                <th>LABEL_QUESTION</th>
673
                                <th>LABEL_VALUE</th>
674
                                <th>LABEL_TYPE</th>
675
                                <th>LABEL_ANSWER</th>
676
                                <th>LABEL_ACTIONS</th>
251 geraldo 677
                            </tr>
678
                        </thead>
679
                        <tbody>
680
                            {{for questions}}
681
                            <tr class="tr-question">
303 geraldo 682
                                <td class="text-left">{{:~removeTags(text)}} </td>
251 geraldo 683
                                <td><font color="red">{{:value}}</font></td>
684
                                <td class="text-capitalize">
685
                                    {{if type == 'open'}} LABEL_OPEN {{/if}}
686
                                    {{if type == 'simple'}} Simple {{/if}}
687
                                    {{if type == 'multiple'}} Multiple {{/if}}
688
                                    {{if type == 'rating-open'}} LABEL_RATING_OPEN {{/if}}
689
                                    {{if type == 'rating-range'}} LABEL_RATING_RANGE {{/if}}
690
                                </td>
303 geraldo 691
                                <td></td>
692
                                <td></td>
251 geraldo 693
                            </tr>
303 geraldo 694
 
251 geraldo 695
                            {{/for}}
696
                        </tbody>
697
                    </table>
698
                </div>
699
            </div>
700
        </div>
701
    </div>
702
    </script>
703
 
704
    <!-- End Template Sections-->
705
 
706
</section>