Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
977 geraldo 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
985 geraldo 7
$routeAdd = $this->url('performance-evaluation/forms/add');
8
$routeDatatable = $this->url('performance-evaluation/forms');
977 geraldo 9
$routeDashboard = $this->url('dashboard');
10
 
985 geraldo 11
$allowAdd = $acl->isAllowed($roleName, 'performance-evaluation/forms/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'performance-evaluation/forms/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'performance-evaluation/forms/delete') ? 1 : 0;
977 geraldo 14
 
15
 
16
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
17
 
18
 
19
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
20
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
21
 
22
 
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
26
 
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
28
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
29
 
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
34
 
35
 
36
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
37
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
38
 
39
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
42
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
44
 
45
 
46
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
48
 
49
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
50
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
52
 
53
// bootbox Alert //
54
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
55
 
56
// JsRender //
57
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
58
 
1050 geraldo 59
 
1053 geraldo 60
$status_active = \LeadersLinked\Model\CompanyPerformanceEvaluationForm::STATUS_ACTIVE;
61
$status_inactive = \LeadersLinked\Model\CompanyPerformanceEvaluationForm::STATUS_INACTIVE;
1050 geraldo 62
 
977 geraldo 63
$this->inlineScript()->captureStart();
64
echo <<<JS
1027 geraldo 65
   jQuery(document).ready(function($) {
1055 geraldo 66
            var allowEdit = $allowEdit;
67
            var allowDelete = $allowDelete;
68
            var sections = [];
69
            /**
70
             * Get rows and set data table
71
             */
72
            var tableForm = $('#gridTable').dataTable({
73
                'processing': true,
74
                'serverSide': true,
75
                'searching': true,
76
                'order': [
77
                    [0, 'asc']
78
                ],
79
                'ordering': true,
80
                'ordenable': true,
81
                'responsive': true,
82
                'select': false,
83
                'paging': true,
84
                'pagingType': 'simple_numbers',
85
                'ajax': {
86
                    'url': '$routeDatatable',
87
                    'type': 'get',
88
                    'beforeSend': function(request) {
89
                        NProgress.start();
90
                    },
91
                    'dataFilter': function(response) {
92
                        var response = jQuery.parseJSON(response);
93
                        var json = {};
94
                        json.recordsTotal = 0;
95
                        json.recordsFiltered = 0;
96
                        json.data = [];
97
                        if (response.success) {
98
                            json.recordsTotal = response.data.total;
99
                            json.recordsFiltered = response.data.total;
100
                            json.data = response.data.items;
101
                        } else {
102
                            $.fn.showError(response.data)
103
                        }
104
                        return JSON.stringify(json);
105
                    }
106
                },
107
                'language': {
108
                    'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
109
                    'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
110
                    'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
111
                    'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
112
                    'sInfo': 'LABEL_DATATABLE_SINFO',
113
                    'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
114
                    'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
115
                    'sInfoPostFix': '',
116
                    'sSearch': 'LABEL_DATATABLE_SSEARCH',
117
                    'sUrl': '',
118
                    'sInfoThousands': ',',
119
                    'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
120
                    'oPaginate': {
121
                        'sFirst': 'LABEL_DATATABLE_SFIRST',
122
                        'sLast': 'LABEL_DATATABLE_SLAST',
123
                        'sNext': 'LABEL_DATATABLE_SNEXT',
124
                        'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
125
                    },
126
                    'oAria': {
127
                        'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
128
                        'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
129
                    },
130
                },
131
                'drawCallback': function(settings) {
132
                    NProgress.done();
133
                    $('button.btn-delete').confirmation({
134
                        rootSelector: 'button.btn-delete',
135
                        title: 'LABEL_ARE_YOU_SURE',
136
                        singleton: true,
137
                        btnOkLabel: 'LABEL_YES',
138
                        btnCancelLabel: 'LABEL_NO',
139
                        onConfirm: function(value) {
140
                            action = $(this).data('href');
141
                            NProgress.start();
142
                            $.ajax({
143
                                'dataType': 'json',
144
                                'accept': 'application/json',
145
                                'method': 'post',
146
                                'url': action,
147
                            }).done(function(response) {
148
                                if (response['success']) {
149
                                    $.fn.showSuccess(response['data']);
150
                                    tableForm.fnDraw();
151
                                } else {
152
                                    $.fn.showError(response['data']);
153
                                }
154
                            }).fail(function(jqXHR, textStatus, errorThrown) {
155
                                $.fn.showError(textStatus);
156
                            }).always(function() {
157
                                NProgress.done();
158
                            });
159
                        },
160
                    });
161
                },
162
                'aoColumns': [{
163
                        'mDataProp': 'name'
164
                    },
165
                    {
1078 geraldo 166
                        'mDataProp': 'job_description'
1055 geraldo 167
                    },
168
                    {
169
                        'mDataProp': 'status'
170
                    },
171
                    {
172
                        'mDataProp': 'actions'
173
                    },
174
                ],
175
                'columnDefs': [{
176
                        'targets': 0,
177
                        'className': 'text-vertical-middle',
178
                    },
179
                    {
180
                        'targets': 1,
181
                        'className': 'text-vertical-middle',
182
                    },
183
                    {
184
                        'targets': -2,
185
                        'orderable': false,
186
                        'className': 'text-center',
187
                        'render': function(data, type, row) {
188
                            checked = data == 'a' ? ' checked="checked" ' : '';
189
                            return '<div class="checkbox checkbox-success">' +
190
                                '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
191
                                '<label ></label></div>';
192
                        }
193
                    },
194
                    {
195
                        'targets': -1,
196
                        'orderable': false,
197
                        'render': function(data, type, row) {
198
                            s = '';
199
                            if (allowEdit) {
200
                                s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
201
                            }
202
                            if (allowDelete) {
203
                                s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>&nbsp;';
204
                            }
205
                            return s;
206
                        }
207
                    }
208
                ],
209
            });
210
            /**
211
             * Clicked on edit form
212
             */
213
            $('body').on('click', 'button.btn-edit-form', function(e) {
214
                e.preventDefault();
215
                form_id = $(this).data('id')
216
                var action = $(this).data('href');
217
                $.ajax({
218
                    'dataType': 'json',
219
                    'accept': 'application/json',
220
                    'method': 'get',
221
                    'url': action,
222
                }).done(function(response) {
223
                    if (response['success']) {
224
                        $("#rows").html('');
225
                        sections = [];
226
                        $('#form-main').attr('action', action);
1067 geraldo 227
                        $('#form-main #form-name').val(response['data']['name']),
228
                        $('#form-main #job_description_id').val(response['data']['job_description_id']);
1055 geraldo 229
                        $('#form-main #form-status').val(response['data']['status']);
230
                        sections = response['data']['content'] || [];
231
                        renderData(sections);
232
                        $('#row-lists').hide();
233
                        $('#row-form').show();
234
                    } else {
235
                        $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
236
                    }
237
                }).fail(function(jqXHR, textStatus, errorThrown) {
238
                    $.fn.showError(textStatus);
239
                });
240
            });
241
            /**
242
             * Clicked add new section
243
             */
244
            $('#btn-add-section').click(function(e) {
245
                $('#form-section #id-section').val('');
246
                $('#form-section #title-section').val('');
247
                $('#form-section #text-section').val('');
248
                $('#form-section #type-section').val($('#form-section #type-section option:first').val());
249
                $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
250
                $('#modal-section').modal('show');
251
            });
252
            /**
253
             * Clicked edit section
254
             */
255
            /**
256
             * Clicked save section
257
             */
258
            $('#btn-save-section').click(function(e) {
259
                if ($('#title-section').val() == '') {
260
                    $.fn.showError('Ingrese un nombre');
261
                    return;
977 geraldo 262
                } else {
1055 geraldo 263
                    if ($('#id-section').val() == "") {
264
                        addSection(
265
                            $('#title-section').val(),
266
                            $('#text-section').val(),
267
                            $('#type-section').val(),
268
                        )
269
                    } else {
270
                        editSection(
271
                            $('#id-section').val(),
272
                            $('#title-section').val(),
273
                            $('#text-section').val(),
274
                            $('#type-section').val()
275
                        )
276
                    }
277
                    $('#modal-section').modal('hide');
278
                    return;
977 geraldo 279
                }
1055 geraldo 280
            });
281
            /**
282
             * Clicked remove section
283
             */
284
            $('body').on('click', 'button.btn-delete-section', function(e) {
285
                e.preventDefault();
286
                var id_section = $(this).data('section');
287
                bootbox.confirm({
288
                    title: "LABEL_DELETE LABEL_SECTION",
289
                    message: "LABEL_QUESTION_DELETE",
290
                    buttons: {
291
                        cancel: {
292
                            label: '<i class="fa fa-times"></i> LABEL_CANCEL'
293
                        },
294
                        confirm: {
295
                            label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
296
                        }
297
                    },
298
                    callback: function(result) {
299
                        if (result) {
300
                            removeSection(id_section);
301
                        }
302
                    }
303
                });
304
            });
305
            $('body').on('click', 'button.btn-edit-section', function(e) {
306
                e.preventDefault();
307
                var id = $(this).data('section');
308
                console.log(id);
309
                sections.map((item) => {
310
                    if (item.id_section == id) {
311
                        $('#form-section #id-section').val(item.id_section);
312
                        $('#form-section #title-section').val(item.title);
313
                        $('#form-section #text-text').val(item.text);
314
                        $('#form-section #type-section').val(item.type);
315
                        $('#modal-section').modal('show');
316
                        return;
317
                    }
318
                });
319
            });
320
            /**
321
             * Clicked remove option
322
             */
323
            $('body').on('click', 'button.btn-delete-option', function(e) {
324
                e.preventDefault();
325
                var id_section = $(this).data('section');
326
                var id_option = $(this).data('option');
327
                bootbox.confirm({
328
                    title: "LABEL_DELETE LABEL_OPTION",
329
                    message: "LABEL_QUESTION_DELETE",
330
                    buttons: {
331
                        cancel: {
332
                            label: '<i class="fa fa-times"></i> LABEL_CANCEL'
333
                        },
334
                        confirm: {
335
                            label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
336
                        }
337
                    },
338
                    callback: function(result) {
339
                        if (result) {
340
                            removeOption(id_section, id_option);
341
                        }
342
                    }
343
                });
344
            });
345
            /**
346
             * Clicked add new Option
347
             */
348
            $('body').on('click', 'button.btn-add-option', function(e) {
349
                e.preventDefault();
350
                var id = $(this).data('section');
351
                $('#section-option').val(id);
352
                $('#text-option').val('');
353
                $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_OPTION');
354
                $('#modal-option').modal('show');
355
                return;
356
            });
357
            /**
358
             * Clicked add new Option
359
             */
360
            $('#btn-save-option').click(function(e) {
361
                if ($('#text-option').val() == '') {
362
                    $.fn.showError('Ingrese un texto');
363
                    return;
364
                } else {
365
                    if ($('#id-option').val() == "") {
366
                        addOption(
367
                            $('#section-option').val(),
368
                            $('#text-option').val(),
369
                        )
370
                    } else {
371
                        editOption(
372
                            $('#section-option').val(),
373
                            $('#id-option').val(),
374
                            $('#text-option').val(),
375
                        )
376
                    }
377
                    $('#modal-option').modal('hide');
378
                    return;
379
                }
380
            });
381
            /**
382
             * Clicked edit Option
383
             */
384
            $('body').on('click', 'button.btn-edit-option', function(e) {
385
                e.preventDefault();
386
                var id_section = $(this).data('section');
387
                var id_option = $(this).data('option');
388
                sections.map((item) => {
389
                    if (item.id_section == id_section) {
390
                        item.options.map((opt) => {
391
                            if (opt.id_option == id_option) {
392
                                $('#id-option').val(opt.id_option);
393
                                $('#section-option').val(opt.id_section);
394
                                $("#text-option").val(opt.title);
395
                                $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_OPTION');
396
                                $('#modal-option').modal('show');
397
                                return;
398
                            }
399
                        });
400
                    }
401
                });
402
            });
403
            /**
404
             * Clicked new Form
405
             */
406
            $('button.btn-add-form').click(function(e) {
407
                $('#form-main').attr('action', '$routeAdd');
408
                $('#form-main #form-name').val('');
409
                $('#form-main #job_description_id').val('');
410
                $('#form-main #form-status').val('$status_active');
411
                $("#rows").html('');
412
                sections = [];
413
                $('#row-lists').hide();
414
                $('#row-form').show();
415
                $('#form-main #form-name').focus();
416
            });
417
            /**
418
             * Clicked cancel new/edit Form
419
             */
420
            $('button.btn-edit-cancel').click(function(e) {
421
                e.preventDefault();
422
                $('#row-form').hide();
423
                $('#row-lists').show();
424
            });
425
            /**
426
             * Clicked save and close new/edit Form
427
             */
428
            $('button.btn-form-save-close').click(function(e) {
429
                e.preventDefault();
430
                if ($('#form-name').val() == '') {
431
                    $.fn.showError('Ingrese un nombre');
432
                } else if ($('#form-status').val() == '') {
433
                    $.fn.showError('Seleccione un status');
434
                } else if ($('#job_description_id').val() == '') {
435
                    $.fn.showError('Seleccione una descripción de cargo');
436
                } else if (sections.length == 0) {
437
                    $.fn.showError('Debe ingresar al menos una sección');
438
                } else {
439
                    var data = {
440
                        'name': $('#form-main #form-name').val(),
441
                        'job_description_id': $('#form-main #job_description_id').val(),
442
                        'status': $('#form-main #form-status').val(),
1057 geraldo 443
                        'content': JSON.stringify(sections)
1055 geraldo 444
                    }
977 geraldo 445
                    $.ajax({
446
                        'dataType': 'json',
447
                        'method': 'post',
1055 geraldo 448
                        'url': $('#form-main').attr('action'),
449
                        'data': data,
977 geraldo 450
                    }).done(function(response) {
451
                        if (response['success']) {
452
                            $.fn.showSuccess(response['data']);
1055 geraldo 453
                            $('#row-form').hide();
454
                            $('#row-lists').show();
455
                            /*---------- Reset Form -------- */
456
                            $('#form-main')[0].reset();
457
                            /*--------Reset Sections ----------*/
458
                            sections = [];
977 geraldo 459
                            tableForm.fnDraw();
460
                        } else {
1055 geraldo 461
                            $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
977 geraldo 462
                        }
463
                    });
1055 geraldo 464
                }
977 geraldo 465
            });
1055 geraldo 466
            /**
467
             * Remove Html Tags
468
             */
469
            const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
470
            /**
471
             * Render Sections data
472
             */
473
            const renderData = (data) => {
474
                console.log(data);
475
                $("#rows").html($("#sectionTemplate").render(data));
977 geraldo 476
            }
1055 geraldo 477
            /**
478
             * Add Section to array
479
             */
480
            const addSection = (title, text, type) => {
481
                sections.push({
482
                    'id_section': new Date().getTime(),
483
                    'title': title,
484
                    'type': type,
485
                    'text': text,
486
                    'options': []
487
                });
1054 geraldo 488
                renderData(sections);
977 geraldo 489
            }
1055 geraldo 490
            /**
491
             * Edit item behavior
492
             */
493
            const editSection = (id, title, text, type) => {
494
                sections.map((item) => {
495
                    if (item.id_section == id) {
496
                        item.title = title;
497
                        item.type = type;
498
                        item.text = text;
499
                    }
500
                });
501
                renderData(sections);
1009 geraldo 502
            }
1055 geraldo 503
            /**
504
             * Remove behavior
505
             */
506
            const removeSection = (id) => {
507
                sections = sections.filter((item) => item.id_section != id);
508
                renderData(sections);
977 geraldo 509
            }
1055 geraldo 510
            /**
511
             * Add Option to array
512
             */
513
            const addOption = (id_section, title) => {
514
                sections.map((item) => {
515
                    if (item.id_section == id_section) {
516
                        item.options.push({
517
                            'id_section': id_section,
518
                            'id_option': new Date().getTime(),
519
                            'title': title,
520
                        });
1027 geraldo 521
                    }
522
                });
1055 geraldo 523
                renderData(sections);
1027 geraldo 524
            }
1055 geraldo 525
            /**
526
             * Edit item Option
527
             */
528
            const editOption = (id_section, id, title) => {
529
                sections.map((item) => {
530
                    if (item.id_section == id_section) {
531
                        item.options.map((opt) => {
532
                            if (opt.id_option == id) {
533
                                opt.title = title
534
                            }
535
                        });
1054 geraldo 536
                    }
1012 geraldo 537
                });
1055 geraldo 538
                renderData(sections);
1012 geraldo 539
            }
1055 geraldo 540
            /**
541
             * Remove Option
542
             */
543
            const removeOption = (id_section, id) => {
544
                sections.map((item) => {
545
                    if (item.id_section == id_section) {
546
                        item.options = item.options.filter((opt) => opt.id_option != id) || []
1012 geraldo 547
                    }
548
                });
1055 geraldo 549
                renderData(sections);
1012 geraldo 550
            }
1055 geraldo 551
            /**
552
             * Clicked refresh button
553
             */
554
            $('button.btn-refresh').click(function(e) {
555
                tableForm.fnDraw();
556
            });
977 geraldo 557
});
558
JS;
559
$this->inlineScript()->captureEnd();
560
?>
561
<!-- Content Header (Page header) -->
562
<section class="content-header">
1027 geraldo 563
   <div class="container-fluid">
564
      <div class="row mb-2">
565
         <div class="col-sm-12">
566
            <h1>LABEL_PERFORMANCE_EVALUATION</h1>
567
         </div>
568
      </div>
569
   </div>
570
   <!-- /.container-fluid -->
977 geraldo 571
</section>
572
<section class="content">
1056 geraldo 573
   <div class="container-fluid" id="row-lists">
1027 geraldo 574
      <div class="row">
575
         <div class="col-12">
576
            <div class="card">
577
               <div class="card-body">
578
                  <table id="gridTable" class="table   table-hover">
579
                     <thead>
580
                        <tr>
581
                           <th>LABEL_NAME</th>
1078 geraldo 582
                           <th>LABEL_JOB_DESCRIPTION</th>
1027 geraldo 583
                           <th>LABEL_ACTIVE</th>
584
                           <th>LABEL_ACTIONS</th>
585
                        </tr>
586
                     </thead>
587
                     <tbody></tbody>
588
                  </table>
589
               </div>
590
               <div class="card-footer clearfix">
591
                  <div style="float:right;">
592
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
593
                     <?php if ($allowAdd) : ?>
594
                     <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
595
                     <?php endif; ?>
596
                  </div>
597
               </div>
977 geraldo 598
            </div>
1027 geraldo 599
         </div>
600
      </div>
601
   </div>
602
   <!-- Create/Edit Form -->
1051 geraldo 603
   <div class="row" id="row-form" style="display: none; padding: 16px;">
1027 geraldo 604
      <div class="col-xs-12 col-md-12">
605
         <form action="#" name="form-main" id="form-main">
606
            <input type="hidden" name="form-continue" id="form-continue" value="0" />
607
            <div class="form-group">
608
               <label for="form-name">LABEL_FIRST_NAME</label>
609
               <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
1012 geraldo 610
            </div>
1050 geraldo 611
            <div class="form-group">
612
                    <label for="job_description_id">LABEL_JOB_DESCRIPTION</label>
613
                    <select name="job_description_id" id="job_description_id" class="form-control">
1051 geraldo 614
                        <option value="">LABEL_SELECT</option>
615
                        <?php foreach ($jobsDescription as $rs): ?>
1061 geraldo 616
                            <option value="<?php echo $rs->uuid;?>"><?php echo $rs->name;?></option>
1051 geraldo 617
                        <?php endforeach; ?>
1050 geraldo 618
                    </select>
619
                </div>
620
            <div class="form-group">
621
                    <label for="form-status">LABEL_STATUS</label>
622
                    <select name="form-status" id="form-status" class="form-control">
623
                        <option value="<?php echo $status_inactive; ?>">LABEL_INACTIVE</option>
624
                        <option value="<?php echo $status_active; ?>">LABEL_ACTIVE</option>
625
                    </select>
626
                </div>
1027 geraldo 627
            <div class="row">
628
               <div class="col-xs-12 col-md-12 text-right">
629
                  <button type="button" class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
630
               </div>
631
            </div>
632
            <br />
633
            <div class="row">
634
               <div class="col-xs-12 col-md-12">
635
                  <div class="panel-group" id="rows"></div>
636
               </div>
637
            </div>
638
            <div class="form-group">
639
               <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
640
               <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
641
            </div>
642
         </form>
643
      </div>
644
   </div>
645
   <!-- Create/Edit Form-->
646
   <!-- section Modal -->
647
   <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
648
      <div class="modal-dialog modal-lg" role="document">
649
         <form action="#" name="form-section" id="form-section">
650
            <input type="hidden" name="id-section" id="id-section" />
651
            <div class="modal-content">
652
               <div class="modal-header">
653
                  <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
654
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
655
                  <span aria-hidden="true">&times;</span>
656
                  </button>
657
               </div>
658
               <div class="modal-body">
659
                  <div class="form-group">
660
                     <label for="title-section">LABEL_FIRST_NAME</label>
661
                     <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
662
                  </div>
663
                  <div class="form-group">
664
                     <label for="text-section">LABEL_TEXT</label>
665
                     <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
666
                  </div>
667
                  <div class="form-group">
668
                     <label for="type-section">LABEL_TYPE</label>
669
                     <select name="type-section" id="type-section" class="form-control">
670
                        <option value="simple">Simple</option>
671
                        <option value="multiple">Multiple</option>
672
                     </select>
673
                  </div>
674
               </div>
675
               <div class="modal-footer">
676
                  <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
677
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
678
               </div>
679
            </div>
680
         </form>
681
      </div>
682
   </div>
683
   <!-- End Modal section -->
684
   <!-- Modal Options -->
685
   <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
686
      <div class="modal-dialog modal-lg" role="document">
687
         <form action="#" name="form-option" id="form-option">
688
            <input type="hidden" name="section-option" id="section-option" value="" />
689
            <input type="hidden" name="id-option" id="id-option" value="" />
690
            <div class="modal-content">
691
               <div class="modal-header">
692
                  <h4 class="modal-title">LABEL_OPTION</h4>
693
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
694
                  <span aria-hidden="true">&times;</span>
695
                  </button>
696
               </div>
697
               <div class="modal-body">
698
                  <div class="form-group">
1047 geraldo 699
                     <label for="text-option">LABEL_TEXT</label>
1027 geraldo 700
                     <!--  ckeditor -->
1047 geraldo 701
                     <textarea  name="text-option" id="text-option" rows="5" class="form-control"></textarea>
1027 geraldo 702
                  </div>
703
               </div>
704
               <div class="modal-footer">
705
                  <button type="button" class="btn btn-primary" id="btn-save-option">LABEL_SAVE</button>
706
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
707
               </div>
708
            </div>
709
         </form>
710
      </div>
711
   </div>
1050 geraldo 712
 
1027 geraldo 713
   <!-- End Modal Options -->
714
   <!---Template Sections --->
715
   <script id="sectionTemplate" type="text/x-jsrender">
1045 geraldo 716
   <div class="panel panel-default" id="panel-{{:id_section}}">
717
   <div class="panel-heading">
718
      <h4 class="panel-title">
719
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
720
         <span class="section-name{{:id_section}}">
721
         {{:name}}
722
         </span>
723
         </a>
724
      </h4>
725
   </div>
726
   <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
727
      <div class="panel-body">
728
         <div class="table-responsive">
729
            <table class="table table-bordered">
730
               <thead>
731
                  <tr>
732
                     <th style="width: 10%;">LABEL_ELEMENT</th>
733
                     <th style="width: 30%;">LABEL_TEXT</th>
734
                     <th style="width: 10%;">LABEL_TYPE</th>
735
                     <th style="width: 50%;">LABEL_ACTIONS</th>
736
                  </tr>
737
               </thead>
738
               <tbody>
739
                  <tr class="tr-section">
740
                     <td class="text-left">LABEL_SECTION</td>
741
                     <td class="text-left">{{:title}}</td>
742
                     <td>
743
                        {{if type == 'simple'}} Simple {{/if}}
744
                        {{if type == 'multiple'}} Multiple {{/if}}
745
                     </td>
746
                     <td>
747
                        <button  class="btn btn-default btn-edit-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
748
                        <button  class="btn btn-default btn-delete-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button>
749
                        {{if type == 'multiple'}}
750
                        <button type="button" class="btn btn-default btn-add-option" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_ADD  LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD  LABEL_OPTION </button>
751
                        {{/if}}
752
                     </td>
753
                  </tr>
754
                  {{for options}}
755
                  <tr >
756
                     <td class="text-left">--LABEL_OPTION</td>
757
                     <td class="text-left">
758
                        {{:title}}
759
                     </td>
760
                     <td></td>
761
                     <td>
762
                        <button class="btn btn-default btn-edit-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>
763
                        <button class="btn btn-default btn-delete-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button>
764
                     </td>
765
                  </tr>
766
                  {{/for}}
767
               </tbody>
768
            </table>
769
         </div>
1027 geraldo 770
      </div>
1045 geraldo 771
   </div>
772
</div>
1027 geraldo 773
   </script>
774
   <!-- End Template Sections-->
977 geraldo 775
</section>