Proyectos de Subversion LeadersLinked - Backend

Rev

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

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