Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1564 | Rev 1566 | 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 continue new Form
364
     */
365
    $('button.btn-form-save-continue').click(function(e) {
366
        for (var instanceName in CKEDITOR.instances) {
367
            CKEDITOR.instances[instanceName].updateElement();
368
        }
369
        saveData(1);
370
    });
371
    /**
372
     * Clicked save and close new/edit Form
373
     */
374
    $('button.btn-form-save-close').click(function(e) {
375
        for (var instanceName in CKEDITOR.instances) {
376
            CKEDITOR.instances[instanceName].updateElement();
377
        }
378
        saveData(0);
379
    });
380
    /**
381
     * Save Form Data
382
     */
383
    const saveData = (action) => {
1565 efrain 384
        if ($('#name').val() == '') {
1384 efrain 385
            $.fn.showError('ERROR_ENTER_NAME');
1416 eleazar 386
        } else if ($('#description').val() == '') {
1384 efrain 387
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
388
        } else if ($('#form-category').val() == '') {
389
            $.fn.showError('ERROR_ENTER_CATEGORY');
390
        } else if ($('#form-industry').val() == '') {
391
            $.fn.showError('ERROR_ENTER_INDUSTRY');
392
        } else if ($('#form-text').val() == '') {
393
            $.fn.showError('ERROR_ENTER_TEXT');
1565 efrain 394
        } else if ($('#status').val() == '') {
1384 efrain 395
            $.fn.showError('ERROR_SELECT_STATUS');
396
        } else if ($('#job_description_id').val() == '') {
397
            $.fn.showError('ERROR_SELECT_JOB_DESCRIPTION');
398
        } else {
399
            $.ajax({
400
                'dataType': 'json',
401
                'method': 'post',
402
                'url': $('#form-main').attr('action'),
403
                'data': {
1565 efrain 404
                    'name': $('#form-main #name').val(),
1384 efrain 405
                    'job_description_id': $('#form-main #job_description_id').val(),
1424 eleazar 406
                    'location_search' :$('#form-main #location_search').val(),
1403 eleazar 407
                    'formatted_address': $('#form-main #formatted_address').val(),
408
                    'address1': $('#form-main #address1').val(),
409
                    'address2': $('#form-main #address2').val(),
410
                    'country': $('#form-main #country').val(),
411
                    'state': $('#form-main #state').val(),
412
                    'city1': $('#form-main #city1').val(),
413
                    'city2': $('#form-main #city2').val(),
414
                    'postal_code': $('#form-main #postal_code').val(),
415
                    'latitude': $('#form-main #latitude').val(),
416
                    'longitude': $('#form-main #longitude').val(),
1384 efrain 417
                    'job_category_id' :$('#form-main #job_category_id').val(),
418
                    'industry_id' :$('#form-main #industry_id').val(),
1421 eleazar 419
                    'last_date': $('#form-main #last_date').val(),
1565 efrain 420
                    'status': $('#form-main #status').val(),
1414 eleazar 421
                    'description': $('#form-main #description').val(),
1384 efrain 422
                    'content': JSON.stringify(sections)
423
                },
424
            }).done(function(response) {
425
                if (response['success']) {
426
                    $.fn.showSuccess(response['data']);
427
                    if (action == 1) {
428
                        $('#form-main').attr('action', response['action_edit']);
429
                    } else {
430
                        $('#row-form').hide();
431
                        $('#row-lists').show();
432
                        /*---------- Reset Form -------- */
433
                        $('#form-main')[0].reset();
434
                        tableForm.fnDraw();
435
                    }
436
                    return;
437
                } else {
438
                    $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
439
                    return;
440
                }
441
            });
442
        }
443
    }
444
    /**
445
     * Remove Html Tags
446
     */
447
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
1389 eleazar 448
 
449
 
1384 efrain 450
    /**
451
     * Remove Option
452
     */
453
    const removeOption = (id_section, id) => {
454
        sections.map((item) => {
455
            if (item.id_section == id_section) {
456
                item.options = item.options.filter((opt) => opt.id_option != id) || []
457
            }
458
        });
459
        return renderData(sections);
460
    }
461
    /**
462
     * Clicked refresh button
463
     */
464
    $('button.btn-refresh').click(function(e) {
465
        tableForm.fnDraw();
466
        return;
467
    });
468
    /**
469
     * Initialize select Jobdescription
470
     */
471
    $('#job_description_id').select2({
472
        theme: 'bootstrap4',
473
        width: '100%',
474
    });
475
 
476
    /**
477
     * Initialize select Jobcategory
478
     */
479
    $('#job_category_id').select2({
480
        theme: 'bootstrap4',
481
        width: '100%',
482
    });
483
 
484
     /**
485
     * Initialize select industry
486
     */
487
    $('#industry_id').select2({
488
        theme: 'bootstrap4',
489
        width: '100%',
490
    });
1400 eleazar 491
 
1384 efrain 492
     /**
493
     * Initialize select Location
494
     */
495
 
1410 eleazar 496
    var validatorLocation = $('#location_search').validate({
1384 efrain 497
        debug: true,
498
        onclick: false,
499
        onkeyup: false,
500
        onfocusout: false,
501
        ignore: [],
502
        rules: {
503
            'location_search': {
504
                required: true,
1410 eleazar 505
                checkLocation: '#location_search #latitude'
1384 efrain 506
            }
507
        },
508
        submitHandler: function(form)
509
        {
510
            NProgress.start();
511
            $.ajax({
512
                'dataType'  : 'json',
513
                'accept'    : 'application/json',
514
                'method'    : 'post',
515
                'url'       :  route_location,
1410 eleazar 516
                'data'      :  $('#location_search').serialize(),
1384 efrain 517
            }).done(function(response) {
518
 
519
 
520
 
521
                if(response['success']) {
522
                    $('#overview-location').html(response.data);
523
                    $("#location-box").modal('hide');
524
                } else {
525
                    validatorLocation.resetForm();
526
                    $.fn.showError(response['data']);
527
                }
528
            }).fail(function( jqXHR, textStatus, errorThrown) {
529
                $.fn.showError(textStatus);
530
            }).always(function() {
531
                NProgress.done();
532
            });
533
            return false;
534
        },
535
        invalidHandler: function(form, validator) {
536
 
537
        }
538
    });
539
 
540
    $('body').on('click', 'a.btn-location-edit', function(e) {
541
        e.preventDefault();
542
 
1410 eleazar 543
        $('#form-main #location_search').val('');
544
        $('#form-main #formatted_address').val('');
545
        $('#form-main #address1').val('');
546
        $('#form-main #address2').val('');
547
        $('#form-main #country').val('');
548
        $('#form-main #state').val('');
549
        $('#form-main #city1').val('');
550
        $('#form-main #city2').val('');
551
        $('#form-main #postal_code').val('');
552
        $('#form-main #latitude').val('');
553
        $('#form-main #longitude').val('');
1384 efrain 554
        validatorLocation.resetForm();
555
 
556
        $("#location-box").modal('show');
557
    });
558
 
559
    $('.btn-location-close').on("click", function(e){
560
        e.preventDefault();
561
 
562
        $("#location-box").modal('hide');
563
        return false;
564
    });
1407 eleazar 565
 
566
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
1565 efrain 567
 
568
 
569
    CKEDITOR.replace('description');
1435 eleazar 570
  });
1384 efrain 571
JS;
572
 
573
$this->inlineScript()->captureEnd();
574
?>
575
<!-- Content Header (Page header) -->
576
<section class="content-header">
577
   <div class="container-fluid">
578
      <div class="row mb-2">
579
         <div class="col-sm-12">
580
            <h1>LABEL_RECRUITMENT_AND_SELECTION</h1>
581
         </div>
582
      </div>
583
   </div>
584
   <!-- /.container-fluid -->
585
</section>
586
<section class="content">
587
<div class="container-fluid" id="row-lists">
588
   <div class="row">
589
      <div class="col-12">
590
         <div class="card">
591
            <div class="card-body">
592
               <table id="gridTable" class="table   table-hover">
593
                  <thead>
594
                     <tr>
595
                        <th style="width:25%">LABEL_NAME</th>
596
                        <th style="width:20%">LABEL_JOB_DESCRIPTION</th>
597
                        <th style="width:25%">LABEL_ACTIONS</th>
598
                     </tr>
599
                  </thead>
600
                  <tbody></tbody>
601
               </table>
602
            </div>
603
            <div class="card-footer clearfix">
604
               <div style="float:right;">
605
                  <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
606
                  <?php if ($allowAdd) : ?>
607
                  <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
608
                  <?php endif; ?>
609
               </div>
610
            </div>
611
         </div>
612
      </div>
613
   </div>
614
</div>
615
<!-- Create/Edit Form -->
616
<div class="row" id="row-form" style="display: none; padding: 16px;">
617
   <div class="col-xs-12 col-md-12">
1561 efrain 618
	<?php
619
        $form = $this->form;
620
        $form->setAttributes([
621
            'method'    => 'post',
1564 efrain 622
            'name'      => 'form-main',
623
            'id'        => 'form-main'
1561 efrain 624
        ]);
625
 
626
        $form->prepare();
627
        echo $this->form()->openTag($form);
628
 
629
        $fields = ['formatted_address',
630
        'address1',
631
        'address2',
632
        'country',
633
        'state',
634
        'city1',
635
        'city2',
636
        'postal_code',
637
        'latitude',
638
        'longitude',
639
        ];
640
 
641
        foreach($fields as $field)
642
        {
643
            $element = $form->get($field);
644
            echo $this->formHidden($element);
645
        }
646
 
647
     ?>
648
		 <div class="form-group">
649
        	 <?php
1562 efrain 650
             $element = $form->get('name');
1561 efrain 651
             $element->setAttributes(['class' => 'form-control']);
1562 efrain 652
             $element->setOptions(['label' => 'LABEL_NAME']);
1561 efrain 653
 
654
             echo $this->formLabel($element);
655
             echo $this->formText($element);
656
            ?>
657
      	  </div>
658
		 <div class="form-group">
659
        	 <?php
660
             $element = $form->get('job_description_id');
661
             $element->setAttributes(['class' => 'form-control']);
662
             $element->setOptions(['label' => 'LABEL_POSITION_EVALUATED']);
663
 
664
             echo $this->formLabel($element);
665
             echo $this->formSelect($element);
666
            ?>
667
      	  </div>
668
		 <div class="form-group">
669
        	 <?php
670
             $element = $form->get('location_search');
671
             $element->setAttributes(['class' => 'form-control']);
672
             $element->setOptions(['label' => 'LABEL_LOCATION']);
673
 
674
             echo $this->formLabel($element);
675
             echo $this->formText($element);
676
            ?>
677
      	  </div>
678
	 	  <div class="form-group">
679
        	 <?php
680
             $element = $form->get('industry_id');
681
             $element->setAttributes(['class' => 'form-control']);
682
             $element->setOptions(['label' => 'LABEL_INDUSTRY']);
683
 
684
             echo $this->formLabel($element);
685
             echo $this->formSelect($element);
686
            ?>
687
      	  </div>
688
		 <div class="form-group">
689
        	 <?php
690
             $element = $form->get('last_date');
691
             $element->setAttributes(['class' => 'form-control']);
692
             $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
693
 
694
             echo $this->formLabel($element);
695
             echo $this->formText($element);
696
            ?>
697
      	  </div>
698
      	  		 <div class="form-group">
699
        	 <?php
700
             $element = $form->get('description');
701
             $element->setAttributes(['class' => 'form-control']);
702
             $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
703
 
704
             echo $this->formLabel($element);
705
             echo $this->formTextArea($element);
706
            ?>
707
      	  </div>
708
	 	  <div class="form-group">
709
        	 <?php
710
             $element = $form->get('status');
711
             $element->setAttributes(['class' => 'form-control']);
712
             $element->setOptions(['label' => 'LABEL_STATUS']);
713
 
714
             echo $this->formLabel($element);
1563 efrain 715
             echo $this->formCheckbox($element);
1561 efrain 716
            ?>
717
      	  </div>
1456 eleazar 718
 
1561 efrain 719
 
720
 
1455 eleazar 721
          <div class="form-group">
722
              <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE</button>
723
             <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
724
          </div>
1561 efrain 725
      <?php echo $this->form()->closeTag($form); ?>
1384 efrain 726
   </div>
727
</div>
728
<!-- Create/Edit Form-->
729
 
730
</section>