Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
16941 stevensc 1
<?php
1 www 2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
6
$routeAdd           = $this->url('jobs/add');
7
 
8
$routeDatatable   = $this->url('jobs');
9
 
10
$allowAdd = $acl->isAllowed($roleName, 'jobs/add') ? 1 : 0;
11
$allowDelete = $acl->isAllowed($roleName, 'jobs/delete') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'jobs/edit') ? 1 : 0;
13
$allowUsersWhoApplied = $acl->isAllowed($roleName, 'jobs/users-who-applied') ? 1 : 0;
14
 
16822 efrain 15
 
16
 
17
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
18
 
16841 efrain 19
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
16822 efrain 21
 
16841 efrain 22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
16822 efrain 23
 
24
 
16841 efrain 25
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
26
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
16822 efrain 27
 
16843 efrain 28
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
29
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
16841 efrain 30
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fas/theme.js'));
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.js'));
16822 efrain 34
 
35
 
36
 
16929 efrain 37
 
38
 
39
 
16843 efrain 40
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
41
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
16822 efrain 42
 
16843 efrain 43
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
44
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
45
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
46
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
16822 efrain 47
 
48
 
49
 
16841 efrain 50
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
16845 efrain 51
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
16841 efrain 52
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.min.js'));
16822 efrain 53
 
54
 
16841 efrain 55
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.min.js'));
16822 efrain 56
 
57
 
58
 
16841 efrain 59
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
60
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
11128 stevensc 61
 
16841 efrain 62
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
63
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
64
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
16822 efrain 65
 
66
 
11128 stevensc 67
$this->headStyle()->captureStart();
68
echo <<<CSS
69
 
16822 efrain 70
 
11128 stevensc 71
#gridTableUsersWhoApplied {
72
    display: flex;
73
    flex-flow: column;
74
    width: 100%;
75
}
76
 
77
#gridTableUsersWhoApplied thead {
78
    flex: 0 0 auto;
79
}
80
 
81
#gridTableUsersWhoApplied tbody {
82
    flex: 1 1 auto;
83
    display: block;
84
    overflow-y: auto;
85
    overflow-x: hidden;
86
}
87
 
88
#gridTableUsersWhoApplied tr {
89
    width: 100%;
90
    display: table;
91
    table-layout: fixed;
92
}
93
CSS;
94
$this->headStyle()->captureEnd();
95
 
16822 efrain 96
$this->inlineScript()->captureStart();
97
echo <<<JS
98
jQuery( document ).ready(function( $ ) {
99
       var route_status = '';
100
       var route_title =  '';
101
       var route_extended =  '';
102
       var route_location =  '';
103
       var route_job_category =  '';
104
       var route_employment_type =  '';
105
       var route_salary =  '';
106
       var route_experience = '';
107
       var route_languages =  '';
108
       var route_degrees = '';
109
       var route_skills =  '';
110
       var route_last_date_of_application =  '';
111
 
11139 stevensc 112
 
14162 stevensc 113
 
16822 efrain 114
        var allowDelete = $allowDelete;
115
        var allowEdit = $allowEdit;
116
        var allowUsersWhoApplied = $allowUsersWhoApplied;
117
 
118
        var gridTable = $('#gridTable').dataTable( {
119
            'processing': true,
120
            'serverSide': true,
121
            'searching': true,
122
            'order': [[ 0, 'desc' ]],
123
            'ordering':  true,
124
            'ordenable' : true,
125
            'responsive': true,
126
            'select' : false,
127
        	'paging': true,
128
            'pagingType': 'simple_numbers',
1 www 129
 
16822 efrain 130
    		'ajax': {
131
    			'url' : '$routeDatatable',
132
    			'type' : 'get',
133
                'beforeSend': function (request) {
134
                  NProgress.start();
135
                },
136
                'dataFilter': function(response) {
137
                    var response = jQuery.parseJSON( response );
138
 
139
                    var json                = {};
140
                    json.recordsTotal       = 0;
141
                    json.recordsFiltered    = 0;
142
                    json.data               = [];
143
 
144
                    if(response.success) {
145
                        json.recordsTotal       = response.data.total;
146
                        json.recordsFiltered    = response.data.total;
147
                        json.data               = response.data.items;
148
                    } else {
149
                        $.fn.showError(response.data)
150
                    }
151
 
152
                    return JSON.stringify( json );
153
                }
154
    		},
155
            'language' : {
156
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
157
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
158
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
159
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
160
                'sInfo':           'LABEL_DATATABLE_SINFO',
161
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
162
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
163
                'sInfoPostFix':    '',
164
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
165
                'sUrl':            '',
166
                'sInfoThousands':  ',',
167
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
168
                'oPaginate': {
169
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
170
                    'sLast':     'LABEL_DATATABLE_SLAST',
171
                    'sNext':     'LABEL_DATATABLE_SNEXT',
172
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
173
                },
174
                'oAria': {
175
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
176
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
177
                },
178
            },
179
            'drawCallback': function( settings ) {
180
                NProgress.done();
181
 
182
            },
183
            'aoColumns': [
184
                { 'mDataProp': 'last_date_of_application' },
185
                { 'mDataProp': 'title' },
186
                { 'mDataProp': 'details' },
187
                { 'mDataProp': 'actions' },
188
    	    ],
189
            'columnDefs': [
14162 stevensc 190
 
16822 efrain 191
                {
192
                    'targets': -2,
193
                    'orderable': false,
194
                    'render' : function ( data, type, row ) {
195
                        var s = 'LABEL_STATUS : ' + row['details']['status'] + '<br>';
196
                        s = s + 'LABEL_EMPLOYMENT_TYPE : <br>' + row['details']['employment_type'] + '<br>';
197
                        s = s +  'LABEL_QTY_USERS_WHO_APPLIED : ' + row['details']['users_who_applied'] + '<br>';
198
 
199
                        return s;
200
                    }
201
                },
202
 
203
                {
204
                    'targets': -1,
205
                    'orderable': false,
206
                    'render' : function ( data, type, row ) {
207
                        s = '';
208
 
209
                        if(allowEdit && data['link_edit']  ) {
16845 efrain 210
                            s = s + '<button class="btn btn-info btn-sm btn-edit" style="margin-top: 5px" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button><br>';
16822 efrain 211
                        }
212
                        if(allowDelete && data['link_delete']  ) {
213
                            s = s + '<button class="btn btn-danger btn-sm btn-delete" style="margin-top: 5px" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button><br>';
214
                        }
215
                        if(allowUsersWhoApplied && data['link_users_who_applied']  ) {
216
                            s = s + '<button class="btn btn-primary btn-sm btn-users-who-applied" style="margin-top: 5px" data-href="' + data['link_users_who_applied']+ '" data-toggle="tooltip" title="LABEL_USERS_WHO_APPLIED"><i class="fa fa-users"></i> LABEL_USERS_WHO_APPLIED </button><br>';
217
                        }
218
 
219
                        return s;
220
                    }
221
                }
222
              ],
223
        });
224
 
225
    $.validator.addMethod('greaterThanFloat', function (value, element, param) {
226
        var otherElement = $(param);
227
        return parseFloat(value) > parseFloat(otherElement.val());
228
    }, 'ERROR_INVALID_MINIMUM');
229
 
230
 
231
 
232
    $.validator.addMethod('greaterThan', function (value, element, param) {
233
        var otherElement = $(param);
234
        return parseInt(value, 10) > parseInt(otherElement.val(), 10);
235
    }, 'ERROR_INVALID_MINIMUM');
236
 
237
 
238
    $.validator.addMethod('checkLocation', function (value, element, param) {
239
        var otherElement = $(param);
240
 
241
        return $.trim(otherElement.val()).length > 0;
242
    }, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
243
 
244
    var autocompleteLocation = new google.maps.places.Autocomplete(
245
        (document.getElementById('location_search')),
246
        {types: ['(cities)']}
247
    );
248
 
249
    $.fn.fillInAddressLocation = function() {
250
 
251
        var place = autocompleteLocation.getPlace();
252
        if (!place.geometry) {
253
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
254
            return;
255
        } else {
256
            address1 = '';
257
            address2 = '';
258
            city1 = '';
259
            city2 = '';
260
            state = '';
261
            country = '';
262
            postal_code = '';
263
 
264
            formatted_address = place.formatted_address;
265
            latitude = place.geometry.location.lat();
266
            longitude = place.geometry.location.lng();
267
            var arrAddress = place.address_components;
268
 
269
            $.each(arrAddress, function(i, address_component) {
270
                if (address_component.types[0] == "route") {
271
                    address1 = address_component.long_name;
272
                }
273
                if (address_component.types[0] == "sublocality") {
274
                    address2 = address_component.long_name;
275
                }
276
                if (address_component.types[0] == "locality") {
277
                    city1 = address_component.long_name;
278
                }
279
                if (address_component.types[0] == "administrative_area_level_2") {
280
                    city2 = address_component.long_name;
281
                }
282
                if (address_component.types[0] == "administrative_area_level_1") {
283
                    state = address_component.long_name;
284
                }
285
                if (address_component.types[0] == "country") {
286
                    country = address_component.long_name;
287
                }
288
                if (address_component.types[0] == "postal_code") {
289
                    postal_code = address_component.long_name;
290
                }
291
            });
292
 
293
            $('#form-location #formatted_address').val(formatted_address);
294
            $('#form-location #address1').val(address1);
295
            $('#form-location #address2').val(address2);
296
            $('#form-location #city1').val(city1);
297
            $('#form-location #city2').val(city2);
298
            $('#form-location #state').val(state);
299
            $('#form-location #country').val(country);
300
            $('#form-location #postal_code').val(postal_code);
301
            $('#form-location #latitude').val(latitude);
302
            $('#form-location #longitude').val(longitude);
303
        }
304
    }
305
 
306
 
307
    var autocompleteLocationNew = new google.maps.places.Autocomplete(
308
        (document.getElementById('add_location_search')),
309
        {types: ['(cities)']}
310
    );
311
 
312
    $.fn.fillInAddressNewLocation = function() {
313
 
314
 
315
        var place = autocompleteLocationNew.getPlace();
316
        if (!place.geometry) {
317
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
318
            return;
319
        } else {
320
            address1 = '';
321
            address2 = '';
322
            city1 = '';
323
            city2 = '';
324
            state = '';
325
            country = '';
326
            postal_code = '';
327
 
328
            formatted_address = place.formatted_address;
329
            latitude = place.geometry.location.lat();
330
            longitude = place.geometry.location.lng();
331
            var arrAddress = place.address_components;
332
 
333
            $.each(arrAddress, function(i, address_component) {
334
                if (address_component.types[0] == "route") {
335
                    address1 = address_component.long_name;
336
                }
337
                if (address_component.types[0] == "sublocality") {
338
                    address2 = address_component.long_name;
339
                }
340
                if (address_component.types[0] == "locality") {
341
                    city1 = address_component.long_name;
342
                }
343
                if (address_component.types[0] == "administrative_area_level_2") {
344
                    city2 = address_component.long_name;
345
                }
346
                if (address_component.types[0] == "administrative_area_level_1") {
347
                    state = address_component.long_name;
348
                }
349
                if (address_component.types[0] == "country") {
350
                    country = address_component.long_name;
351
                }
352
                if (address_component.types[0] == "postal_code") {
353
                    postal_code = address_component.long_name;
354
                }
355
            });
356
 
357
            $('#form-add #formatted_address').val(formatted_address);
358
            $('#form-add #address1').val(address1);
359
            $('#form-add #address2').val(address2);
360
            $('#form-add #city1').val(city1);
361
            $('#form-add #city2').val(city2);
362
            $('#form-add #state').val(state);
363
            $('#form-add #country').val(country);
364
            $('#form-add #postal_code').val(postal_code);
365
            $('#form-add #latitude').val(latitude);
366
            $('#form-add #longitude').val(longitude);
367
        }
368
    }
369
 
370
 
371
    var validatorAdd = $('#form-add').validate({
372
        debug: true,
373
        onclick: false,
374
        onkeyup: false,
375
        onfocusout: false,
376
        ignore: [],
377
        rules: {
378
            'name': {
379
                required: true,
380
                maxlength: 128,
381
            },
382
            'title': {
383
                required: true,
384
            },
385
            'last_date_of_application': {
386
                required: true,
387
            },
388
            'job_category_id' :  {
389
                required: true,
390
            },
391
            'employment_type' : {
392
                required: true,
393
            },
394
            'add_location_search': {
395
                required: true,
396
                checkLocation: '#form-add #latitude'
397
            }
398
        },
399
        submitHandler: function(form)
400
        {
401
            NProgress.start();
402
            $.ajax({
403
                'dataType'  : 'json',
404
                'accept'    : 'application/json',
405
                'method'    : 'post',
406
                'url'       :  '$routeAdd',
407
                'data'      :  $('#form-add').serialize(),
408
            }).done(function(response) {
409
                if(response['success']) {
410
                    $('#add-job-box').modal('hide');
411
                    gridTable.api().ajax.reload(null, false);
412
 
413
                    $('#overview-title').html(response['data']['title']);
414
                    $('#overview-job-category').html(response['data']['job_category']);
415
					$('#overview-last-date-of-application').html(response['data']['last_date_of_application']);
416
					$('#overview-employment-type').html(response['data']['employment_type']);
417
                    $('#overview-location').html(response['data']['location']);
418
 
419
                    $('#overview-status').html(response['data']['status']);
420
                    $('#overview-description').html(response['data']['description']);
421
 
422
                    $('#overview-salary').html(response['data']['salary']);
423
                    $('#overview-experience').html('')
424
 
425
 
426
 
427
 
428
 
429
                    $('list-skills').empty();
430
                    $('list-languages').empty();
431
                    $('list-degrees').empty();
432
 
433
 
434
                    route_status = response['data']['route_status'];
435
                    route_title =  response['data']['route_title'];
436
                    route_extended =  response['data']['route_extended'];
437
                    route_location =  response['data']['route_location'];
438
                    route_job_category =  response['data']['route_job_category'];
439
                    route_employment_type =  response['data']['route_employment_type'];
440
                    route_salary =  response['data']['route_salary'];
441
                    route_experience = response['data']['route_experience'];
442
                    route_languages =  response['data']['route_languages'];
443
                    route_degrees = response['data']['route_degrees'];
444
                    route_skills =  response['data']['route_skills'];
445
                    route_last_date_of_application =  response['data']['route_last_date_of_application'];
446
 
447
                    $('#divListing').hide();
448
                    $('#divEdit').show();
449
 
450
                } else {
451
                    validatorAdd.resetForm();
452
                    if(jQuery.type(response['data']) == 'string') {
453
                        $.fn.showError(response['data']);
454
                    } else  {
455
                        $.each(response['data'], function( fieldname, errors ) {
456
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
457
                        });
458
                    }
459
                }
460
            }).fail(function( jqXHR, textStatus, errorThrown) {
461
                $.fn.showError(textStatus);
462
            }).always(function() {
463
                NProgress.done();
464
            });
465
            return false;
466
        },
467
        invalidHandler: function(form, validator) {
468
 
469
        }
470
    });
471
 
472
    $('body').on('click', 'button.btn-edit', function(e) {
473
        e.preventDefault();
474
 
475
        var href = $(this).data('href');
476
 
477
        NProgress.start();
478
            $.ajax({
479
                'dataType'  : 'json',
480
                'accept'    : 'application/json',
481
                'method'    : 'get',
482
                'url'       :  href,
483
            }).done(function(response) {
484
                if(response['success']) {
485
                    $('#add-job-box').modal('hide');
486
                    gridTable.api().ajax.reload(null, false);
487
 
488
                    $('#overview-title').html(response['data']['title']);
489
                    $('#overview-job-category').html(response['data']['job_category']);
490
					$('#overview-last-date-of-application').html(response['data']['last_date_of_application']);
491
					$('#overview-employment-type').html(response['data']['employment_type']);
492
                    $('#overview-location').html(response['data']['location']);
493
 
494
                    $('#overview-status').html(response['data']['status']);
495
                    $('#overview-description').html(response['data']['description']);
496
 
497
 
498
                    if(response['data']['salary']) {
499
					   $('#overview-salary').html(response['data']['salary']);
500
                    } else {
501
                       $('#overview-salary').html('')
502
                    }
503
 
504
                    if(response['data']['experience']) {
505
					   $('#overview-experience').html(response['data']['experience'] + ' LABEL_YEARS');
506
                    } else {
507
                       $('#overview-experience').html('')
508
                    }
509
 
510
 
511
 
512
                    $('#list-skills').empty();
513
                    $.each(response['data']['skills'], function(i, name) {
514
                        $('#list-skills').append('<li>' + name + '</li>');
515
                    });
516
 
517
                    $('#list-languages').empty();
518
                    $.each(response['data']['languages'], function(i, name) {
519
                        $('#list-languages').append('<li>' + name + '</li>');
520
                    });
521
 
522
                    $('#list-degrees').empty();
523
                    $.each(response['data']['degrees'], function(i, name) {
524
                        $('#list-degrees').append('<li>' + name + '</li>');
525
                    });
526
 
527
 
528
                    route_status =  response['data']['route_status'];
529
                    route_title =   response['data']['route_title'];
530
                    route_extended =   response['data']['route_extended'];
531
                    route_location =   response['data']['route_location'];
532
                    route_job_category =   response['data']['route_job_category'];
533
                    route_employment_type =   response['data']['route_employment_type'];
534
                    route_salary =   response['data']['route_salary'];
535
                    route_experience =  response['data']['route_experience'];
536
                    route_languages =   response['data']['route_languages'];
537
                    route_degrees =  response['data']['route_degrees'];
538
                    route_skills =   response['data']['route_skills'];
539
                    route_last_date_of_application =   response['data']['route_last_date_of_application'];
540
 
541
 
542
                    $('#divListing').hide();
543
                    $('#divEdit').show();
544
 
545
                } else {
546
                    validatorAdd.resetForm();
547
                    if(jQuery.type(response['data']) == 'string') {
548
                        $.fn.showError(response['data']);
549
                    } else  {
550
                        $.each(response['data'], function( fieldname, errors ) {
551
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
552
                        });
553
                    }
554
                }
555
            }).fail(function( jqXHR, textStatus, errorThrown) {
556
                $.fn.showError(textStatus);
557
            }).always(function() {
558
                NProgress.done();
559
            });
560
            return false;
561
    });
562
 
563
 
564
 
16944 efrain 565
    $(".close-box, .btn-add-job-cancel, .btn-users-who-applied-cancel").on("click", function(e){
16822 efrain 566
        e.preventDefault();
567
        $('#add-job-box').modal('hide');
16944 efrain 568
        $('#modalUsersWhoApplied').modal('hide');
16822 efrain 569
        return false;
570
    });
571
 
16944 efrain 572
 
573
 
16822 efrain 574
    $('body').on('click', 'button.btn-add', function(e) {
575
        e.preventDefault();
576
 
577
 
578
        $('#form-add #title').val('');
579
        $('#form-add #last_date_of_application').val('');
580
        $('#form-add #employment_type').val('').trigger('change');
581
        $('#form-add #job_category_id').val('').trigger('change');
582
        $('#form-add #formatted_address').val('');
583
        $('#form-add #address1').val('');
584
        $('#form-add #address2').val('');
585
        $('#form-add #country').val('');
586
        $('#form-add #state').val('');
587
        $('#form-add #city1').val('');
588
        $('#form-add #city2').val('');
589
        $('#form-add #postal_code').val('');
590
        $('#form-add #latitude').val('');
591
        $('#form-add #longitude').val('');
592
        $('#form-add #add_location_search').val('');
593
        validatorAdd.resetForm();
594
 
595
        $('#add-job-box').modal('show');
596
        return false;
597
    });
598
 
599
    $('#form-add #last_date_of_application').datetimepicker({
600
        //viewMode: 'years',
601
        locale: 'es',
16943 efrain 602
        format: 'YYYY-MM-DD'
16822 efrain 603
    });
604
 
605
 
606
    $('body').on('click', 'button.btn-view-profile', function(e) {
607
        e.preventDefault();
608
 
609
        var href = $(this).data('href');
610
        window.open(href, '_blank');
611
 
612
    });
613
 
614
    $('body').on('click', 'button.btn-users-who-applied', function(e) {
615
        e.preventDefault();
616
 
617
        var href = $(this).data('href');
618
        NProgress.start();
619
        $.ajax({
620
            'dataType'  : 'json',
621
            'accept'    : 'application/json',
622
            'method'    : 'get',
623
            'url'       :  href
624
        }).done(function(response) {
625
            if(response['success']) {
626
                $('#gridTableUsersWhoApplied tbody').empty();
627
                $.each(response['data'], function(i, record) {
628
                    var s = '<tr>';
629
                    s = s + '<td>' + record['first_name'] + '</td>';
630
                    s = s + '<td>' + record['last_name'] + '</td>';
631
                    s = s + '<td>' + record['email'] + '</td>';
16932 efrain 632
                    s = s + '<td><button class="btn btn-default btn-view-profile" data-href="' + record['link_view']+ '"><i class="fa fa-external-link-alt"></i></button></td>';
16822 efrain 633
                    s = s + '<tr>';
634
 
635
                    $('#gridTableUsersWhoApplied tbody').append(s);
636
 
637
                });
638
 
639
 
640
                $('#modalUsersWhoApplied').modal('show');
641
            } else {
642
                $.fn.showError(response['data']);
643
 
644
            }
645
        }).fail(function( jqXHR, textStatus, errorThrown) {
646
            $.fn.showError(textStatus);
647
        }).always(function() {
648
            NProgress.done();
649
        });
650
        return false;
651
 
652
    });
653
 
654
 var validatorLocation = $('#form-location').validate({
655
        debug: true,
656
        onclick: false,
657
        onkeyup: false,
658
        onfocusout: false,
659
        ignore: [],
660
        rules: {
661
            'location_search': {
662
                required: true,
663
                checkLocation: '#form-location #latitude'
664
            }
665
        },
666
        submitHandler: function(form)
667
        {
668
            NProgress.start();
669
            $.ajax({
670
                'dataType'  : 'json',
671
                'accept'    : 'application/json',
672
                'method'    : 'post',
673
                'url'       :  route_location,
674
                'data'      :  $('#form-location').serialize(),
675
            }).done(function(response) {
676
 
677
 
678
 
679
                if(response['success']) {
680
                    $('#overview-location').html(response.data);
681
                    $("#location-box").modal('hide');
682
                } else {
683
                    validatorLocation.resetForm();
684
                    $.fn.showError(response['data']);
685
                }
686
            }).fail(function( jqXHR, textStatus, errorThrown) {
687
                $.fn.showError(textStatus);
688
            }).always(function() {
689
                NProgress.done();
690
            });
691
            return false;
692
        },
693
        invalidHandler: function(form, validator) {
694
 
695
        }
696
    });
697
 
698
 
699
    $('body').on('click', 'a.btn-location-edit', function(e) {
700
        e.preventDefault();
701
 
702
        $('#form-location #location_search').val('');
703
        $('#form-location #formatted_address').val('');
704
        $('#form-location #address1').val('');
705
        $('#form-location #address2').val('');
706
        $('#form-location #country').val('');
707
        $('#form-location #state').val('');
708
        $('#form-location #city1').val('');
709
        $('#form-location #city2').val('');
710
        $('#form-location #postal_code').val('');
711
        $('#form-location #latitude').val('');
712
        $('#form-location #longitude').val('');
713
        validatorLocation.resetForm();
714
 
715
        $("#location-box").modal('show');
716
    });
717
 
718
    $('.btn-location-close').on("click", function(e){
719
        e.preventDefault();
720
 
721
        $("#location-box").modal('hide');
722
        return false;
723
    });
724
 
725
 
726
 
727
 
728
    var validatorLastDateOfApplication = $('#form-last-date-of-application').validate({
729
        debug: true,
730
        onclick: false,
731
        onkeyup: false,
732
        onfocusout: false,
733
        ignore: [],
734
        rules: {
735
            'last_date_of_application': {
736
                required: true,
737
            },
738
        },
739
 
740
        submitHandler: function(form)
741
        {
742
            NProgress.start();
743
            $.ajax({
744
                'dataType'  : 'json',
745
                'accept'    : 'application/json',
746
                'method'    : 'post',
747
                'url'       :  route_last_date_of_application,
748
                'data'      :  $('#form-last-date-of-application').serialize()
749
            }).done(function(response) {
750
                if(response['success']) {
751
 
752
                    $('#overview-last-date-of-application').html(response['data']);
753
                    $("#last-date-of-application-box").modal('hide');
754
                } else {
755
                    validatorLastDateOfApplication.resetForm();
756
                    if(jQuery.type(response['data']) == 'string') {
757
                        $.fn.showError(response['data']);
758
                    } else  {
759
                        $.each(response['data'], function( fieldname, errors ) {
760
                            $.fn.showFormErrorValidator('#form-last-date-of-application #' + fieldname, errors);
761
                        });
762
                    }
763
                }
764
            }).fail(function( jqXHR, textStatus, errorThrown) {
765
                $.fn.showError(textStatus);
766
            }).always(function() {
767
                NProgress.done();
768
            });
769
            return false;
770
        },
771
        invalidHandler: function(form, validator) {
772
 
773
        }
774
    });
775
 
776
 
777
    $('.btn-last-date-of-application-edit').on("click", function(e){
778
        e.preventDefault();
779
 
780
        NProgress.start();
781
        $.ajax({
782
            'dataType'  : 'json',
783
            'accept'    : 'application/json',
784
            'method'    : 'get',
785
            'url'       : route_last_date_of_application,
786
        }).done(function(response) {
787
           if(response['success']) {
788
                $('#form-last-date-of-application #last_date_of_application').val(response['data']);
789
                validatorLastDateOfApplication.resetForm();
790
 
791
                $("#last-date-of-application-box").modal('show');
792
            } else {
793
                $.fn.showError(response['data']);
794
            }
795
        }).fail(function( jqXHR, textStatus, errorThrown) {
796
            $.fn.showError(textStatus);
797
        }).always(function() {
798
            NProgress.done();
799
        });
800
        return false;
801
 
802
    });
803
 
804
    $('.btn-last-date-of-application-close').on("click", function(e){
805
        e.preventDefault();
806
 
807
        $("#last-date-of-application-box").modal('hide');
808
        return false;
809
    });
810
 
811
 
812
    var validatorExtended = $('#form-extended').validate({
813
        debug: true,
814
        onclick: false,
815
        onkeyup: false,
816
        onfocusout: false,
817
        ignore: [],
818
        rules: {
819
            'description': {
820
                updateCkeditor:function() {
821
                        CKEDITOR.instances.description.updateElement();
822
                },
823
                required: false,
824
            },
825
        },
826
 
827
        submitHandler: function(form)
828
        {
829
            NProgress.start();
830
            $.ajax({
831
                'dataType'  : 'json',
832
                'accept'    : 'application/json',
833
                'method'    : 'post',
834
                'url'       :  route_extended,
835
                'data'      :  $('#form-extended').serialize()
836
            }).done(function(response) {
837
                if(response['success']) {
838
 
839
                    $('#overview-description').html(response['data']['description']);
840
                    $("#extended-box").modal('hide');
841
                } else {
842
                    validatorExtended.resetForm();
843
                    if(jQuery.type(response['data']) == 'string') {
844
                        $.fn.showError(response['data']);
845
                    } else  {
846
                        $.each(response['data'], function( fieldname, errors ) {
847
                            $.fn.showFormErrorValidator('#form-extended #' + fieldname, errors);
848
                        });
849
                    }
850
                }
851
            }).fail(function( jqXHR, textStatus, errorThrown) {
852
                $.fn.showError(textStatus);
853
            }).always(function() {
854
                NProgress.done();
855
            });
856
            return false;
857
        },
858
        invalidHandler: function(form, validator) {
859
 
860
        }
861
    });
862
 
863
 
864
    $('.btn-extended-edit').on("click", function(e){
865
        e.preventDefault();
866
 
867
        NProgress.start();
868
        $.ajax({
869
            'dataType'  : 'json',
870
            'accept'    : 'application/json',
871
            'method'    : 'get',
872
            'url'       : route_extended,
873
        }).done(function(response) {
874
           if(response['success']) {
875
                CKEDITOR.instances.description.setData(response['data']['description']);
876
                validatorExtended.resetForm();
877
 
878
                $("#extended-box").modal('show');
879
            } else {
880
                $.fn.showError(response['data']);
881
            }
882
        }).fail(function( jqXHR, textStatus, errorThrown) {
883
            $.fn.showError(textStatus);
884
        }).always(function() {
885
            NProgress.done();
886
        });
887
        return false;
888
 
889
    });
890
 
891
    $('.btn-extended-close').on("click", function(e){
892
        e.preventDefault();
893
 
894
        $("#extended-box").modal('hide');
895
        return false;
896
    });
897
 
898
 
899
    var validatorJobCategory = $('#form-job-category').validate({
900
        debug: true,
901
        onclick: false,
902
        onkeyup: false,
903
        ignore: [],
904
        rules: {
905
            'job-category_id': {
906
                required: false,
907
                digits: true
908
            },
909
        },
910
        submitHandler: function(form)
911
        {
912
            NProgress.start();
913
            $.ajax({
914
                'dataType'  : 'json',
915
                'accept'    : 'application/json',
916
                'method'    : 'post',
917
                'url'       :  route_job_category,
918
                'data'      :  $('#form-job-category').serialize()
919
            }).done(function(response) {
920
                if(response['success']) {
921
					$('#overview-job-category').html(response['data']);
922
                    $("#job-category-box").modal('hide');
923
                } else {
924
                    validatorJobCategory.resetForm();
925
                    if(jQuery.type(response['data']) == 'string') {
926
                        $.fn.showError(response['data']);
927
                    } else  {
928
                        $.each(response['data'], function( fieldname, errors ) {
929
                            $.fn.showFormErrorValidator('#form-job-category #' + fieldname, errors);
930
                        });
931
                    }
932
                }
933
            }).fail(function( jqXHR, textStatus, errorThrown) {
934
                $.fn.showError(textStatus);
935
            }).always(function() {
936
                NProgress.done();
937
            });
938
            return false;
939
        },
940
        invalidHandler: function(form, validator) {
941
 
942
        }
943
    });
944
 
945
    $('.btn-job-category-edit').on("click", function(e){
946
        e.preventDefault();
947
 
948
        NProgress.start();
949
        $.ajax({
950
            'dataType'  : 'json',
951
            'accept'    : 'application/json',
952
            'method'    : 'get',
953
            'url'       : route_job_category,
954
        }).done(function(response) {
955
           if(response['success']) {
16845 efrain 956
                $('#form-job-category #job_category_id').val(response['data']['job_category']).trigger('change');
16822 efrain 957
                validatorJobCategory.resetForm();
958
                $("#job-category-box").modal('show');
959
            } else {
960
                $.fn.showError(response['data']);
961
            }
962
        }).fail(function( jqXHR, textStatus, errorThrown) {
963
            $.fn.showError(textStatus);
964
        }).always(function() {
965
            NProgress.done();
966
        });
967
        return false;
968
 
969
    });
970
 
971
    $('.btn-job-category-close').on("click", function(e){
972
        e.preventDefault();
973
 
974
        $("#job-category-box").modal('hide');
975
        return false;
976
    });
977
 
978
 
979
 
980
    var validatorEmploymentType = $('#form-employment-type').validate({
981
        debug: true,
982
        onclick: false,
983
        onkeyup: false,
984
        ignore: [],
985
        rules: {
986
            'employment_type': {
987
                required: false,
988
            },
989
        },
990
        submitHandler: function(form)
991
        {
992
            NProgress.start();
993
            $.ajax({
994
                'dataType'  : 'json',
995
                'accept'    : 'application/json',
996
                'method'    : 'post',
997
                'url'       :  route_employment_type,
998
                'data'      :  $('#form-employment-type').serialize()
999
            }).done(function(response) {
1000
                if(response['success']) {
1001
					$('#overview-employment-type').html(response['data']);
1002
                    $("#employment-type-box").modal('hide');
1003
                } else {
1004
                    validatorEmploymentType.resetForm();
1005
                    if(jQuery.type(response['data']) == 'string') {
1006
                        $.fn.showError(response['data']);
1007
                    } else  {
1008
                        $.each(response['data'], function( fieldname, errors ) {
1009
                            $.fn.showFormErrorValidator('#form-employment-type #' + fieldname, errors);
1010
                        });
1011
                    }
1012
                }
1013
            }).fail(function( jqXHR, textStatus, errorThrown) {
1014
                $.fn.showError(textStatus);
1015
            }).always(function() {
1016
                NProgress.done();
1017
            });
1018
            return false;
1019
        },
1020
        invalidHandler: function(form, validator) {
1021
 
1022
        }
1023
    });
1024
 
1025
    $('.btn-employment-type-edit').on("click", function(e){
1026
        e.preventDefault();
1027
 
1028
        NProgress.start();
1029
        $.ajax({
1030
            'dataType'  : 'json',
1031
            'accept'    : 'application/json',
1032
            'method'    : 'get',
1033
            'url'       : route_employment_type,
1034
        }).done(function(response) {
1035
           if(response['success']) {
1036
                $('#form-employment-type #employment_type').val(response['data']).trigger('change');
1037
                validatorEmploymentType.resetForm();
1038
                $("#employment-type-box").modal('show');
1039
            } else {
1040
                $.fn.showError(response['data']);
1041
            }
1042
        }).fail(function( jqXHR, textStatus, errorThrown) {
1043
            $.fn.showError(textStatus);
1044
        }).always(function() {
1045
            NProgress.done();
1046
        });
1047
        return false;
1048
 
1049
    });
1050
 
1051
    $('.btn-employment-type-close').on("click", function(e){
1052
        e.preventDefault();
1053
 
1054
        $("#employment-type-box").modal('hide');
1055
        return false;
1056
    });
1057
 
1058
    var validatorSalary = $('#form-salary').validate({
1059
        debug: true,
1060
        onclick: false,
1061
        onkeyup: false,
1062
        ignore: [],
1063
        rules: {
1064
            'salary_visible': {
1065
                required: false,
1066
            },
1067
            'salary_min': {
1068
                required:  '#form-salary #salary_visible:checked',
1069
                number: true,
1070
                maxlength: 10,
1071
            },
1072
            'salary currency': {
1073
                required:  '#form-salary #salary_visible:checked',
1074
                maxlength: 5,
1075
            },
1076
            'salary_max': {
1077
                required:  '#form-salary #salary_visible:checked',
1078
                number: true,
1079
                maxlength: 10,
1080
                greaterThanFloat : '#form-salary #salary_min',
1081
            },
1082
        },
1083
        submitHandler: function(form)
1084
        {
1085
            NProgress.start();
1086
            $.ajax({
1087
                'dataType'  : 'json',
1088
                'accept'    : 'application/json',
1089
                'method'    : 'post',
1090
                'url'       :  route_salary,
1091
                'data'      :  $('#form-salary').serialize()
1092
            }).done(function(response) {
1093
                if(response['success']) {
1094
					$('#overview-salary').html(response['data']);
1095
                    $("#salary-box").modal('hide');
1096
                } else {
1097
                    validatorSalary.resetForm();
1098
                    if(jQuery.type(response['data']) == 'string') {
1099
                        $.fn.showError(response['data']);
1100
                    } else  {
1101
                        $.each(response['data'], function( fieldname, errors ) {
1102
                            $.fn.showFormErrorValidator('#form-salary #' + fieldname, errors);
1103
                        });
1104
                    }
1105
                }
1106
            }).fail(function( jqXHR, textStatus, errorThrown) {
1107
                $.fn.showError(textStatus);
1108
            }).always(function() {
1109
                NProgress.done();
1110
            });
1111
            return false;
1112
        },
1113
        invalidHandler: function(form, validator) {
1114
 
1115
        }
1116
    });
1117
 
1118
    $('.btn-salary-edit').on("click", function(e){
1119
        e.preventDefault();
1120
 
1121
        NProgress.start();
1122
        $.ajax({
1123
            'dataType'  : 'json',
1124
            'accept'    : 'application/json',
1125
            'method'    : 'get',
1126
            'url'       : route_salary,
1127
        }).done(function(response) {
1128
           if(response['success']) {
1129
                if(response['data']['salary_visible'] == 'y') {
1130
                    $('#form-salary #salary_visible').bootstrapToggle('on')
1131
                    $('#form-salary #salary_min').val(response['data']['salary_min']);
1132
                    $('#form-salary #salary_min').prop('readonly', false);
1133
                    $('#form-salary #salary_max').val(response['data']['salary_max']);
1134
                    $('#form-salary #salary_max').prop('readonly', false);
1135
                    $('#form-salary #salary_currency').val(response['data']['salary_currency']);
1136
                    $('#form-salary #salary_currency').prop('disable',false);
1137
                } else {
1138
                    $('#form-salary #salary_visible').bootstrapToggle('off')
1139
                    $('#form-salary #salary_min').val('1');
1140
                    $('#form-salary #salary_min').prop('readonly', true);
1141
                    $('#form-salary #salary_max').val('99');
1142
                    $('#form-salary #salary_max').prop('readonly', true);
1143
                    $('#form-salary #salary_currency').val('USD');
1144
                    $('#form-salary #salary_currency').prop('disable',true);
1145
                }
1146
                validatorSalary.resetForm();
1147
                $("#salary-box").modal('show');
1148
            } else {
1149
                $.fn.showError(response['data']);
1150
            }
1151
        }).fail(function( jqXHR, textStatus, errorThrown) {
1152
            $.fn.showError(textStatus);
1153
        }).always(function() {
1154
            NProgress.done();
1155
        });
1156
        return false;
1157
 
1158
    });
1159
 
1160
    $('.btn-salary-close').on("click", function(e){
1161
        e.preventDefault();
1162
 
1163
        $("#salary-box").modal('hide');
1164
        return false;
1165
    });
1166
 
1167
    var validatorExperience = $('#form-experience').validate({
1168
        debug: true,
1169
        onclick: false,
1170
        onkeyup: false,
1171
        ignore: [],
1172
        rules: {
1173
            'experience_visible': {
1174
                required: false,
1175
            },
1176
            'experience_min': {
1177
                required:  '#form-experience #experience_visible:checked',
1178
                digits: true,
1179
                maxlength: 2,
1180
            },
1181
            'experience_max': {
1182
                required:  '#form-experience #experience_visible:checked',
1183
                digits: true,
1184
                maxlength: 4,
1185
                greaterThan : '#form-experience #experience_min',
1186
            },
1187
        },
1188
        submitHandler: function(form)
1189
        {
1190
            NProgress.start();
1191
            $.ajax({
1192
                'dataType'  : 'json',
1193
                'accept'    : 'application/json',
1194
                'method'    : 'post',
1195
                'url'       :  route_experience,
1196
                'data'      :  $('#form-experience').serialize()
1197
            }).done(function(response) {
1198
                if(response['success']) {
1199
					$('#overview-experience').html(response['data']);
1200
                    $("#experience-box").modal('hide');
1201
                } else {
1202
                    validatorExperience.resetForm();
1203
                    if(jQuery.type(response['data']) == 'string') {
1204
                        $.fn.showError(response['data']);
1205
                    } else  {
1206
                        $.each(response['data'], function( fieldname, errors ) {
1207
                            $.fn.showFormErrorValidator('#form-experience #' + fieldname, errors);
1208
                        });
1209
                    }
1210
                }
1211
            }).fail(function( jqXHR, textStatus, errorThrown) {
1212
                $.fn.showError(textStatus);
1213
            }).always(function() {
1214
                NProgress.done();
1215
            });
1216
            return false;
1217
        },
1218
        invalidHandler: function(form, validator) {
1219
 
1220
        }
1221
    });
1222
 
1223
    $('.btn-experience-edit').on("click", function(e){
1224
        e.preventDefault();
1225
 
1226
        NProgress.start();
1227
        $.ajax({
1228
            'dataType'  : 'json',
1229
            'accept'    : 'application/json',
1230
            'method'    : 'get',
1231
            'url'       : route_experience,
1232
        }).done(function(response) {
1233
           if(response['success']) {
1234
                if(response['data']['experience_visible'] == 'y') {
1235
                    $('#form-experience #experience_visible').bootstrapToggle('on')
1236
                    $('#form-experience #experience_min').val(response['data']['experience_min']);
1237
                    $('#form-experience #experience_min').prop('readonly', false);
1238
                    $('#form-experience #experience_max').val(response['data']['experience_max']);
1239
                    $('#form-experience #experience_max').prop('readonly', false);
1240
                } else {
1241
                    $('#form-experience #experience_visible').bootstrapToggle('off')
1242
                    $('#form-experience #experience_min').val('1');
1243
                    $('#form-experience #experience_min').prop('readonly', true);
1244
                    $('#form-experience #experience_max').val('5');
1245
                    $('#form-experience #experience_max').prop('readonly', true);
1246
                }
1247
 
1248
                validatorExperience.resetForm();
1249
                $("#experience-box").modal('show');
1250
            } else {
1251
                $.fn.showError(response['data']);
1252
            }
1253
        }).fail(function( jqXHR, textStatus, errorThrown) {
1254
            $.fn.showError(textStatus);
1255
        }).always(function() {
1256
            NProgress.done();
1257
        });
1258
        return false;
1259
 
1260
    });
1261
 
1262
    $('.btn-experience-close').on("click", function(e){
1263
        e.preventDefault();
1264
 
1265
        $("#experience-box").modal('hide');
1266
        return false;
1267
    });
1268
 
1269
 
1270
    $('.btn-skills-edit').on("click", function(e){
1271
        e.preventDefault();
1272
 
1273
        NProgress.start();
1274
        $.ajax({
1275
            'dataType'  : 'json',
1276
            'accept'    : 'application/json',
1277
            'method'    : 'get',
1278
            'url'       : route_skills,
1279
        }).done(function(response) {
1280
           if(response['success']) {
16845 efrain 1281
 
1282
                $('#form-skill #skills').val(response['data']['skills_selected']).trigger('change');
16822 efrain 1283
                validatorSkills.resetForm();
1284
 
1285
                $('#skills-box').modal('show');
1286
            } else {
1287
                $.fn.showError(response['data']);
1288
            }
1289
        }).fail(function( jqXHR, textStatus, errorThrown) {
1290
            $.fn.showError(textStatus);
1291
        }).always(function() {
1292
            NProgress.done();
1293
        });
1294
        return false;
1295
 
1296
    });
1297
 
1298
    $('.btn-skills-close').on("click", function(e){
1299
        e.preventDefault();
1300
 
1301
        $('#skills-box').modal('hide');
1302
        return false;
1303
    });
1304
 
1305
    var validatorSkills = $('#form-skill').validate({
1306
        debug: true,
1307
        onclick: false,
1308
        onkeyup: false,
1309
         onfocusout: false,
1310
        ignore: [],
1311
        rules: {
1312
            'skills[]': {
1313
                required: true,
1314
            }
1315
        },
1316
        submitHandler: function(form)
1317
        {
1318
            NProgress.start();
1319
            $.ajax({
1320
                'dataType'  : 'json',
1321
                'accept'    : 'application/json',
1322
                'method'    : 'post',
1323
                'url'       :  route_skills,
1324
                'data'      :  {
1325
                    'skills[]' : $('#form-skill #skills').val()
1326
                },
1327
            }).done(function(response) {
1328
                if(response['success']) {
1329
 
1330
					$('#list-skills').empty();
1331
                    $.each(response['data'], function(index, item) {
1332
                        $('#list-skills').append('<li><a href="#" title="">' + item.label + '</a></li>');
1333
                    });
1334
 
1335
                    $("#skills-box").modal('hide');
1336
                } else {
1337
                    validatorSkills.resetForm();
1338
                    if(jQuery.type(response['data']) == 'string') {
1339
                        $.fn.showError(response['data']);
1340
                    } else  {
1341
                        $.each(response['data'], function( fieldname, errors ) {
1342
                            $.fn.showFormErrorValidator('#form-skill #' + fieldname, errors);
1343
                        });
1344
                    }
1345
                }
1346
            }).fail(function( jqXHR, textStatus, errorThrown) {
1347
                $.fn.showError(textStatus);
1348
            }).always(function() {
1349
                NProgress.done();
1350
            });
1351
            return false;
1352
        },
1353
        invalidHandler: function(form, validator) {
1354
 
1355
        }
1356
    });
1357
 
1358
 
1359
 
1360
    var validatorLanguages = $('#form-language').validate({
1361
        debug: true,
1362
        onclick: false,
1363
        onkeyup: false,
1364
         onfocusout: false,
1365
        ignore: [],
1366
        rules: {
1367
            'languages[]': {
1368
                required: true,
1369
            }
1370
        },
1371
        submitHandler: function(form)
1372
        {
1373
            NProgress.start();
1374
            $.ajax({
1375
                'dataType'  : 'json',
1376
                'accept'    : 'application/json',
1377
                'method'    : 'post',
1378
                'url'       :  route_languages,
1379
                'data'      :  {
1380
                    'languages[]' : $('#form-language #languages').val()
1381
                },
1382
            }).done(function(response) {
1383
                if(response['success']) {
1384
 
1385
					$('#list-languages').empty();
1386
                    $.each(response['data'], function(index, item) {
1387
                        $('#list-languages').append('<li><a href="#" title="">' + item.label + '</a></li>');
1388
                    });
1389
 
1390
                    $("#languages-box").modal('hide');
1391
                } else {
1392
                    validatorLanguages.resetForm();
1393
                    if(jQuery.type(response['data']) == 'string') {
1394
                        $.fn.showError(response['data']);
1395
                    } else  {
1396
                        $.each(response['data'], function( fieldname, errors ) {
1397
                            $.fn.showFormErrorValidator('#form-language #' + fieldname, errors);
1398
                        });
1399
                    }
1400
                }
1401
            }).fail(function( jqXHR, textStatus, errorThrown) {
1402
                $.fn.showError(textStatus);
1403
            }).always(function() {
1404
                NProgress.done();
1405
            });
1406
            return false;
1407
        },
1408
        invalidHandler: function(form, validator) {
1409
 
1410
        }
1411
    });
1412
 
1413
    $('.btn-languages-edit').on("click", function(e){
1414
        e.preventDefault();
1415
 
1416
        NProgress.start();
1417
        $.ajax({
1418
            'dataType'  : 'json',
1419
            'accept'    : 'application/json',
1420
            'method'    : 'get',
1421
            'url'       : route_languages,
1422
        }).done(function(response) {
1423
           if(response['success']) {
16845 efrain 1424
                $('#form-language #languages').val(response['data']['languages_selected']).trigger('change');
16822 efrain 1425
                validatorLanguages.resetForm();
1426
 
1427
                $("#languages-box").modal('show');
1428
            } else {
1429
                $.fn.showError(response['data']);
1430
            }
1431
        }).fail(function( jqXHR, textStatus, errorThrown) {
1432
            $.fn.showError(textStatus);
1433
        }).always(function() {
1434
            NProgress.done();
1435
        });
1436
        return false;
1437
 
1438
    });
1439
 
1440
    $('.btn-languages-close').on("click", function(e){
1441
        e.preventDefault();
1442
 
1443
        $("#languages-box").modal('hide');
1444
        return false;
1445
    });
1446
 
1447
 
1448
    var validatorDegrees = $('#form-degree').validate({
1449
        debug: true,
1450
        onclick: false,
1451
        onkeyup: false,
1452
         onfocusout: false,
1453
        ignore: [],
1454
        rules: {
1455
            'degrees[]': {
1456
                required: true,
1457
            }
1458
        },
1459
        submitHandler: function(form)
1460
        {
1461
            NProgress.start();
1462
            $.ajax({
1463
                'dataType'  : 'json',
1464
                'accept'    : 'application/json',
1465
                'method'    : 'post',
1466
                'url'       :  route_degrees,
1467
                'data'      :  {
1468
                    'degrees[]' : $('#form-degree #degrees').val()
1469
                },
1470
            }).done(function(response) {
1471
                if(response['success']) {
1472
 
1473
					$('#list-degrees').empty();
1474
                    $.each(response['data'], function(index, item) {
1475
                        $('#list-degrees').append('<li><a href="#" title="">' + item.label + '</a></li>');
1476
                    });
1477
 
1478
                    $("#degrees-box").modal('hide');
1479
                } else {
1480
                    validatorDegrees.resetForm();
1481
                    if(jQuery.type(response['data']) == 'string') {
1482
                        $.fn.showError(response['data']);
1483
                    } else  {
1484
                        $.each(response['data'], function( fieldname, errors ) {
1485
                            $.fn.showFormErrorValidator('#form-degree #' + fieldname, errors);
1486
                        });
1487
                    }
1488
                }
1489
            }).fail(function( jqXHR, textStatus, errorThrown) {
1490
                $.fn.showError(textStatus);
1491
            }).always(function() {
1492
                NProgress.done();
1493
            });
1494
            return false;
1495
        },
1496
        invalidHandler: function(form, validator) {
1497
 
1498
        }
1499
    });
1500
 
1501
    $('.btn-degrees-edit').on("click", function(e){
1502
        e.preventDefault();
1503
 
1504
        NProgress.start();
1505
        $.ajax({
1506
            'dataType'  : 'json',
1507
            'accept'    : 'application/json',
1508
            'method'    : 'get',
1509
            'url'       : route_degrees,
1510
        }).done(function(response) {
1511
           if(response['success']) {
16845 efrain 1512
                $('#form-degree #degrees').val(response['data']['degrees_selected']).trigger('change');
16822 efrain 1513
                validatorDegrees.resetForm();
1514
 
1515
                $("#degrees-box").modal('show');
1516
            } else {
1517
                $.fn.showError(response['data']);
1518
            }
1519
        }).fail(function( jqXHR, textStatus, errorThrown) {
1520
            $.fn.showError(textStatus);
1521
        }).always(function() {
1522
            NProgress.done();
1523
        });
1524
        return false;
1525
 
1526
    });
1527
 
1528
    $('.btn-degrees-close').on("click", function(e){
1529
        e.preventDefault();
1530
 
1531
        $("#degrees-box").modal('hide');
1532
        return false;
1533
    });
1534
 
1535
 
1536
    $('#form-degree #degrees').select2({
16845 efrain 1537
        theme: 'bootstrap-5',
16822 efrain 1538
        width: '100%',
16941 stevensc 1539
        placeholder: 'LABEL_SELECT_DEGREE',
1540
        dropdownParent: $('#degrees-box')
16822 efrain 1541
    });
1542
 
1543
    $('#form-skill #skills').select2({
16845 efrain 1544
        theme: 'bootstrap-5',
16822 efrain 1545
        width: '100%',
1546
        placeholder: 'LABEL_SELECT_ONE_SKILLS'
1547
    });
1548
 
1549
    $('#form-language #languages').select2({
16845 efrain 1550
        theme: 'bootstrap-5',
16822 efrain 1551
        width: '100%',
16941 stevensc 1552
        placeholder: 'LABEL_SELECT_ONE_LANGUAGE',
1553
        dropdownParent: $('#languages-box'),
16822 efrain 1554
    });
1555
 
1556
 
1557
 
1558
    $('#form-last-date-of-application #last_date_of_application').datetimepicker({
1559
        locale: 'es',
16943 efrain 1560
        format: 'YYYY-MM-DD'
16822 efrain 1561
    });
1562
 
1563
    $('#form-salary #salary_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1564
    $('#form-salary #salary_min').inputNumberFormat({ 'decimal': 2 });
1565
    $('#form-salary #salary_max').inputNumberFormat({ 'decimal': 2 });
1566
 
1567
    $('#form-salary #salary_visible').change(function(e) {
1568
        e.preventDefault();
1569
 
1570
        if($(this).prop('checked')) {
1571
            $('#form-salary #salary_min').prop('readonly', false);
1572
            $('#form-salary #salary_max').prop('readonly', false);
1573
            $('#form-salary #salary_currency').prop('disabled', false);
1574
        } else {
1575
            $('#form-salary #salary_min').val('1');
1576
            $('#form-salary #salary_max').val('99');
1577
            $('#form-salary #salary_min').prop('readonly', true);
1578
            $('#form-salary #salary_max').prop('readonly', true);
1579
            $('#form-salary #salary_currency').prop('disabled', true);
1580
        }
1581
    });
1582
 
1583
    $('#form-experience #experience_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1584
    $('#form-experience #experience_min').inputNumberFormat({ 'decimal': 0 });
1585
    $('#form-experience #experience_max').inputNumberFormat({ 'decimal': 0 });
1586
 
1587
    $('#form-experience #experience_visible').change(function(e) {
1588
        e.preventDefault();
1589
 
1590
        if($(this).prop('checked')) {
1591
            $('#form-experience #experience_min').prop('readonly', false);
1592
            $('#form-experience #experience_max').prop('readonly', false);
1593
        } else {
1594
            $('#form-experience #experience_min').val('1');
1595
            $('#form-experience #experience_max').val('5');
1596
            $('#form-experience #experience_min').prop('readonly', true);
1597
            $('#form-experience #experience_max').prop('readonly', true);
1598
       }
1599
    });
1600
 
1601
 
1602
    var validatorStatus = $('#form-status').validate({
1603
        debug: true,
1604
        onclick: false,
1605
        onkeyup: false,
1606
        ignore: [],
1607
        rules: {
1608
            'status': {
1609
                required: false,
1610
            },
1611
        },
1612
        submitHandler: function(form)
1613
        {
1614
            NProgress.start();
1615
            $.ajax({
1616
                'dataType'  : 'json',
1617
                'accept'    : 'application/json',
1618
                'method'    : 'post',
1619
                'url'       :  route_status,
1620
                'data'      :  $('#form-status').serialize()
1621
            }).done(function(response) {
1622
                if(response['success']) {
1623
					$('#overview-status').html(response['data']['status']);
1624
                    $("#status-box").modal('hide');
1625
                } else {
1626
                    validatorStatus.resetForm();
1627
                    if(jQuery.type(response['data']) == 'string') {
1628
                        $.fn.showError(response['data']);
1629
                    } else  {
1630
                        $.each(response['data'], function( fieldname, errors ) {
1631
                            $.fn.showFormErrorValidator('#form-status #' + fieldname, errors);
1632
                        });
1633
                    }
1634
                }
1635
            }).fail(function( jqXHR, textStatus, errorThrown) {
1636
                $.fn.showError(textStatus);
1637
            }).always(function() {
1638
                NProgress.done();
1639
            });
1640
            return false;
1641
        },
1642
        invalidHandler: function(form, validator) {
1643
 
1644
        }
1645
    });
1646
 
1647
    $('.btn-status-edit').on("click", function(e){
1648
        e.preventDefault();
1649
 
1650
        NProgress.start();
1651
        $.ajax({
1652
            'dataType'  : 'json',
1653
            'accept'    : 'application/json',
1654
            'method'    : 'get',
1655
            'url'       : route_status,
1656
        }).done(function(response) {
1657
           if(response['success']) {
1658
                $('#form-status #status').val(response['data']['status']);
1659
                validatorStatus.resetForm();
1660
                $("#status-box").modal('show');
1661
            } else {
1662
                $.fn.showError(response['data']);
1663
            }
1664
        }).fail(function( jqXHR, textStatus, errorThrown) {
1665
            $.fn.showError(textStatus);
1666
        }).always(function() {
1667
            NProgress.done();
1668
        });
1669
        return false;
1670
 
1671
    });
1672
 
1673
    $('.btn-status-close').on("click", function(e){
1674
        e.preventDefault();
1675
 
1676
        $("#status-box").modal('hide');
1677
        return false;
1678
    });
1679
 
1680
 
1681
    var validatorTitle = $('#form-title').validate({
1682
        debug: true,
1683
        onclick: false,
1684
        onkeyup: false,
1685
        ignore: [],
1686
        rules: {
1687
            'title': {
1688
                required: true,
1689
                maxlength: 128,
1690
            },
1691
        },
1692
        submitHandler: function(form)
1693
        {
1694
            NProgress.start();
1695
            $.ajax({
1696
                'dataType'  : 'json',
1697
                'accept'    : 'application/json',
1698
                'method'    : 'post',
1699
                'url'       :  route_title,
1700
                'data'      :  $('#form-title').serialize()
1701
            }).done(function(response) {
1702
                if(response['success']) {
1703
					$('#overview-title').html(response['data']['title']);
1704
                    $("#title-box").modal('hide');
1705
                } else {
1706
                    validatorTitle.resetForm();
1707
                    if(jQuery.type(response['data']) == 'string') {
1708
                        $.fn.showError(response['data']);
1709
                    } else  {
1710
                        $.each(response['data'], function( fieldname, errors ) {
1711
                            $.fn.showFormErrorValidator('#form-title #' + fieldname, errors);
1712
                        });
1713
                    }
1714
                }
1715
            }).fail(function( jqXHR, textTitle, errorThrown) {
1716
                $.fn.showError(textTitle);
1717
            }).always(function() {
1718
                NProgress.done();
1719
            });
1720
            return false;
1721
        },
1722
        invalidHandler: function(form, validator) {
1723
 
1724
        }
1725
    });
1726
 
1727
    $('.btn-title-edit').on("click", function(e){
1728
        e.preventDefault();
1729
 
1730
        NProgress.start();
1731
        $.ajax({
1732
            'dataType'  : 'json',
1733
            'accept'    : 'application/json',
1734
            'method'    : 'get',
1735
            'url'       : route_title,
1736
        }).done(function(response) {
1737
           if(response['success']) {
1738
                $('#form-title #title').val(response['data']['title'] );
1739
                validatorTitle.resetForm();
1740
                $("#title-box").modal('show');
1741
            } else {
1742
                $.fn.showError(response['data']);
1743
            }
1744
        }).fail(function( jqXHR, textTitle, errorThrown) {
1745
            $.fn.showError(textTitle);
1746
        }).always(function() {
1747
            NProgress.done();
1748
        });
1749
        return false;
1750
 
1751
    });
1752
 
1753
    $('body').on('click', 'button.btn-delete', function(e) {
1754
        e.preventDefault();
1755
        var action = $(this).data('href');
1756
 
1757
 
1758
          swal.fire({
1759
            title: 'LABEL_ARE_YOU_SURE',
1760
            icon: 'question',
1761
            cancelButtonText: 'LABEL_NO',
1762
            showCancelButton: true,
1763
            confirmButtonText: 'LABEL_YES'
1764
          }).then((result) => {
1765
            if (result.isConfirmed) {
1766
 
1767
                    NProgress.start();
1768
                    $.ajax({
1769
                        'dataType'  : 'json',
1770
                        'accept'    : 'application/json',
1771
                        'method'    : 'post',
1772
                        'url'       :  action,
1773
                    }).done(function(response) {
1774
                        if(response['success']) {
1775
                            $.fn.showSuccess(response['data']);
1776
                            gridTable.api().ajax.reload(null, false);
1777
                        } else {
1778
                            $.fn.showError(response['data']);
1779
                        }
1780
                    }).fail(function( jqXHR, textStatus, errorThrown) {
1781
                        $.fn.showError(textStatus);
1782
                    }).always(function() {
1783
                        NProgress.done();
1784
                    });
1785
            }
1786
       });
1787
    });
1788
 
1789
    $('.btn-title-close').on("click", function(e){
1790
        e.preventDefault();
1791
 
1792
        $("#title-box").modal('hide');
1793
        return false;
1794
    });
1795
 
16845 efrain 1796
    $('button.btn-cancel').on("click", function(e){
16822 efrain 1797
        e.preventDefault();
1798
 
1799
 
1800
 
1801
        $('#divEdit').hide();
1802
        $('#divListing').show();
1803
        return false;
1804
    });
1805
 
1806
 
1807
    CKEDITOR.replace('description');
1808
 
1809
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
1810
    autocompleteLocationNew.addListener('place_changed', $.fn.fillInAddressNewLocation);
1811
});
1812
JS;
1813
$this->inlineScript()->captureEnd();
1 www 1814
?>
16941 stevensc 1815
 
16843 efrain 1816
<div class="container">
16941 stevensc 1817
    <div class="card" id="divListing">
1818
        <div class="card-header">
1819
            LABEL_JOBS
1820
        </div>
1821
        <div class="card-body">
1822
            <div class="row">
1823
                <div class="col-12 mt-3">
1824
                    <table id="gridTable" class="table   table-bordered">
1825
                        <thead>
1826
                            <tr>
1827
                                <th>LABEL_LAST_DATE_OF_APPLICATION</th>
1828
                                <th>LABEL_TITLE</th>
1829
                                <th>LABEL_DETAILS</th>
1830
                                <th>LABEL_ACTIONS</th>
1831
                            </tr>
1832
                        </thead>
1833
                        <tbody>
1834
                        </tbody>
1835
                    </table>
1836
                </div>
1837
            </div>
1838
        </div>
1839
        <div class="card-footer text-right">
1840
            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1841
            <?php if ($allowAdd) : ?>
1842
                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1843
            <?php endif; ?>
1844
        </div>
16845 efrain 1845
    </div>
16822 efrain 1846
 
16941 stevensc 1847
    <div class="card" id="divEdit" style="display: none">
1848
        <div class="card-header ">
1849
            LABEL_EDIT_JOB
1850
        </div>
1851
        <div class="card-body">
1852
            <div class="card  mt-3">
1853
                <div class="card-body">
1854
                    <h6 class="card-title">
1855
                        LABEL_STATUS <a href="#" title="" class="btn-status-edit"> <i class="fa fa-pen"></i></a>
1856
                    </h6>
1857
                    <div class="row">
1858
                        <div class="col-12 mt-3" id="overview-status">
1859
                        </div>
1860
                    </div>
1861
                </div>
1862
            </div>
16822 efrain 1863
 
16941 stevensc 1864
            <div class="card  mt-3">
1865
                <div class="card-body">
1866
                    <h6 class="card-title">
1867
                        LABEL_TITLE <a href="#" title="" class="btn-title-edit"><i class="fa fa-pen"></i></a>
1868
                    </h6>
1869
                    <div class="row">
1870
                        <div class="col-12 mt-3" id="overview-title">
1871
                        </div>
1872
                    </div>
1873
                </div>
1874
            </div>
1875
 
1876
            <div class="card  mt-3">
1877
                <div class="card-body">
1878
                    <h6 class="card-title">
1879
                        LABEL_OVERVIEW <a href="#" title="" class="btn-extended-edit"><i class="fa fa-pen"></i></a>
1880
                    </h6>
1881
                    <div class="row">
1882
                        <div class="col-12 mt-3" id="overview-description">
1883
                        </div>
1884
                    </div>
1885
                </div>
1886
            </div>
1887
 
1888
 
1889
            <div class="card  mt-3">
1890
                <div class="card-body">
1891
                    <h6 class="card-title">
1892
                        LABEL_LAST_DATE_OF_APPLICATION <a href="#" title="" class="btn-last-date-of-application-edit"><i class="fa fa-pen"></i></a>
1893
                    </h6>
1894
                    <div class="row">
1895
                        <div class="col-12 mt-3" id="overview-last-date-of-application">
1896
                        </div>
1897
                    </div>
1898
                </div>
1899
            </div>
1900
 
1901
            <div class="card  mt-3">
1902
                <div class="card-body">
1903
                    <h6 class="card-title">
1904
                        LABEL_EMPLOYMENT_TYPE <a href="#" title="" class="btn-employment-type-edit"><i class="fa fa-pen"></i></a>
1905
                    </h6>
1906
                    <div class="row">
1907
                        <div class="col-12 mt-3" id="overview-employment-type">
1908
                        </div>
1909
                    </div>
1910
                </div>
1911
            </div>
1912
 
1913
            <div class="card  mt-3">
1914
                <div class="card-body">
1915
                    <h6 class="card-title">
1916
                        LABEL_LOCATION <a href="#" title="" class="btn-location-edit"><i class="fa fa-pen"></i></a>
1917
                    </h6>
1918
                    <div class="row">
1919
                        <div class="col-12 mt-3" id="overview-location">
1920
                        </div>
1921
                    </div>
1922
                </div>
1923
            </div>
1924
 
1925
            <div class="card  mt-3">
1926
                <div class="card-body">
1927
                    <h6 class="card-title">
1928
                        LABEL_EXPERIENCE <a href="#" title="" class="btn-experience-edit"><i class="fa fa-pen"></i></a>
1929
                    </h6>
1930
                    <div class="row">
1931
                        <div class="col-12 mt-3" id="overview-experience">
1932
                        </div>
1933
                    </div>
1934
                </div>
1935
            </div>
1936
 
1937
            <div class="card  mt-3">
1938
                <div class="card-body">
1939
                    <h6 class="card-title">
1940
                        LABEL_SALARY <a href="#" title="" class="btn-salary-edit"><i class="fa fa-pen"></i></a>
1941
                    </h6>
1942
                    <div class="row">
1943
                        <div class="col-12 mt-3" id="overview-salary">
1944
                        </div>
1945
                    </div>
1946
                </div>
1947
            </div>
1948
 
1949
 
1950
            <div class="card  mt-3">
1951
                <div class="card-body">
1952
                    <h6 class="card-title">
1953
                        LABEL_CATEGORIE <a href="#" title="" class="btn-job-category-edit"><i class="fa fa-pen"></i></a>
1954
                    </h6>
1955
                    <div class="row">
1956
                        <div class="col-12 mt-3" id="overview-job-category">
1957
                        </div>
1958
                    </div>
1959
                </div>
1960
            </div>
1961
 
1962
            <div class="card  mt-3">
1963
                <div class="card-body">
1964
                    <h6 class="card-title">
1965
                        LABEL_SKILLS <a href="#" title="" class="btn-skills-edit"> <i class="fa fa-pen"></i></a>
1966
                    </h6>
1967
                    <div class="row">
1968
                        <div class="col-12 mt-3">
1969
                            <ul id="list-skills">
1970
                            </ul>
1971
                        </div>
1972
                    </div>
1973
                </div>
1974
            </div>
1975
 
1976
            <div class="card  mt-3">
1977
                <div class="card-body">
1978
                    <h6 class="card-title">
1979
                        LABEL_LANGUAGES <a href="#" title="" class="btn-languages-edit"> <i class="fa fa-pen"></i></a>
1980
                    </h6>
1981
                    <div class="row">
1982
                        <div class="col-12 mt-3">
1983
                            <ul id="list-languages">
1984
                            </ul>
1985
                        </div>
1986
                    </div>
1987
                </div>
1988
            </div>
1989
 
1990
            <div class="card  mt-3">
1991
                <div class="card-body">
1992
                    <h6 class="card-title">
1993
                        LABEL_DEGREES <a href="#" title="" class="btn-degrees-edit"> <i class="fa fa-pen"></i></a>
1994
                    </h6>
1995
                    <div class="row">
1996
                        <div class="col-12 mt-3">
1997
                            <ul id="list-degrees">
1998
                            </ul>
1999
                        </div>
2000
                    </div>
2001
                </div>
2002
            </div>
2003
 
2004
        </div>
2005
        <div class="card-footer text-right">
2006
            <button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
2007
        </div>
2008
    </div>
2009
</div>
2010
 
2011
 
2012
 
16822 efrain 2013
<div class="modal" tabindex="-1" role="dialog" id="add-job-box">
16941 stevensc 2014
    <div class="modal-dialog" role="document">
2015
        <?php
2016
        $form = $this->formAdd;
2017
        $form->setAttributes([
2018
            'method'    => 'post',
2019
            'name'      => 'form-add',
2020
            'id'        => 'form-add'
2021
        ]);
2022
        $form->prepare();
2023
        echo $this->form()->openTag($form);
2024
 
2025
        $fieldnames = [
2026
            'formatted_address',
2027
            'address1',
2028
            'address2',
2029
            'country',
2030
            'state',
2031
            'city1',
2032
            'city2',
2033
            'postal_code',
2034
            'latitude',
2035
            'longitude',
2036
        ];
2037
 
2038
        foreach ($fieldnames as $fieldname) {
2039
 
2040
            $element = $form->get($fieldname);
2041
            echo $this->formHidden($element);
2042
        }
2043
        ?>
2044
        <div class="modal-content">
2045
            <div class="modal-header">
2046
                <h6 class="modal-title">LABEL_NEW_JOB</h6>
2047
            </div>
2048
            <div class="modal-body">
2049
                <div class="row">
2050
                    <div class="col-12 mt-3">
2051
                        <?php
2052
                        $element = $form->get('title');
2053
                        $element->setOptions(['label' => 'LABEL_TITLE']);
2054
                        $element->setAttributes(['class' => 'form-control']);
2055
                        echo $this->formLabel($element);
2056
                        echo $this->formText($element);
16845 efrain 2057
                        ?>
16941 stevensc 2058
                    </div>
2059
                </div>
2060
                <div class="row">
2061
                    <div class="col-12 mt-3">
2062
                        <?php
2063
                        $element = $form->get('employment_type');
2064
                        $element->setAttributes(['class' => 'form-control']);
2065
                        $element->setOptions(['empty_option' => 'LABEL_SELECT_EMPLOYMENT_TYPE', 'label' => 'LABEL_EMPLOYMENT_TYPE']);
2066
                        echo $this->formLabel($element);
2067
                        echo $this->formSelect($element);
16845 efrain 2068
                        ?>
16941 stevensc 2069
                    </div>
2070
                </div>
2071
                <div class="row">
2072
                    <div class="col-12 mt-3">
2073
                        <?php
2074
                        $element = $form->get('last_date_of_application');
2075
                        $element->setAttributes(['class' => 'form-control']);
2076
                        $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
2077
                        echo $this->formLabel($element);
2078
                        echo $this->formText($element);
16845 efrain 2079
                        ?>
16941 stevensc 2080
                    </div>
2081
                </div>
2082
                <div class="row">
2083
                    <div class="col-12 mt-3">
2084
                        <?php
2085
                        $element = $form->get('job_category_id');
2086
                        $element->setOptions(['empty_option' => 'LABEL_SELECT_JOB_CATEGORY', 'label' => 'LABEL_JOB_CATEGORY']);
2087
                        $element->setAttributes(['class' => 'form-control']);
2088
                        echo $this->formLabel($element);
2089
                        echo $this->formSelect($element);
16845 efrain 2090
                        ?>
16941 stevensc 2091
                    </div>
2092
                </div>
2093
                <div class="row">
2094
                    <div class="col-12 mt-3">
2095
                        <?php
2096
                        $element = $form->get('location_search');
2097
                        $element->setAttributes(['name' => 'add_location_search',  'id' => 'add_location_search', 'class' => 'form-control']);
2098
                        $element->setOptions(['label' => 'LABEL_LOCATION']);
2099
                        echo $this->formLabel($element);
2100
                        echo $this->formText($element);
16845 efrain 2101
                        ?>
16941 stevensc 2102
                    </div>
2103
                </div>
2104
            </div>
2105
 
2106
            <div class="modal-footer text-right">
2107
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2108
                <button type="button" class="btn btn-default btn-add-job-cancel">LABEL_CANCEL</button>
2109
            </div>
2110
            <?php echo $this->form()->closeTag($form); ?>
2111
        </div>
2112
    </div>
16822 efrain 2113
</div>
16941 stevensc 2114
 
2115
 
16822 efrain 2116
<!-- The Modal -->
2117
<div class="modal" id="modalUsersWhoApplied">
16941 stevensc 2118
    <div class="modal-dialog modal-xl">
2119
        <div class="modal-content">
16822 efrain 2120
 
2121
            <!-- Modal Header -->
16941 stevensc 2122
            <div class="modal-header">
2123
                <h6 class="modal-title">LABEL_USERS_WHO_APPLIED</h6>
2124
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
2125
            </div>
16822 efrain 2126
 
2127
            <!-- Modal body -->
16941 stevensc 2128
            <div class="modal-body">
2129
                <div style="height: 300px;overflow: scroll;">
2130
                    <table id="gridTableUsersWhoApplied" style="width: 100%" class="table table-bordered">
2131
                        <thead>
2132
                            <tr>
2133
                                <th>LABEL_FIRST_NAME</th>
2134
                                <th>LABEL_LAST_NAME</th>
2135
                                <th>LABEL_EMAIL</th>
2136
                                <th>LABEL_ACTIONS</th>
2137
                            </tr>
2138
                        </thead>
2139
                        <tbody>
2140
                        </tbody>
2141
                    </table>
2142
                </div>
16822 efrain 2143
 
16941 stevensc 2144
            </div>
2145
 
16822 efrain 2146
            <!-- Modal footer -->
16941 stevensc 2147
            <div class="modal-footer text-right">
16944 efrain 2148
                <button type="button" class="btn btn-default btn-users-who-applied-cancel">LABEL_CANCEL</button>
16941 stevensc 2149
            </div>
16822 efrain 2150
 
16941 stevensc 2151
        </div>
2152
    </div>
2153
</div>
16822 efrain 2154
 
2155
<div class="modal" tabindex="-1" role="dialog" id="extended-box">
16941 stevensc 2156
    <div class="modal-dialog" role="document">
2157
        <?php
16822 efrain 2158
        $form = $this->formExtended;
2159
        $form->setAttributes([
2160
            'method' => 'post',
2161
            'name' => 'form-extended',
2162
            'id' => 'form-extended'
2163
        ]);
2164
        $form->prepare();
2165
        echo $this->form()->openTag($form);
16941 stevensc 2166
        ?>
2167
        <div class="modal-content">
2168
            <div class="modal-header">
2169
                <h6 class="modal-title">LABEL_OVERVIEW</h6>
2170
            </div>
2171
            <div class="modal-body">
2172
                <div class="row">
2173
                    <div class="col-12 mt-3">
2174
                        <?php
16845 efrain 2175
                        $element = $form->get('description');
2176
                        $element->setOptions(['label' => 'LABEL_OVERVIEW']);
2177
                        $element->setAttributes(['class' => 'form-control']);
2178
                        echo $this->formLabel($element);
2179
                        echo $this->formTextArea($element);
2180
                        ?>
2181
                    </div>
16941 stevensc 2182
                </div>
2183
            </div>
2184
            <div class="modal-footer text-right">
2185
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2186
                <button type="button" class="btn btn-default btn-extended-close">LABEL_CANCEL</button>
2187
            </div>
2188
            <?php echo $this->form()->closeTag($form); ?>
2189
        </div>
2190
    </div>
16822 efrain 2191
</div>
2192
 
2193
<div class="modal" tabindex="-1" role="dialog" id="location-box">
16941 stevensc 2194
    <div class="modal-dialog" role="document">
2195
        <?php
16822 efrain 2196
        $form = $this->formLocation;
2197
        $form->setAttributes([
2198
            'method' => 'post',
2199
            'name' => 'form-location',
2200
            'id' => 'form-location'
2201
        ]);
2202
        $form->prepare();
2203
        echo $this->form()->openTag($form);
16941 stevensc 2204
 
16822 efrain 2205
        $fieldnames = [
2206
            'formatted_address',
2207
            'address1',
2208
            'address2',
2209
            'country',
2210
            'state',
2211
            'city1',
2212
            'city2',
2213
            'postal_code',
2214
            'latitude',
2215
            'longitude',
2216
        ];
16941 stevensc 2217
 
2218
        foreach ($fieldnames as $fieldname) {
2219
 
16822 efrain 2220
            $element = $form->get($fieldname);
2221
            echo $this->formHidden($element);
2222
        }
2223
        ?>
16941 stevensc 2224
        <div class="modal-content">
2225
            <div class="modal-header">
2226
                <h6 class="modal-title">LABEL_LOCATION</h6>
2227
            </div>
2228
            <div class="modal-body">
2229
                <div class="row">
2230
                    <div class="col-12 mt-3">
2231
 
2232
                        <?php
2233
                        $element = $form->get('location_search');
2234
                        $element->setOptions(['label' => 'LABEL_LOCATION']);
2235
                        $element->setAttributes(['class' => 'form-control']);
2236
                        echo $this->formLabel($element);
16845 efrain 2237
                        ?>
16941 stevensc 2238
                        <div class="input-group mb-3">
16822 efrain 2239
 
16941 stevensc 2240
                            <?php
2241
                            echo $this->formText($element);
2242
                            ?>
2243
                            <span class="input-group-text"><i class="fa fa-map-marker"></i></span>
2244
                        </div>
2245
 
2246
 
2247
                    </div>
2248
                </div>
2249
            </div>
2250
            <div class="modal-footer text-right">
2251
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2252
                <button type="button" class="btn btn-default btn-location-close">LABEL_CANCEL</button>
2253
            </div>
2254
            <?php echo $this->form()->closeTag($form); ?>
2255
        </div>
2256
    </div>
2257
</div>
2258
 
16822 efrain 2259
<div class="modal" tabindex="-1" role="dialog" id="employment-type-box">
16941 stevensc 2260
    <div class="modal-dialog" role="document">
2261
        <?php
16822 efrain 2262
        $form = $this->formEmploymentType;
2263
        $form->setAttributes([
2264
            'method' => 'post',
2265
            'name' => 'form-employment-type',
2266
            'id' => 'form-employment-type'
2267
        ]);
2268
        $form->prepare();
2269
        echo $this->form()->openTag($form);
16941 stevensc 2270
        ?>
2271
        <div class="modal-content">
2272
            <div class="modal-header">
2273
                <h6 class="modal-title">LABEL_EMPLOYMENT_TYPE</h6>
2274
            </div>
2275
            <div class="modal-body">
2276
                <div class="row">
2277
                    <div class="col-12 mt-3">
2278
                        <?php
16845 efrain 2279
                        $element = $form->get('employment_type');
2280
                        $element->setOptions(['label' => 'LABEL_EMPLOYMENT_TYPE']);
2281
                        $element->setAttributes(['class' => 'form-control']);
2282
                        echo $this->formLabel($element);
2283
                        echo $this->formSelect($element);
2284
                        ?>
16941 stevensc 2285
                    </div>
2286
                </div>
2287
            </div>
2288
            <div class="modal-footer text-right">
2289
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2290
                <button type="button" class="btn btn-default btn-employment-type-close">LABEL_CANCEL</button>
2291
            </div>
2292
            <?php echo $this->form()->closeTag($form); ?>
2293
        </div>
2294
    </div>
2295
</div>
16822 efrain 2296
 
2297
<div class="modal" tabindex="-1" role="dialog" id="job-category-box">
16941 stevensc 2298
    <div class="modal-dialog" role="document">
2299
        <?php
16822 efrain 2300
        $form = $this->formJobCategory;
2301
        $form->setAttributes([
2302
            'method' => 'post',
2303
            'name' => 'form-job-category',
2304
            'id' => 'form-job-category'
2305
        ]);
2306
        $form->prepare();
2307
        echo $this->form()->openTag($form);
16941 stevensc 2308
        ?>
2309
        <div class="modal-content">
2310
            <div class="modal-header">
2311
                <h6 class="modal-title">LABEL_JOB_CATEGORY</h6>
2312
            </div>
2313
            <div class="modal-body">
2314
                <div class="row">
2315
                    <div class="col-12 mt-3">
2316
                        <?php
16845 efrain 2317
                        $element = $form->get('job_category_id');
2318
                        $element->setOptions(['label' => 'LABEL_JOB_CATEGORY']);
2319
                        $element->setAttributes(['class' => 'form-control']);
2320
                        echo $this->formLabel($element);
2321
                        echo $this->formSelect($element);
2322
                        ?>
16941 stevensc 2323
                    </div>
2324
                </div>
2325
            </div>
2326
            <div class="modal-footer text-right">
2327
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2328
                <button type="button" class="btn btn-default btn-job-category-close">LABEL_CANCEL</button>
2329
            </div>
2330
            <?php echo $this->form()->closeTag($form); ?>
2331
        </div>
2332
    </div>
2333
</div>
16822 efrain 2334
 
2335
<div class="modal" tabindex="-1" role="dialog" id="salary-box">
16941 stevensc 2336
    <div class="modal-dialog" role="document">
2337
        <?php
16822 efrain 2338
        $form = $this->formSalary;
2339
        $form->setAttributes([
2340
            'method' => 'post',
2341
            'name' => 'form-salary',
2342
            'id' => 'form-salary'
2343
        ]);
2344
        $form->prepare();
2345
        echo $this->form()->openTag($form);
16941 stevensc 2346
        ?>
2347
        <div class="modal-content">
2348
            <div class="modal-header">
2349
                <h6 class="modal-title">LABEL_SALARY</h6>
2350
            </div>
2351
            <div class="modal-body">
2352
                <div class="row">
2353
                    <div class="col-12 mt-3">
2354
                        <?php
16845 efrain 2355
                        $element = $form->get('salary_visible');
2356
                        echo $this->formCheckbox($element);
2357
                        ?>
16941 stevensc 2358
                    </div>
16822 efrain 2359
                </div>
16941 stevensc 2360
                <div class="row">
2361
                    <div class="col-12 mt-3">
2362
                        <?php
16845 efrain 2363
                        $element = $form->get('salary_currency');
2364
                        $element->setAttributes(['class' => 'form-control']);
2365
                        $element->setOptions(['label' => 'LABEL_CURRENCY']);
2366
                        echo $this->formLabel($element);
2367
                        echo $this->formSelect($element);
2368
                        ?>
16941 stevensc 2369
                    </div>
16822 efrain 2370
                </div>
16941 stevensc 2371
                <div class="row">
2372
                    <div class="col-12 mt-3">
2373
                        <?php
16845 efrain 2374
                        $element = $form->get('salary_min');
2375
                        $element->setOptions(['label' => 'LABEL_MINIMUM']);
2376
                        $element->setAttributes(['class' => 'form-control']);
2377
                        echo $this->formLabel($element);
2378
                        echo $this->formText($element);
2379
                        ?>
16941 stevensc 2380
                    </div>
16822 efrain 2381
                </div>
16941 stevensc 2382
                <div class="row">
2383
                    <div class="col-12 mt-3">
2384
                        <?php
16845 efrain 2385
                        $element = $form->get('salary_max');
2386
                        $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2387
                        $element->setAttributes(['class' => 'form-control']);
2388
                        echo $this->formLabel($element);
2389
                        echo $this->formText($element);
2390
                        ?>
16941 stevensc 2391
                    </div>
16822 efrain 2392
                </div>
16941 stevensc 2393
            </div>
2394
            <div class="modal-footer text-right">
2395
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2396
                <button type="button" class="btn btn-default btn-salary-close">LABEL_CANCEL</button>
2397
            </div>
2398
            <?php echo $this->form()->closeTag($form); ?>
2399
        </div>
2400
    </div>
2401
</div>
16822 efrain 2402
 
2403
<div class="modal" tabindex="-1" role="dialog" id="experience-box">
16941 stevensc 2404
    <div class="modal-dialog" role="document">
2405
        <?php
16822 efrain 2406
        $form = $this->formExperience;
2407
        $form->setAttributes([
2408
            'method' => 'post',
2409
            'name' => 'form-experience',
2410
            'id' => 'form-experience'
2411
        ]);
2412
        $form->prepare();
2413
        echo $this->form()->openTag($form);
16941 stevensc 2414
        ?>
2415
        <div class="modal-content">
2416
            <div class="modal-header">
2417
                <h6 class="modal-title">LABEL_EXPERIENCE</h6>
2418
            </div>
2419
            <div class="modal-body">
2420
                <div class="row">
2421
                    <div class="col-12 mt-3">
2422
                        <?php
16845 efrain 2423
                        $element = $form->get('experience_visible');
16941 stevensc 2424
 
16845 efrain 2425
                        echo $this->formCheckbox($element);
2426
                        ?>
16941 stevensc 2427
                    </div>
16822 efrain 2428
                </div>
16941 stevensc 2429
                <div class="row">
2430
                    <div class="col-12 mt-3">
2431
                        <?php
16845 efrain 2432
                        $element = $form->get('experience_min');
2433
                        $element->setOptions(['label' => 'LABEL_MINIMUM']);
2434
                        $element->setAttributes(['class' => 'form-control']);
2435
                        echo $this->formLabel($element);
2436
                        echo $this->formText($element);
2437
                        ?>
16941 stevensc 2438
                    </div>
16822 efrain 2439
                </div>
16941 stevensc 2440
                <div class="row">
2441
                    <div class="col-12 mt-3">
2442
                        <?php
16845 efrain 2443
                        $element = $form->get('experience_max');
2444
                        $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2445
                        $element->setAttributes(['class' => 'form-control']);
2446
                        echo $this->formLabel($element);
2447
                        echo $this->formText($element);
2448
                        ?>
16941 stevensc 2449
                    </div>
16822 efrain 2450
                </div>
16941 stevensc 2451
            </div>
2452
            <div class="modal-footer text-right">
2453
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2454
                <button type="button" class="btn btn-default btn-experience-close">LABEL_CANCEL</button>
2455
            </div>
2456
            <?php echo $this->form()->closeTag($form); ?>
2457
        </div>
2458
    </div>
2459
</div>
16822 efrain 2460
 
2461
 
2462
<div class="modal" tabindex="-1" role="dialog" id="skills-box">
16941 stevensc 2463
    <div class="modal-dialog" role="document">
2464
        <?php
2465
        $form = $this->formSkill;
2466
        $form->setAttributes([
2467
            'method' => 'post',
2468
            'name' => 'form-skill',
2469
            'id' => 'form-skill'
2470
        ]);
2471
        $form->prepare();
2472
        echo $this->form()->openTag($form);
2473
        ?>
2474
        <div class="modal-content">
2475
            <div class="modal-header">
2476
                <h6 class="modal-title">LABEL_SKILLS</h6>
2477
            </div>
2478
            <div class="modal-body">
2479
                <div class="row">
2480
                    <div class="col-12 mt-3">
2481
                        <?php
16845 efrain 2482
                        $element = $form->get('skills');
2483
                        $element->setOptions(['label' => 'LABEL_SKILLS']);
2484
                        $element->setAttributes(['class' => 'form-control']);
2485
                        echo $this->formLabel($element);
2486
                        echo $this->formSelect($element);
16941 stevensc 2487
                        ?>
16845 efrain 2488
                    </div>
16941 stevensc 2489
                </div>
2490
            </div>
2491
 
2492
 
2493
            <div class="modal-footer text-right">
2494
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2495
                <button type="button" class="btn btn-default btn-skills-close">LABEL_CANCEL</button>
2496
            </div>
2497
            <?php echo $this->form()->closeTag($form); ?>
2498
        </div>
2499
    </div>
16822 efrain 2500
</div>
2501
 
2502
<div class="modal" tabindex="-1" role="dialog" id="languages-box">
16941 stevensc 2503
    <div class="modal-dialog" role="document">
2504
        <?php
16822 efrain 2505
        $form = $this->formLanguage;
2506
        $form->setAttributes([
2507
            'method' => 'post',
2508
            'name' => 'form-language',
2509
            'id' => 'form-language'
2510
        ]);
2511
        $form->prepare();
2512
        echo $this->form()->openTag($form);
16941 stevensc 2513
        ?>
2514
        <div class="modal-content">
2515
            <div class="modal-header">
2516
                <h6 class="modal-title">LABEL_LANGUAGES</h6>
2517
            </div>
2518
            <div class="modal-body">
2519
                <div class="row">
2520
                    <div class="col-12 mt-3">
2521
                        <?php
16845 efrain 2522
                        $element = $form->get('languages');
2523
                        $element->setOptions(['label' => 'LABEL_LANGUAGES']);
2524
                        $element->setAttributes(['class' => 'form-control']);
2525
                        echo $this->formLabel($element);
2526
                        echo $this->formSelect($element);
2527
                        ?>
16941 stevensc 2528
                    </div>
16822 efrain 2529
                </div>
16941 stevensc 2530
            </div>
2531
            <div class="modal-footer text-right">
2532
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2533
                <button type="button" class="btn btn-default btn-languages-close">LABEL_CANCEL</button>
2534
            </div>
2535
            <?php echo $this->form()->closeTag($form); ?>
2536
        </div>
2537
    </div>
16822 efrain 2538
</div>
2539
 
2540
<div class="modal" tabindex="-1" role="dialog" id="last-date-of-application-box">
16941 stevensc 2541
    <div class="modal-dialog" role="document">
2542
        <?php
2543
        $form = $this->fromLastDateOfApplication;
16822 efrain 2544
        $form->setAttributes([
2545
            'method' => 'post',
2546
            'name' => 'form-last-date-of-application',
2547
            'id' => 'form-last-date-of-application'
2548
        ]);
2549
        $form->prepare();
2550
        echo $this->form()->openTag($form);
16941 stevensc 2551
        ?>
2552
        <div class="modal-content">
2553
            <div class="modal-header">
2554
                <h6 class="modal-title">LABEL_LAST_DATE_OF_APPLICATION</h6>
2555
            </div>
2556
            <div class="modal-body">
2557
                <div class="row">
2558
                    <div class="col-12 mt-3">
2559
                        <?php
16845 efrain 2560
                        $element = $form->get('last_date_of_application');
2561
                        $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
2562
                        $element->setAttributes(['class' => 'form-control']);
2563
                        echo $this->formLabel($element);
2564
                        echo $this->formText($element);
2565
                        ?>
16941 stevensc 2566
                    </div>
16822 efrain 2567
                </div>
16941 stevensc 2568
            </div>
2569
            <div class="modal-footer text-right">
2570
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2571
                <button type="button" class="btn btn-default btn-last-date-of-application-close">LABEL_CANCEL</button>
2572
            </div>
2573
            <?php echo $this->form()->closeTag($form); ?>
2574
        </div>
2575
    </div>
16822 efrain 2576
</div>
2577
 
2578
<div class="modal" tabindex="-1" role="dialog" id="degrees-box">
16941 stevensc 2579
    <div class="modal-dialog" role="document">
2580
        <?php
16822 efrain 2581
        $form = $this->formDegree;
2582
        $form->setAttributes([
2583
            'method' => 'post',
2584
            'name' => 'form-degree',
2585
            'id' => 'form-degree'
2586
        ]);
2587
        $form->prepare();
2588
        echo $this->form()->openTag($form);
16941 stevensc 2589
        ?>
2590
        <div class="modal-content">
2591
            <div class="modal-header">
2592
                <h6 class="modal-title">LABEL_DEGREES</h6>
2593
            </div>
2594
            <div class="modal-body">
2595
                <div class="row">
2596
                    <div class="col-12 mt-3">
2597
                        <?php
16845 efrain 2598
                        $element = $form->get('degrees');
2599
                        $element->setOptions(['label' => 'LABEL_DEGREES']);
2600
                        $element->setAttributes(['class' => 'form-control']);
2601
                        echo $this->formLabel($element);
2602
                        echo $this->formSelect($element);
2603
                        ?>
16941 stevensc 2604
                    </div>
16822 efrain 2605
                </div>
16941 stevensc 2606
            </div>
2607
            <div class="modal-footer text-right">
2608
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2609
                <button type="button" class="btn btn-default btn-degrees-close">LABEL_CANCEL</button>
2610
            </div>
2611
            <?php echo $this->form()->closeTag($form); ?>
2612
        </div>
2613
    </div>
16822 efrain 2614
</div>
2615
 
2616
<div class="modal" tabindex="-1" role="dialog" id="status-box">
16941 stevensc 2617
    <div class="modal-dialog" role="document">
2618
        <?php
2619
        $form = $this->formStatus;
2620
        $form->setAttributes([
2621
            'method' => 'post',
2622
            'name' => 'form-status',
2623
            'id' => 'form-status'
2624
        ]);
2625
        $form->prepare();
2626
        echo $this->form()->openTag($form);
2627
        ?>
2628
        <div class="modal-content">
2629
            <div class="modal-header">
2630
                <h6 class="modal-title">LABEL_STATUS</h6>
2631
            </div>
2632
            <div class="modal-body">
2633
                <div class="row">
2634
                    <div class="col-12 mt-3">
2635
                        <?php
16845 efrain 2636
                        $element = $form->get('status');
2637
                        $element->setOptions(['label' => 'LABEL_STATUS']);
2638
                        $element->setAttributes(['class' => 'form-control']);
2639
                        echo $this->formLabel($element);
2640
                        echo $this->formSelect($element);
2641
                        ?>
16941 stevensc 2642
                    </div>
16822 efrain 2643
                </div>
16941 stevensc 2644
            </div>
2645
 
2646
 
2647
            <div class="modal-footer text-right">
2648
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2649
                <button type="button" class="btn btn-default btn-status-close">LABEL_CANCEL</button>
2650
            </div>
2651
            <?php echo $this->form()->closeTag($form); ?>
2652
        </div>
2653
    </div>
16822 efrain 2654
</div>
2655
 
2656
<div class="modal" tabindex="-1" role="dialog" id="title-box">
16941 stevensc 2657
    <div class="modal-dialog" role="document">
2658
        <?php
2659
        $form = $this->formTitle;
2660
        $form->setAttributes([
2661
            'method' => 'post',
2662
            'name' => 'form-title',
2663
            'id' => 'form-title'
2664
        ]);
2665
        $form->prepare();
2666
        echo $this->form()->openTag($form);
2667
        ?>
2668
        <div class="modal-content">
2669
            <div class="modal-header">
2670
                <h6 class="modal-title">LABEL_TITLE</h6>
2671
            </div>
2672
            <div class="modal-body">
2673
                <div class="row">
2674
                    <div class="col-12 mt-3">
2675
                        <?php
16845 efrain 2676
                        $element = $form->get('title');
2677
                        $element->setOptions(['label' => 'LABEL_TITLE']);
2678
                        $element->setAttributes(['class' => 'form-control']);
2679
                        echo $this->formLabel($element);
2680
                        echo $this->formText($element);
2681
                        ?>
16941 stevensc 2682
                    </div>
16822 efrain 2683
                </div>
16941 stevensc 2684
            </div>
2685
 
2686
 
2687
            <div class="modal-footer text-right">
2688
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2689
                <button type="button" class="btn btn-default btn-title-close">LABEL_CANCEL</button>
2690
            </div>
2691
            <?php echo $this->form()->closeTag($form); ?>
2692
        </div>
2693
    </div>
15045 stevensc 2694
</div>