Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
1384 efrain 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
$routeDashboard = $this->url('dashboard');
1477 efrain 8
$routeDatatable = $this->url('recruitment-and-selection/vacancies');
9
$routeAdd       = $this->url('recruitment-and-selection/vacancies/add');
1384 efrain 10
 
11
 
12
 
1477 efrain 13
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/add') ? 1 : 0;
14
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/edit') ? 1 : 0;
15
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/delete') ? 1 : 0;
16
 
17
 
1384 efrain 18
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
19
 
20
 
21
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
22
 
23
 
24
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
26
 
27
 
28
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
31
 
32
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
33
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
34
 
35
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
37
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
38
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
39
 
40
 
41
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
42
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
43
 
44
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
45
 
46
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
47
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.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
 
54
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
55
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
56
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
57
 
58
// bootbox Alert //
59
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
60
 
61
// JsRender //
62
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
63
 
64
 
65
// Page Styles
66
$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
67
 
68
 
1388 eleazar 69
$status_active = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_ACTIVE;
70
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_INACTIVE;
1384 efrain 71
 
72
$this->inlineScript()->captureStart();
73
echo <<<JS
74
jQuery(document).ready(function($) {
75
    var allowEdit = $allowEdit;
76
    var allowDelete = $allowDelete;
77
    var sections = [];
78
    /**
79
     * Get rows and set data table
80
     */
1414 eleazar 81
 
1435 eleazar 82
 
1384 efrain 83
    var tableForm = $('#gridTable').dataTable({
84
        'processing': true,
85
        'serverSide': true,
86
        'searching': true,
87
        'order': [
88
            [0, 'asc']
89
        ],
90
        'ordering': true,
91
        'ordenable': true,
92
        'responsive': true,
93
        'select': false,
94
        'paging': true,
95
        'pagingType': 'simple_numbers',
96
        'ajax': {
97
            'url': '$routeDatatable',
98
            'type': 'get',
99
            'beforeSend': function(request) {
100
                NProgress.start();
101
            },
102
            'dataFilter': function(response) {
103
                var response = jQuery.parseJSON(response);
104
                var json = {};
105
                json.recordsTotal = 0;
106
                json.recordsFiltered = 0;
107
                json.data = [];
108
                if (response.success) {
109
                    json.recordsTotal = response.data.total;
110
                    json.recordsFiltered = response.data.total;
111
                    json.data = response.data.items;
112
                } else {
113
                    $.fn.showError(response.data)
114
                }
115
                return JSON.stringify(json);
116
            }
117
        },
118
        'language': {
119
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
120
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
121
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
122
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
123
            'sInfo': 'LABEL_DATATABLE_SINFO',
124
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
125
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
126
            'sInfoPostFix': '',
127
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
128
            'sUrl': '',
129
            'sInfoThousands': ',',
130
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
131
            'oPaginate': {
132
                'sFirst': 'LABEL_DATATABLE_SFIRST',
133
                'sLast': 'LABEL_DATATABLE_SLAST',
134
                'sNext': 'LABEL_DATATABLE_SNEXT',
135
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
136
            },
137
            'oAria': {
138
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
139
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
140
            },
141
        },
142
        'drawCallback': function(settings) {
143
            NProgress.done();
144
            $('button.btn-delete').confirmation({
145
                rootSelector: 'button.btn-delete',
146
                title: 'LABEL_ARE_YOU_SURE',
147
                singleton: true,
148
                btnOkLabel: 'LABEL_YES',
149
                btnCancelLabel: 'LABEL_NO',
150
                onConfirm: function(value) {
151
                    action = $(this).data('href');
152
                    NProgress.start();
153
                    $.ajax({
154
                        'dataType': 'json',
155
                        'accept': 'application/json',
156
                        'method': 'post',
157
                        'url': action,
158
                    }).done(function(response) {
159
                        if (response['success']) {
160
                            $.fn.showSuccess(response['data']);
161
                            tableForm.fnDraw();
162
                        } else {
163
                            $.fn.showError(response['data']);
164
                        }
165
                    }).fail(function(jqXHR, textStatus, errorThrown) {
166
                        $.fn.showError(textStatus);
167
                    }).always(function() {
168
                        NProgress.done();
169
                    });
170
                },
171
            });
172
        },
173
        'aoColumns': [{
174
                'mDataProp': 'name'
175
            },
176
            {
177
                'mDataProp': 'job_description'
178
            },
179
            {
180
                'mDataProp': 'actions'
181
            },
182
        ],
183
        'columnDefs': [{
184
                'targets': 0,
185
                'className': 'text-vertical-middle',
186
            },
187
            {
188
                'targets': 1,
189
                'className': 'text-vertical-middle',
190
            },
1449 eleazar 191
            // {
192
            //     'targets': -2,
193
            //     'orderable': false,
194
            //     'className': 'text-center',
195
            //     'render': function(data, type, row) {
196
            //         checked = data == 'a' ? ' checked="checked" ' : '';
197
            //         return '<div class="checkbox checkbox-success">' +
198
            //             '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
199
            //             '<label ></label></div>';
200
            //     }
201
            // },
1384 efrain 202
            {
203
                'targets': -1,
204
                'orderable': false,
205
                'render': function(data, type, row) {
206
                    s = '';
207
                    if (allowEdit) {
208
                        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;';
209
                    }
210
                    if (allowDelete) {
211
                        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;';
212
                    }
213
                    return s;
214
                }
215
            }
216
        ],
217
    });
218
 
219
 
220
 
221
    /**
222
     * Clicked on edit form
223
     */
224
    $('body').on('click', 'button.btn-edit-form', function(e) {
225
        e.preventDefault();
226
        form_id = $(this).data('id')
227
        var action = $(this).data('href');
228
        $.ajax({
229
            'dataType': 'json',
230
            'accept': 'application/json',
231
            'method': 'get',
232
            'url': action,
233
        }).done(function(response) {
234
            if (response['success']) {
1441 eleazar 235
                const lastDate = new Date(Date.parse(response['data']['last_date'] + " 00:00:00"));
236
 
1384 efrain 237
                $("#rows").html('');
238
                sections = [];
239
                $('#form-main').attr('action', action);
1565 efrain 240
                $('#form-main #name').val(response['data']['name']);
1398 eleazar 241
                $('#form-main #job_description_id').val(response['data']['job_description_id']).trigger('change');
1410 eleazar 242
                $('#form-main #location_search').val(response['data']['location_search']);
1384 efrain 243
                $('#form-main #job_category_id').val(response['data']['job_category_id']).trigger('change');
244
                $('#form-main #industry_id').val(response['data']['industry_id']).trigger('change');
1441 eleazar 245
                $('#form-main #last_date').val(
1442 eleazar 246
                    lastDate.getDate() + "/" + String(lastDate.getMonth() + 1).padStart(2, '0') + "/" + lastDate.getFullYear()
1441 eleazar 247
                ).trigger('change');
1565 efrain 248
                $('#form-main #status').val(response['data']['status']);
1416 eleazar 249
                CKEDITOR.instances['description'].setData(response['data']['description']);
1438 eleazar 250
                $('#row-lists').hide();
251
                $('#row-form').show();
1389 eleazar 252
 
1384 efrain 253
            } else {
254
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
255
            }
256
        }).fail(function(jqXHR, textStatus, errorThrown) {
257
            $.fn.showError(textStatus);
258
        });
259
    });
1389 eleazar 260
 
1417 eleazar 261
    $('#form-main #last_date').datetimepicker({
262
        locale: 'es',
263
        format: 'DD/MM/YYYY'
1418 eleazar 264
    });
1384 efrain 265
    /**
266
     * Clicked new Form
267
     */
268
    $('button.btn-add-form').click(function(e) {
269
        $("#rows").html('');
270
        sections = [];
271
        $('#form-main').attr('action', '$routeAdd');
1565 efrain 272
        $('#form-main #name').val('');
1398 eleazar 273
        $('#form-main #job_description_id').val('').trigger('change');
1410 eleazar 274
        $('#form-main #location_search').val('');
1384 efrain 275
        $('#form-main #job_category_id').val('').trigger('change');
276
        $('#form-main #industry_id').val('').trigger('change');
1417 eleazar 277
        $('#form-main #last_date').val('');
1565 efrain 278
        $('#form-main #status').val('$status_active');
1416 eleazar 279
        CKEDITOR.instances['description'].setData('');
1397 eleazar 280
        $('#row-lists').hide();
281
        $('#row-form').show();
1565 efrain 282
        $('#form-main #name').focus();
1384 efrain 283
        return;
284
    });
285
 
286
 
287
    $.validator.addMethod('checkLocation', function (value, element, param) {
288
        var otherElement = $(param);
289
 
290
        return $.trim(otherElement.val()).length > 0;
291
    }, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
292
 
293
    var autocompleteLocation = new google.maps.places.Autocomplete(
294
        (document.getElementById('location_search')),
295
        {types: ['(cities)']}
296
    );
297
 
1403 eleazar 298
    $.fn.fillInAddressLocation = function() {
1410 eleazar 299
        var place = autocompleteLocation.getPlace();
300
        if (!place.geometry) {
301
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
302
            return;
303
        } else {
304
            address1 = '';
305
            address2 = '';
306
            city1 = '';
307
            city2 = '';
308
            state = '';
309
            country = '';
310
            postal_code = '';
1403 eleazar 311
 
1410 eleazar 312
            formatted_address = place.formatted_address;
313
            latitude = place.geometry.location.lat();
314
            longitude = place.geometry.location.lng();
315
            var arrAddress = place.address_components;
316
 
317
            $.each(arrAddress, function(i, address_component) {
318
                if (address_component.types[0] == "route") {
319
                    address1 = address_component.long_name;
320
                }
321
                if (address_component.types[0] == "sublocality") {
322
                    address2 = address_component.long_name;
323
                }
324
                if (address_component.types[0] == "locality") {
325
                    city1 = address_component.long_name;
326
                }
327
                if (address_component.types[0] == "administrative_area_level_2") {
328
                    city2 = address_component.long_name;
329
                }
330
                if (address_component.types[0] == "administrative_area_level_1") {
331
                    state = address_component.long_name;
332
                }
333
                if (address_component.types[0] == "country") {
334
                    country = address_component.long_name;
335
                }
336
                if (address_component.types[0] == "postal_code") {
337
                    postal_code = address_component.long_name;
338
                }
339
            });
340
 
341
            $('#form-main #formatted_address').val(formatted_address);
342
            $('#form-main #address1').val(address1);
343
            $('#form-main #address2').val(address2);
344
            $('#form-main #city1').val(city1);
345
            $('#form-main #city2').val(city2);
346
            $('#form-main #state').val(state);
347
            $('#form-main #country').val(country);
348
            $('#form-main #postal_code').val(postal_code);
349
            $('#form-main #latitude').val(latitude);
350
            $('#form-main #longitude').val(longitude);
351
        }
1403 eleazar 352
    }
353
 
1384 efrain 354
    /**
355
     * Clicked cancel new/edit Form
356
     */
357
    $('button.btn-edit-cancel').click(function(e) {
358
        $('#row-form').hide();
359
        $('#row-lists').show();
360
        return;
361
    });
362
    /**
363
     * Clicked save and close new/edit Form
364
     */
365
    $('button.btn-form-save-close').click(function(e) {
366
        for (var instanceName in CKEDITOR.instances) {
367
            CKEDITOR.instances[instanceName].updateElement();
368
        }
369
        saveData(0);
370
    });
371
    /**
372
     * Save Form Data
373
     */
374
    const saveData = (action) => {
1565 efrain 375
        if ($('#name').val() == '') {
1384 efrain 376
            $.fn.showError('ERROR_ENTER_NAME');
1416 eleazar 377
        } else if ($('#description').val() == '') {
1384 efrain 378
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
379
        } else if ($('#form-category').val() == '') {
380
            $.fn.showError('ERROR_ENTER_CATEGORY');
381
        } else if ($('#form-industry').val() == '') {
382
            $.fn.showError('ERROR_ENTER_INDUSTRY');
383
        } else if ($('#form-text').val() == '') {
384
            $.fn.showError('ERROR_ENTER_TEXT');
1565 efrain 385
        } else if ($('#status').val() == '') {
1384 efrain 386
            $.fn.showError('ERROR_SELECT_STATUS');
387
        } else if ($('#job_description_id').val() == '') {
388
            $.fn.showError('ERROR_SELECT_JOB_DESCRIPTION');
389
        } else {
390
            $.ajax({
391
                'dataType': 'json',
392
                'method': 'post',
393
                'url': $('#form-main').attr('action'),
394
                'data': {
1565 efrain 395
                    'name': $('#form-main #name').val(),
1384 efrain 396
                    'job_description_id': $('#form-main #job_description_id').val(),
1424 eleazar 397
                    'location_search' :$('#form-main #location_search').val(),
1403 eleazar 398
                    'formatted_address': $('#form-main #formatted_address').val(),
399
                    'address1': $('#form-main #address1').val(),
400
                    'address2': $('#form-main #address2').val(),
401
                    'country': $('#form-main #country').val(),
402
                    'state': $('#form-main #state').val(),
403
                    'city1': $('#form-main #city1').val(),
404
                    'city2': $('#form-main #city2').val(),
405
                    'postal_code': $('#form-main #postal_code').val(),
406
                    'latitude': $('#form-main #latitude').val(),
407
                    'longitude': $('#form-main #longitude').val(),
1384 efrain 408
                    'job_category_id' :$('#form-main #job_category_id').val(),
409
                    'industry_id' :$('#form-main #industry_id').val(),
1421 eleazar 410
                    'last_date': $('#form-main #last_date').val(),
1565 efrain 411
                    'status': $('#form-main #status').val(),
1414 eleazar 412
                    'description': $('#form-main #description').val(),
1384 efrain 413
                    'content': JSON.stringify(sections)
414
                },
415
            }).done(function(response) {
416
                if (response['success']) {
417
                    $.fn.showSuccess(response['data']);
418
                    if (action == 1) {
419
                        $('#form-main').attr('action', response['action_edit']);
420
                    } else {
421
                        $('#row-form').hide();
422
                        $('#row-lists').show();
423
                        /*---------- Reset Form -------- */
424
                        $('#form-main')[0].reset();
425
                        tableForm.fnDraw();
426
                    }
427
                    return;
428
                } else {
429
                    $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
430
                    return;
431
                }
432
            });
433
        }
434
    }
435
    /**
436
     * Remove Html Tags
437
     */
438
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
1389 eleazar 439
 
440
 
1384 efrain 441
    /**
442
     * Remove Option
443
     */
444
    const removeOption = (id_section, id) => {
445
        sections.map((item) => {
446
            if (item.id_section == id_section) {
447
                item.options = item.options.filter((opt) => opt.id_option != id) || []
448
            }
449
        });
450
        return renderData(sections);
451
    }
452
    /**
453
     * Clicked refresh button
454
     */
455
    $('button.btn-refresh').click(function(e) {
456
        tableForm.fnDraw();
457
        return;
458
    });
459
    /**
460
     * Initialize select Jobdescription
461
     */
462
    $('#job_description_id').select2({
463
        theme: 'bootstrap4',
464
        width: '100%',
465
    });
466
 
467
    /**
468
     * Initialize select Jobcategory
469
     */
470
    $('#job_category_id').select2({
471
        theme: 'bootstrap4',
472
        width: '100%',
473
    });
474
 
475
     /**
476
     * Initialize select industry
477
     */
478
    $('#industry_id').select2({
479
        theme: 'bootstrap4',
480
        width: '100%',
481
    });
1566 eleazar 482
 
483
    /**
484
     * Initialize status toogle
485
     */
486
    $('#status').bootstrapToggle({
487
        'on': 'LABEL_ACTIVE',
488
        'off': 'LABEL_INACTIVE',
489
        'width': '160px',
490
        'height': '40px'
491
    });
1400 eleazar 492
 
1384 efrain 493
     /**
494
     * Initialize select Location
495
     */
496
 
1410 eleazar 497
    var validatorLocation = $('#location_search').validate({
1384 efrain 498
        debug: true,
499
        onclick: false,
500
        onkeyup: false,
501
        onfocusout: false,
502
        ignore: [],
503
        rules: {
504
            'location_search': {
505
                required: true,
1410 eleazar 506
                checkLocation: '#location_search #latitude'
1384 efrain 507
            }
508
        },
509
        submitHandler: function(form)
510
        {
511
            NProgress.start();
512
            $.ajax({
513
                'dataType'  : 'json',
514
                'accept'    : 'application/json',
515
                'method'    : 'post',
516
                'url'       :  route_location,
1410 eleazar 517
                'data'      :  $('#location_search').serialize(),
1384 efrain 518
            }).done(function(response) {
519
 
520
 
521
 
522
                if(response['success']) {
523
                    $('#overview-location').html(response.data);
524
                    $("#location-box").modal('hide');
525
                } else {
526
                    validatorLocation.resetForm();
527
                    $.fn.showError(response['data']);
528
                }
529
            }).fail(function( jqXHR, textStatus, errorThrown) {
530
                $.fn.showError(textStatus);
531
            }).always(function() {
532
                NProgress.done();
533
            });
534
            return false;
535
        },
536
        invalidHandler: function(form, validator) {
537
 
538
        }
539
    });
540
 
541
    $('body').on('click', 'a.btn-location-edit', function(e) {
542
        e.preventDefault();
543
 
1410 eleazar 544
        $('#form-main #location_search').val('');
545
        $('#form-main #formatted_address').val('');
546
        $('#form-main #address1').val('');
547
        $('#form-main #address2').val('');
548
        $('#form-main #country').val('');
549
        $('#form-main #state').val('');
550
        $('#form-main #city1').val('');
551
        $('#form-main #city2').val('');
552
        $('#form-main #postal_code').val('');
553
        $('#form-main #latitude').val('');
554
        $('#form-main #longitude').val('');
1384 efrain 555
        validatorLocation.resetForm();
556
 
557
        $("#location-box").modal('show');
558
    });
559
 
560
    $('.btn-location-close').on("click", function(e){
561
        e.preventDefault();
562
 
563
        $("#location-box").modal('hide');
564
        return false;
565
    });
1407 eleazar 566
 
567
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
1565 efrain 568
 
569
 
570
    CKEDITOR.replace('description');
1435 eleazar 571
  });
1384 efrain 572
JS;
573
 
574
$this->inlineScript()->captureEnd();
575
?>
576
<!-- Content Header (Page header) -->
577
<section class="content-header">
578
   <div class="container-fluid">
579
      <div class="row mb-2">
580
         <div class="col-sm-12">
581
            <h1>LABEL_RECRUITMENT_AND_SELECTION</h1>
582
         </div>
583
      </div>
584
   </div>
585
   <!-- /.container-fluid -->
586
</section>
587
<section class="content">
588
<div class="container-fluid" id="row-lists">
589
   <div class="row">
590
      <div class="col-12">
591
         <div class="card">
592
            <div class="card-body">
593
               <table id="gridTable" class="table   table-hover">
594
                  <thead>
595
                     <tr>
596
                        <th style="width:25%">LABEL_NAME</th>
597
                        <th style="width:20%">LABEL_JOB_DESCRIPTION</th>
598
                        <th style="width:25%">LABEL_ACTIONS</th>
599
                     </tr>
600
                  </thead>
601
                  <tbody></tbody>
602
               </table>
603
            </div>
604
            <div class="card-footer clearfix">
605
               <div style="float:right;">
606
                  <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
607
                  <?php if ($allowAdd) : ?>
608
                  <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
609
                  <?php endif; ?>
610
               </div>
611
            </div>
612
         </div>
613
      </div>
614
   </div>
615
</div>
616
<!-- Create/Edit Form -->
617
<div class="row" id="row-form" style="display: none; padding: 16px;">
618
   <div class="col-xs-12 col-md-12">
1561 efrain 619
	<?php
620
        $form = $this->form;
621
        $form->setAttributes([
622
            'method'    => 'post',
1564 efrain 623
            'name'      => 'form-main',
624
            'id'        => 'form-main'
1561 efrain 625
        ]);
626
 
627
        $form->prepare();
628
        echo $this->form()->openTag($form);
629
 
630
        $fields = ['formatted_address',
631
        'address1',
632
        'address2',
633
        'country',
634
        'state',
635
        'city1',
636
        'city2',
637
        'postal_code',
638
        'latitude',
639
        'longitude',
640
        ];
641
 
642
        foreach($fields as $field)
643
        {
644
            $element = $form->get($field);
645
            echo $this->formHidden($element);
646
        }
647
 
648
     ?>
649
		 <div class="form-group">
650
        	 <?php
1562 efrain 651
             $element = $form->get('name');
1561 efrain 652
             $element->setAttributes(['class' => 'form-control']);
1562 efrain 653
             $element->setOptions(['label' => 'LABEL_NAME']);
1561 efrain 654
 
655
             echo $this->formLabel($element);
656
             echo $this->formText($element);
657
            ?>
658
      	  </div>
659
		 <div class="form-group">
660
        	 <?php
661
             $element = $form->get('job_description_id');
662
             $element->setAttributes(['class' => 'form-control']);
663
             $element->setOptions(['label' => 'LABEL_POSITION_EVALUATED']);
664
 
665
             echo $this->formLabel($element);
666
             echo $this->formSelect($element);
667
            ?>
668
      	  </div>
1566 eleazar 669
            <div class="form-group">
670
        	 <?php
671
             $element = $form->get('job_category_id');
672
             $element->setAttributes(['class' => 'form-control']);
673
             $element->setOptions(['label' => 'LABEL_POSITION_EVALUATED']);
674
 
675
             echo $this->formLabel($element);
676
             echo $this->formSelect($element);
677
            ?>
678
      	  </div>
1561 efrain 679
		 <div class="form-group">
680
        	 <?php
681
             $element = $form->get('location_search');
682
             $element->setAttributes(['class' => 'form-control']);
683
             $element->setOptions(['label' => 'LABEL_LOCATION']);
684
 
685
             echo $this->formLabel($element);
686
             echo $this->formText($element);
687
            ?>
688
      	  </div>
689
	 	  <div class="form-group">
690
        	 <?php
691
             $element = $form->get('industry_id');
692
             $element->setAttributes(['class' => 'form-control']);
693
             $element->setOptions(['label' => 'LABEL_INDUSTRY']);
694
 
695
             echo $this->formLabel($element);
696
             echo $this->formSelect($element);
697
            ?>
698
      	  </div>
699
		 <div class="form-group">
700
        	 <?php
701
             $element = $form->get('last_date');
702
             $element->setAttributes(['class' => 'form-control']);
703
             $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
704
 
705
             echo $this->formLabel($element);
706
             echo $this->formText($element);
707
            ?>
708
      	  </div>
709
      	  		 <div class="form-group">
710
        	 <?php
711
             $element = $form->get('description');
712
             $element->setAttributes(['class' => 'form-control']);
713
             $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
714
 
715
             echo $this->formLabel($element);
716
             echo $this->formTextArea($element);
717
            ?>
718
      	  </div>
719
	 	  <div class="form-group">
720
        	 <?php
721
             $element = $form->get('status');
722
             $element->setAttributes(['class' => 'form-control']);
723
             $element->setOptions(['label' => 'LABEL_STATUS']);
724
 
725
             echo $this->formLabel($element);
1563 efrain 726
             echo $this->formCheckbox($element);
1561 efrain 727
            ?>
728
      	  </div>
1456 eleazar 729
 
1561 efrain 730
 
731
 
1455 eleazar 732
          <div class="form-group">
733
              <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE</button>
734
             <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
735
          </div>
1561 efrain 736
      <?php echo $this->form()->closeTag($form); ?>
1384 efrain 737
   </div>
738
</div>
739
<!-- Create/Edit Form-->
740
 
741
</section>