Proyectos de Subversion LeadersLinked - Backend

Rev

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

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