Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
1631 eleazar 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
$roleName = $currentUser->getUserTypeId();
1481 eleazar 5
 
1482 eleazar 6
$routeDatatable = $this->url('recruitment-and-selection/candidates');
1637 eleazar 7
$routeEmail = $this->url('recruitment-and-selection/user-by-email');
1506 eleazar 8
$routeAdd = $this->url('recruitment-and-selection/candidates/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
1481 eleazar 9
 
1482 eleazar 10
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/add') ? 1 : 0;
11
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/delete') ? 1 : 0;
1613 eleazar 12
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/edit') ? 1 : 0;
1636 eleazar 13
$allowEmail = $acl->isAllowed($roleName, 'recruitment-and-selection/user-by-email') ? 1 : 0;
1481 eleazar 14
 
15
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
16
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
17
 
1649 eleazar 18
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
1481 eleazar 19
 
20
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
21
 
1490 eleazar 22
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
23
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
1481 eleazar 24
 
1490 eleazar 25
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
31
 
32
 
1481 eleazar 33
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
36
 
37
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
38
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
39
 
40
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
41
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
44
 
45
 
46
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
49
 
50
 
51
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
53
 
1886 eleazar 54
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
55
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
56
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
57
 
58
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
59
 
1481 eleazar 60
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
61
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
62
 
63
 
1649 eleazar 64
$status_active = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_ACTIVE;
65
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_INACTIVE;
66
 
1658 eleazar 67
$evaluation_0 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_0;
68
$evaluation_1 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_1;
69
$evaluation_2 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_2;
70
$evaluation_3 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_3;
71
$evaluation_4 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_4;
1649 eleazar 72
 
1481 eleazar 73
$this->inlineScript()->captureStart();
74
echo <<<JS
1631 eleazar 75
jQuery(document).ready(function ($) {
1481 eleazar 76
    var allowAdd = $allowAdd;
1613 eleazar 77
    var allowDelete = $allowDelete;
78
    var allowEdit = $allowEdit;
1630 eleazar 79
    var allowEmail = $allowEmail;
1481 eleazar 80
 
1631 eleazar 81
    var gridTable = $('#gridTable').dataTable({
82
        'processing': true,
83
        'serverSide': true,
84
        'searching': true,
85
        'order': [[1, 'asc']],
86
        'ordering': true,
87
        'ordenable': true,
88
        'responsive': true,
89
        'select': false,
90
        'paging': true,
91
        'pagingType': 'simple_numbers',
92
        'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, 'All']],
1481 eleazar 93
 
1631 eleazar 94
        'ajax': {
95
            'url': '$routeDatatable',
96
            'type': 'get',
97
            'data': function (d) {
1481 eleazar 98
            },
1631 eleazar 99
            'beforeSend': function (request) {
100
                NProgress.start();
101
            },
102
            'dataFilter': function (response) {
103
                var response = jQuery.parseJSON(response);
1481 eleazar 104
 
1631 eleazar 105
                var json = {};
106
                json.recordsTotal = 0;
107
                json.recordsFiltered = 0;
108
                json.data = [];
1481 eleazar 109
 
1631 eleazar 110
                if (response.success) {
111
                    json.recordsTotal = response.data.total;
112
                    json.recordsFiltered = response.data.total;
113
                    json.data = response.data.items;
114
                } else {
115
                    $.fn.showError(response.data)
116
                }
1484 eleazar 117
 
1631 eleazar 118
                return JSON.stringify(json);
119
            }
120
        },
121
        'language': {
122
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
123
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
124
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
125
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
126
            'sInfo': 'LABEL_DATATABLE_SINFO',
127
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
128
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
129
            'sInfoPostFix': '',
130
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
131
            'sUrl': '',
132
            'sInfoThousands': ',',
133
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
134
            'oPaginate': {
135
                'sFirst': 'LABEL_DATATABLE_SFIRST',
136
                'sLast': 'LABEL_DATATABLE_SLAST',
137
                'sNext': 'LABEL_DATATABLE_SNEXT',
138
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
139
            },
140
            'oAria': {
141
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
142
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
143
            },
144
        },
145
        'drawCallback': function (settings) {
146
            NProgress.done();
147
            $('button.btn-delete').confirmation({
148
                rootSelector: 'button.btn-delete',
149
                title: 'LABEL_ARE_YOU_SURE',
150
                singleton: true,
151
                btnOkLabel: 'LABEL_YES',
152
                btnCancelLabel: 'LABEL_NO',
153
                onConfirm: function (value) {
154
                    action = $(this).data('href');
155
                    NProgress.start();
156
                    $.ajax({
157
                        'dataType': 'json',
158
                        'accept': 'application/json',
159
                        'method': 'post',
160
                        'url': action,
161
                    }).done(function (response) {
162
                        if (response['success']) {
163
                            $.fn.showSuccess(response['data']);
164
                            gridTable.api().ajax.reload(null, false);
165
                        } else {
166
                            $.fn.showError(response['data']);
167
                        }
168
                    }).fail(function (jqXHR, textStatus, errorThrown) {
169
                        $.fn.showError(textStatus);
170
                    }).always(function () {
171
                        NProgress.done();
172
                    });
173
                },
174
            });
1484 eleazar 175
 
1631 eleazar 176
            $('#form-add #file').fileinput({
177
                theme: 'fas',
178
                language: 'es',
179
                showUpload: false,
180
                dropZoneEnabled: false,
181
                maxFileCount: 1,
182
                allowedFileExtensions: ['pdf', 'docx'],
183
            });
1484 eleazar 184
 
1631 eleazar 185
            $('body').on('click', 'button.btn-add', function (e) {
186
                e.preventDefault();
1484 eleazar 187
 
1660 eleazar 188
                $('#form-add #user_id').val('');
1631 eleazar 189
                $('#form-add #first_name').val('');
190
                $('#form-add #last_name').val('');
191
                $('#form-add #email').val('');
192
                $('#form-add #file').fileinput('reset');
193
                $('#form-add #file').val('');
1649 eleazar 194
                $('#form-add #status').val('$status_active');
1659 eleazar 195
                $('#form-add #evaluation').val('$evaluation_0');
1653 eleazar 196
                CKEDITOR.instances.coment.setData('');
1631 eleazar 197
                validatorAdd.resetForm();
1616 eleazar 198
 
1631 eleazar 199
                $('#add-candidate-box').modal('show');
200
                return false;
201
            });
1616 eleazar 202
 
1631 eleazar 203
            $(".close-box, .btn-add-cancel").on("click", function (e) {
204
                e.preventDefault();
205
                $('#add-candidate-box').modal('hide');
206
                $('#edit-candidate-box').modal('hide');
207
                return false;
1616 eleazar 208
            });
209
 
1631 eleazar 210
            var validatorEdit = $('#form-edit').validate({
211
                debug: true,
212
                onclick: false,
213
                onkeyup: false,
214
                onfocusout: false,
215
                ignore: [],
216
                rules: {
1660 eleazar 217
                    'user_id': {
218
                        required: false,
219
                    },
1631 eleazar 220
                    'first_name': {
221
                        required: true,
222
                        maxlength: 128,
223
                    },
224
                    'file': {
225
                        required: false,
226
                        extension: 'pdf|docx',
227
                        accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
228
                    },
229
                    'last_name': {
230
                        required: true,
231
                    },
232
                    'email': {
233
                        required: true,
234
                    },
1658 eleazar 235
                    'evaluation':{
1649 eleazar 236
                        required: false,
237
                    },
1654 eleazar 238
                    'coment':{
239
                        updateCkeditor:function() {
1656 eleazar 240
                        CKEDITOR.instances.coment.updateElement();
1654 eleazar 241
                        },
1649 eleazar 242
                    },
1631 eleazar 243
                    'status': {
244
                        required: true,
245
                    }
246
                },
247
                submitHandler: function (form) {
248
                    var formdata = false;
249
                    if (window.FormData) {
250
                        formdata = new FormData(form); //form[0]);
251
                    }
1616 eleazar 252
 
1631 eleazar 253
                    $('input[type="submit"]').prop('disabled', true);
1616 eleazar 254
 
1631 eleazar 255
                    $.ajax({
256
                        'dataType': 'json',
257
                        'accept': 'application/json',
258
                        'method': 'post',
259
                        'url': $('#form-edit').attr('action'),
260
                        'data': formdata,
261
                        'processData': false,
262
                        'contentType': false,
263
                    }).done(function (response) {
264
                        if (response['success']) {
265
                            $.fn.showSuccess(response['data']);
266
 
267
                            $('#edit-candidate-box').modal('hide');
268
                            gridTable.api().ajax.reload(null, false);
269
                        } else {
270
                            validatorEdit.resetForm();
271
                            if (jQuery.type(response['data']) == 'string') {
272
                                $.fn.showError(response['data']);
273
                            } else {
274
                                $.each(response['data'], function (fieldname, errors) {
275
                                    $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
276
                                });
277
                            }
278
                        }
279
                    }).fail(function (jqXHR, textStatus, errorThrown) {
280
                        $.fn.showError(textStatus);
281
                    }).always(function () {
282
                        NProgress.done();
283
                    });
284
                    return false;
285
                },
286
                invalidHandler: function (form, validator) {
287
 
1616 eleazar 288
                }
289
            });
290
 
1631 eleazar 291
            $('body').on('click', 'button.btn-edit', function (e) {
292
                e.preventDefault();
1486 eleazar 293
 
1631 eleazar 294
                var url = $(this).data('href');
295
                $.ajax({
296
                    'dataType': 'json',
297
                    'accept': 'application/json',
298
                    'method': 'get',
299
                    'url': url,
300
                }).done(function (response) {
301
                    if (response['success']) {
302
                        $('#form-edit')[0].reset();
1486 eleazar 303
 
1631 eleazar 304
                        $('#form-edit').attr('action', url);
1660 eleazar 305
 
306
                        $('#form-edit #first_name').val(response['data']['user_id']);
1631 eleazar 307
                        $('#form-edit #first_name').val(response['data']['first_name']);
308
                        $('#form-edit #last_name').val(response['data']['last_name']);
309
                        $('#form-edit #email').val(response['data']['email']);
1649 eleazar 310
                        $('#form-edit #status').val(response['data']['status']);
1653 eleazar 311
                        CKEDITOR.instances.coment.setData(response['data']['coment']);
1631 eleazar 312
                        $('#form-edit #file').fileinput('reset');
313
                        $('#form-edit #file').val('');
314
 
315
 
316
                        $('#form-edit #status').val(response['data']['status']);
317
 
318
                        $('#edit-candidate-box').modal('show');
319
                    } else {
320
                        validatorEdit.resetForm();
321
                        if (jQuery.type(response['data']) == 'string') {
322
                            $.fn.showError(response['data']);
323
                        } else {
324
                            $.each(response['data'], function (fieldname, errors) {
325
                                $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
326
                            });
327
                        }
1486 eleazar 328
                    }
1631 eleazar 329
                }).fail(function (jqXHR, textStatus, errorThrown) {
330
                    $.fn.showError(textStatus);
331
                }).always(function () {
332
                    NProgress.done();
333
                });
1486 eleazar 334
            });
335
 
1631 eleazar 336
            var validatorAdd = $('#form-add').validate({
337
                debug: true,
338
                onclick: false,
339
                onkeyup: false,
340
                onfocusout: false,
341
                ignore: [],
342
                rules: {
1660 eleazar 343
                    'user_id': {
344
                        required: false,
345
                    },
1631 eleazar 346
                    'first_name': {
347
                        required: true,
348
                        maxlength: 128,
349
                    },
350
                    'file': {
351
                        required: false,
352
                        extension: 'pdf|docx',
353
                        accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
354
                    },
355
                    'last_name': {
356
                        required: true,
357
                    },
358
                    'email': {
359
                        required: true,
360
                    },
1658 eleazar 361
                    'evaluation':{
1649 eleazar 362
                        required: false,
363
                    },
1654 eleazar 364
                    'coment':{
365
                        updateCkeditor:function() {
1656 eleazar 366
                            CKEDITOR.instances.coment.updateElement();
1654 eleazar 367
                        },
1649 eleazar 368
                    },
1631 eleazar 369
                    'status': {
370
                        required: true,
371
                    }
372
                },
373
                submitHandler: function (form) {
374
                    var formdata = false;
375
                    if (window.FormData) {
376
                        formdata = new FormData(form); //form[0]);
377
                    }
1630 eleazar 378
 
1631 eleazar 379
                    $('input[type="submit"]').prop('disabled', true);
1630 eleazar 380
 
1631 eleazar 381
                    $.ajax({
382
                        'dataType': 'json',
383
                        'accept': 'application/json',
384
                        'method': 'post',
385
                        'url': $('#form-add').attr('action'),
386
                        'data': formdata,
387
                        'processData': false,
388
                        'contentType': false,
389
                    }).done(function (response) {
390
                        if (response['success']) {
391
                            $.fn.showSuccess(response['data']);
392
 
393
                            $('#add-candidate-box').modal('hide');
394
                            gridTable.api().ajax.reload(null, false);
395
                        } else {
396
                            validatorAdd.resetForm();
397
                            if (jQuery.type(response['data']) == 'string') {
398
                                $.fn.showError(response['data']);
399
                            } else {
400
                                $.each(response['data'], function (fieldname, errors) {
401
                                    $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
402
                                });
403
                            }
404
                        }
405
                    }).fail(function (jqXHR, textStatus, errorThrown) {
406
                        $.fn.showError(textStatus);
407
                    }).always(function () {
408
                        NProgress.done();
409
                    });
410
                    return false;
411
                },
412
                invalidHandler: function (form, validator) {
413
 
1630 eleazar 414
                }
415
            });
416
        },
1631 eleazar 417
        'aoColumns': [
418
            { 'mDataProp': 'first_name' },
419
            { 'mDataProp': 'last_name' },
420
            { 'mDataProp': 'email' },
421
            { 'mDataProp': 'actions' },
422
        ],
423
        'columnDefs': [
424
            {
425
                'targets': -1,
426
                'orderable': false,
427
                'render': function (data, type, row) {
428
                    s = '';
1630 eleazar 429
 
1631 eleazar 430
                    if (allowEdit && data['link_edit']) {
431
                        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-pencil"></i> LABEL_EDIT </button>&nbsp;';
432
                    }
1481 eleazar 433
 
1631 eleazar 434
                    if (allowDelete && data['link_delete']) {
435
                        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-times"></i> LABEL_DELETE </button>&nbsp;';
436
                    }
1614 eleazar 437
 
1631 eleazar 438
                    return s;
1481 eleazar 439
                }
1631 eleazar 440
            }
441
        ],
442
    });
1481 eleazar 443
 
1631 eleazar 444
    $('#form-filter #form_uuid').change(function (e) {
1481 eleazar 445
        e.preventDefault();
446
 
1503 eleazar 447
        var uuid = e.target.value;
448
 
1507 eleazar 449
        $('#form-add').attr('action', String("$routeAdd").replaceAll('UUID_PLACEHOLDER', uuid));
1503 eleazar 450
 
1599 eleazar 451
        gridTable.api().ajax.url("$routeDatatable" + "/" + uuid);
1481 eleazar 452
        gridTable.api().ajax.reload(null, false);
453
    })
454
 
455
 
1631 eleazar 456
    $('body').on('click', 'button.btn-refresh', function (e) {
1481 eleazar 457
        e.preventDefault();
458
        gridTable.api().ajax.reload(null, false);
459
    });
1507 eleazar 460
 
461
    $('#form-filter #form_uuid').change();
1642 eleazar 462
 
463
    $('body').on('click', '#check-email', function () {
464
        $.ajax("$routeEmail", {
465
            accepts: 'application/json',
466
            method: 'GET',
467
            data: {
468
                'email': $('#form-add #email').val(),
469
            }
1648 eleazar 470
        }).done(function (response) {
471
            if (response['success']) {
1662 eleazar 472
                $('#form-add #user_id').val(response['data']['user_id']);
1648 eleazar 473
                $('#form-add #first_name').val(response['data']['first_name']);
474
                $('#form-add #last_name').val(response['data']['last_name']);
475
            } else {
1646 eleazar 476
                $.fn.showError(response['data']);
477
            }
478
        }).fail(function (jqXHR, textStatus, errorThrown) {
479
            $.fn.showError(textStatus);
480
        }).always(function () {
481
            NProgress.done();
482
        });
1648 eleazar 483
    })
1655 eleazar 484
 
485
    CKEDITOR.replace('coment');
1481 eleazar 486
});
487
JS;
488
$this->inlineScript()->captureEnd();
489
?>
490
 
491
 
492
<!-- Content Header (Page header) -->
493
<section class="content-header">
1631 eleazar 494
    <div class="container-fluid">
495
        <div class="row mb-2">
496
            <div class="col-sm-12">
497
                <h1>LABEL_CANDIDATES</h1>
498
            </div>
499
        </div>
500
    </div><!-- /.container-fluid -->
1481 eleazar 501
</section>
502
 
503
<section class="content">
1631 eleazar 504
    <div class="container-fluid">
505
        <div class="row">
506
            <div class="col-12">
507
                <div class="card">
508
                    <div class="card-header">
509
                        <?php
1486 eleazar 510
                        // $form = $this->form;
1631 eleazar 511
                        $form->setAttributes([
512
                            'name' => 'form-filter',
513
                            'id' => 'form-filter',
1481 eleazar 514
                        ]);
1631 eleazar 515
 
1481 eleazar 516
                        $form->prepare();
517
                        echo $this->form()->openTag($form);
1631 eleazar 518
                        ?>
1481 eleazar 519
                        <div class="row">
520
                            <div class="col-md-6 col-sm-12">
521
                                <div class="form-group">
522
                                    <?php
523
                                    $element = $form->get('form_uuid');
1631 eleazar 524
 
1484 eleazar 525
                                    $element->setOptions(['label' => 'LABEL_VACANCIES']);
1631 eleazar 526
 
1481 eleazar 527
                                    $element->setAttributes(['class' => 'form-control']);
528
                                    echo $this->formLabel($element);
529
                                    echo $this->formSelect($element);
530
                                    ?>
1631 eleazar 531
                                </div>
1481 eleazar 532
                            </div>
533
 
534
                        </div>
1631 eleazar 535
                        <?php echo $this->form()->closeTag($form); ?>
536
                    </div>
537
                    <div class="card-body">
538
                        <table id="gridTable" class="table   table-hover">
539
                            <thead>
540
                            <tr>
541
                                <th>LABEL_FIRST_NAME</th>
542
                                <th>LABEL_LAST_NAME</th>
543
                                <th>LABEL_EMAIL</th>
544
                                <th>LABEL_ACTIONS</th>
545
                            </tr>
546
                            </thead>
547
                            <tbody>
548
                            </tbody>
549
                        </table>
550
                    </div>
551
                    <div class="card-footer clearfix">
552
                        <div style="float:right;">
553
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i>
554
                                LABEL_REFRESH
555
                            </button>
556
                            <?php if ($allowAdd) : ?>
557
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i>
558
                                    LABEL_ADD
559
                                </button>
560
                            <?php endif; ?>
561
                        </div>
562
                    </div>
563
                </div>
564
            </div>
565
        </div>
566
    </div>
567
</section>
1616 eleazar 568
 
569
<!-- The Add Modal -->
570
<div class="modal" tabindex="-1" role="dialog" id="add-candidate-box">
1631 eleazar 571
    <div class="modal-dialog" role="document">
572
        <?php
573
        //$form = $this->formA;
574
        $form->setAttributes([
575
            'method' => 'post',
576
            'name' => 'form-add',
577
            'action' => $routeAdd,
578
            'email' => $routeEmail,
579
            'id' => 'form-add'
580
        ]);
581
        $form->prepare();
582
        echo $this->form()->openTag($form);
583
 
1660 eleazar 584
        $fields = ['user_id'];
585
 
586
        foreach($fields as $field)
587
        {
588
            $element = $form->get($field);
589
            echo $this->formHidden($element);
590
        }
591
 
1631 eleazar 592
        ?>
593
        <div class="modal-content">
594
            <div class="modal-header">
595
                <h3 class="modal-title">LABEL_NEW_CANDIDATE</h3>
596
            </div>
597
            <div class="modal-body">
598
                <div class="form-group">
599
                    <?php
600
                    $element = $form->get('first_name');
601
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
602
                    $element->setAttributes(['class' => 'form-control']);
603
                    echo $this->formLabel($element);
604
                    echo $this->formText($element);
1485 eleazar 605
                    ?>
1631 eleazar 606
                </div>
607
                <div class="form-group">
608
                    <?php
609
                    $element = $form->get('last_name');
610
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
611
                    $element->setAttributes(['class' => 'form-control']);
612
                    echo $this->formLabel($element);
613
                    echo $this->formText($element);
1485 eleazar 614
                    ?>
1631 eleazar 615
                </div>
616
                <div class="form-group">
617
                    <?php
618
                    $element = $form->get('email');
619
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
620
                    $element->setAttributes(['class' => 'form-control']);
621
                    echo $this->formLabel($element);
622
                    echo $this->formText($element);
1485 eleazar 623
                    ?>
1631 eleazar 624
                </div>
625
                <div class="form-group">
1649 eleazar 626
              	   <?php
1652 eleazar 627
                     $element = $form->get('coment');
1649 eleazar 628
                     $element->setAttributes(['class' => 'form-control']);
1657 eleazar 629
                     $element->setOptions(['label' => 'LABEL_COMMENT']);
1649 eleazar 630
                     echo $this->formLabel($element);
631
                     echo $this->formTextArea($element);
632
                    ?>
633
      	        </div>
634
                  <div class="form-group">
1631 eleazar 635
                    <?php
1658 eleazar 636
                    $element = $form->get('evaluation');
1649 eleazar 637
                    $element->setAttributes(['class' => 'form-control']);
1658 eleazar 638
                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
1649 eleazar 639
                    echo $this->formLabel($element);
640
                    echo $this->formSelect($element);
641
                    ?>
642
                </div>
643
                <div class="form-group">
644
                    <?php
1485 eleazar 645
                    $element = $form->get('file');
1631 eleazar 646
 
647
                    $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
1485 eleazar 648
                    $element->setOptions(['label' => 'LABEL_CURRICULUM']);
649
                    echo $this->formLabel($element);
650
                    ?>
651
                    <div class="file-loading">
1631 eleazar 652
                        <?php echo $this->formFile($element); ?>
1493 eleazar 653
                    </div>
1631 eleazar 654
                </div>
655
                <div class="form-group">
656
                    <?php
657
                    $element = $form->get('status');
658
                    $element->setAttributes(['class' => 'form-control']);
659
                    $element->setOptions(['label' => 'LABEL_STATUS']);
660
                    echo $this->formLabel($element);
661
                    echo $this->formSelect($element);
1619 eleazar 662
                    ?>
1631 eleazar 663
                </div>
664
            </div>
665
            <div class="modal-footer">
666
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
667
                <button id="check-email" type="button" class="btn btn-primary">LABEL_CHECK_EMAIL</button>
668
                <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
669
            </div>
670
            <?php echo $this->form()->closeTag($form); ?>
671
        </div>
672
    </div>
1616 eleazar 673
</div>
674
 
675
<!-- The Edit Modal -->
676
<div class="modal" tabindex="-1" role="dialog" id="edit-candidate-box">
1631 eleazar 677
    <div class="modal-dialog" role="document">
678
        <?php
679
        $form->setAttributes([
680
            'method' => 'post',
681
            'name' => 'form-edit',
682
            'id' => 'form-edit'
683
        ]);
684
        $form->prepare();
685
        echo $this->form()->openTag($form);
686
 
1660 eleazar 687
        $fields = ['user_id'];
688
 
689
        foreach($fields as $field)
690
        {
691
            $element = $form->get($field);
692
            echo $this->formHidden($element);
693
        }
694
 
1631 eleazar 695
        ?>
696
        <div class="modal-content">
697
            <div class="modal-header">
698
                <h3 class="modal-title">LABEL_CANDIDATE</h3>
699
            </div>
700
            <div class="modal-body">
701
                <div class="form-group">
702
                    <?php
703
                    $element = $form->get('first_name');
704
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
705
                    $element->setAttributes(['class' => 'form-control']);
706
                    echo $this->formLabel($element);
707
                    echo $this->formText($element);
1616 eleazar 708
                    ?>
1631 eleazar 709
                </div>
710
                <div class="form-group">
711
                    <?php
712
                    $element = $form->get('last_name');
713
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
714
                    $element->setAttributes(['class' => 'form-control']);
715
                    echo $this->formLabel($element);
716
                    echo $this->formText($element);
1616 eleazar 717
                    ?>
1631 eleazar 718
                </div>
719
                <div class="form-group">
720
                    <?php
721
                    $element = $form->get('email');
722
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
723
                    $element->setAttributes(['class' => 'form-control']);
724
                    echo $this->formLabel($element);
725
                    echo $this->formText($element);
1616 eleazar 726
                    ?>
1631 eleazar 727
                </div>
728
                <div class="form-group">
1649 eleazar 729
              	   <?php
1652 eleazar 730
                     $element = $form->get('coment');
1649 eleazar 731
                     $element->setAttributes(['class' => 'form-control']);
1657 eleazar 732
                     $element->setOptions(['label' => 'LABEL_COMMENT']);
1649 eleazar 733
                     echo $this->formLabel($element);
734
                     echo $this->formTextArea($element);
735
                    ?>
736
      	        </div>
737
                  <div class="form-group">
1631 eleazar 738
                    <?php
1658 eleazar 739
                    $element = $form->get('evaluation');
1649 eleazar 740
                    $element->setAttributes(['class' => 'form-control']);
1658 eleazar 741
                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
1649 eleazar 742
                    echo $this->formLabel($element);
743
                    echo $this->formSelect($element);
744
                    ?>
745
                </div>
746
                <div class="form-group">
747
                    <?php
1616 eleazar 748
                    $element = $form->get('file');
1631 eleazar 749
 
750
                    $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
1616 eleazar 751
                    $element->setOptions(['label' => 'LABEL_CURRICULUM']);
752
                    echo $this->formLabel($element);
753
                    ?>
754
                    <div class="file-loading">
1631 eleazar 755
                        <?php echo $this->formFile($element); ?>
1616 eleazar 756
                    </div>
1631 eleazar 757
                </div>
1619 eleazar 758
 
1631 eleazar 759
                <div class="form-group">
760
                    <?php
761
                    $element = $form->get('status');
762
                    $element->setAttributes(['class' => 'form-control']);
763
                    $element->setOptions(['label' => 'LABEL_STATUS']);
764
                    echo $this->formLabel($element);
765
                    echo $this->formSelect($element);
1619 eleazar 766
                    ?>
1631 eleazar 767
                </div>
768
            </div>
769
            <div class="modal-footer">
770
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
771
                <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
772
            </div>
773
            <?php echo $this->form()->closeTag($form); ?>
774
        </div>
775
    </div>
1485 eleazar 776
</div>