Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 7772 | Rev 7774 | 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
 
7773 stevensc 1344
    $('.btn-languages-edit').on("click", function(){
1 www 1345
 
1346
        NProgress.start();
1347
        $.ajax({
1348
            'dataType'  : 'json',
1349
            'accept'    : 'application/json',
1350
            'method'    : 'get',
1351
            'url'       : route_languages,
1352
        }).done(function(response) {
1353
           if(response['success']) {
1354
                $('#form-language #languages').val(response['data']).trigger('change');
1355
                validatorLanguages.resetForm();
1356
 
1357
                $("#languages-box").modal('show');
1358
            } else {
1359
                $.fn.showError(response['data']);
1360
            }
1361
        }).fail(function( jqXHR, textStatus, errorThrown) {
1362
            $.fn.showError(textStatus);
1363
        }).always(function() {
1364
            NProgress.done();
1365
        });
1366
        return false;
1367
 
1368
    });
1369
 
1370
    $('.btn-languages-close').on("click", function(e){
1371
        e.preventDefault();
1372
 
1373
        $("#languages-box").modal('hide');
1374
        return false;
1375
    });
1376
 
1377
 
1378
    var validatorDegrees = $('#form-degree').validate({
1379
        debug: true,
1380
        onclick: false,
1381
        onkeyup: false,
1382
         onfocusout: false,
1383
        ignore: [],
1384
        rules: {
1385
            'degrees[]': {
1386
                required: true,
1387
            }
1388
        },
1389
        submitHandler: function(form)
1390
        {
1391
            NProgress.start();
1392
            $.ajax({
1393
                'dataType'  : 'json',
1394
                'accept'    : 'application/json',
1395
                'method'    : 'post',
1396
                'url'       :  route_degrees,
1397
                'data'      :  {
1398
                    'degrees[]' : $('#form-degree #degrees').val()
1399
                },
1400
            }).done(function(response) {
1401
                if(response['success']) {
1402
 
1403
					$('#list-degrees').empty();
1404
                    $.each(response['data'], function(index, item) {
1405
                        $('#list-degrees').append('<li><a href="#" title="">' + item.label + '</a></li>');
1406
                    });
1407
 
1408
                    $("#degrees-box").modal('hide');
1409
                } else {
1410
                    validatorDegrees.resetForm();
1411
                    if(jQuery.type(response['data']) == 'string') {
1412
                        $.fn.showError(response['data']);
1413
                    } else  {
1414
                        $.each(response['data'], function( fieldname, errors ) {
1415
                            $.fn.showFormErrorValidator('#form-degree #' + fieldname, errors);
1416
                        });
1417
                    }
1418
                }
1419
            }).fail(function( jqXHR, textStatus, errorThrown) {
1420
                $.fn.showError(textStatus);
1421
            }).always(function() {
1422
                NProgress.done();
1423
            });
1424
            return false;
1425
        },
1426
        invalidHandler: function(form, validator) {
1427
 
1428
        }
1429
    });
1430
 
1431
    $('.btn-degrees-edit').on("click", function(e){
1432
        e.preventDefault();
1433
 
1434
        NProgress.start();
1435
        $.ajax({
1436
            'dataType'  : 'json',
1437
            'accept'    : 'application/json',
1438
            'method'    : 'get',
1439
            'url'       : route_degrees,
1440
        }).done(function(response) {
1441
           if(response['success']) {
1442
                $('#form-degree #degrees').val(response['data']).trigger('change');
1443
                validatorDegrees.resetForm();
1444
 
1445
                $("#degrees-box").modal('show');
1446
            } else {
1447
                $.fn.showError(response['data']);
1448
            }
1449
        }).fail(function( jqXHR, textStatus, errorThrown) {
1450
            $.fn.showError(textStatus);
1451
        }).always(function() {
1452
            NProgress.done();
1453
        });
1454
        return false;
1455
 
1456
    });
1457
 
1458
    $('.btn-degrees-close').on("click", function(e){
1459
        e.preventDefault();
1460
 
1461
        $("#degrees-box").modal('hide');
1462
        return false;
1463
    });
1464
 
1465
 
1466
    $('#form-degree #degrees').select2({
1467
        theme: 'bootstrap4',
1468
        width: '100%',
1469
        placeholder: 'LABEL_SELECT_DEGREE'
1470
    });
1471
 
1472
    $('#form-skill #skills').select2({
1473
        theme: 'bootstrap4',
1474
        width: '100%',
1475
        placeholder: 'LABEL_SELECT_ONE_SKILLS'
1476
    });
1477
 
1478
    $('#form-language #languages').select2({
1479
        theme: 'bootstrap4',
1480
        width: '100%',
1481
        placeholder: 'LABEL_SELECT_ONE_LANGUAGE'
1482
    });
1483
 
1484
 
1485
 
1486
    $('#form-last-date-of-application #last_date_of_application').datetimepicker({
1487
        locale: 'es',
1488
        format: 'DD/MM/YYYY'
1489
    });
1490
 
1491
    $('#form-salary #salary_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1492
    $('#form-salary #salary_min').inputNumberFormat({ 'decimal': 2 });
1493
    $('#form-salary #salary_max').inputNumberFormat({ 'decimal': 2 });
1494
 
1495
    $('#form-salary #salary_visible').change(function(e) {
1496
        e.preventDefault();
1497
 
1498
        if($(this).prop('checked')) {
1499
            $('#form-salary #salary_min').prop('readonly', false);
1500
            $('#form-salary #salary_max').prop('readonly', false);
1501
            $('#form-salary #salary_currency').prop('disabled', false);
1502
        } else {
1503
            $('#form-salary #salary_min').val('1');
1504
            $('#form-salary #salary_max').val('99');
1505
            $('#form-salary #salary_min').prop('readonly', true);
1506
            $('#form-salary #salary_max').prop('readonly', true);
1507
            $('#form-salary #salary_currency').prop('disabled', true);
1508
        }
1509
    });
1510
 
1511
    $('#form-experience #experience_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1512
    $('#form-experience #experience_min').inputNumberFormat({ 'decimal': 0 });
1513
    $('#form-experience #experience_max').inputNumberFormat({ 'decimal': 0 });
1514
 
1515
    $('#form-experience #experience_visible').change(function(e) {
1516
        e.preventDefault();
1517
 
1518
        if($(this).prop('checked')) {
1519
            $('#form-experience #experience_min').prop('readonly', false);
1520
            $('#form-experience #experience_max').prop('readonly', false);
1521
        } else {
1522
            $('#form-experience #experience_min').val('1');
1523
            $('#form-experience #experience_max').val('5');
1524
            $('#form-experience #experience_min').prop('readonly', true);
1525
            $('#form-experience #experience_max').prop('readonly', true);
1526
       }
1527
    });
1528
 
1529
 
1530
    var validatorStatus = $('#form-status').validate({
1531
        debug: true,
1532
        onclick: false,
1533
        onkeyup: false,
1534
        ignore: [],
1535
        rules: {
1536
            'status': {
1537
                required: false,
1538
            },
1539
        },
1540
        submitHandler: function(form)
1541
        {
1542
            NProgress.start();
1543
            $.ajax({
1544
                'dataType'  : 'json',
1545
                'accept'    : 'application/json',
1546
                'method'    : 'post',
1547
                'url'       :  route_status,
1548
                'data'      :  $('#form-status').serialize()
1549
            }).done(function(response) {
1550
                if(response['success']) {
1551
					$('#overview-status').html(response['data']['status']);
1552
                    $("#status-box").modal('hide');
1553
                } else {
1554
                    validatorStatus.resetForm();
1555
                    if(jQuery.type(response['data']) == 'string') {
1556
                        $.fn.showError(response['data']);
1557
                    } else  {
1558
                        $.each(response['data'], function( fieldname, errors ) {
1559
                            $.fn.showFormErrorValidator('#form-status #' + fieldname, errors);
1560
                        });
1561
                    }
1562
                }
1563
            }).fail(function( jqXHR, textStatus, errorThrown) {
1564
                $.fn.showError(textStatus);
1565
            }).always(function() {
1566
                NProgress.done();
1567
            });
1568
            return false;
1569
        },
1570
        invalidHandler: function(form, validator) {
1571
 
1572
        }
1573
    });
1574
 
1575
    $('.btn-status-edit').on("click", function(e){
1576
        e.preventDefault();
1577
 
1578
        NProgress.start();
1579
        $.ajax({
1580
            'dataType'  : 'json',
1581
            'accept'    : 'application/json',
1582
            'method'    : 'get',
1583
            'url'       : route_status,
1584
        }).done(function(response) {
1585
           if(response['success']) {
1586
                $('#form-status #status').val(response['data']['status']);
1587
                validatorStatus.resetForm();
1588
                $("#status-box").modal('show');
1589
            } else {
1590
                $.fn.showError(response['data']);
1591
            }
1592
        }).fail(function( jqXHR, textStatus, errorThrown) {
1593
            $.fn.showError(textStatus);
1594
        }).always(function() {
1595
            NProgress.done();
1596
        });
1597
        return false;
1598
 
1599
    });
1600
 
1601
    $('.btn-status-close').on("click", function(e){
1602
        e.preventDefault();
1603
 
1604
        $("#status-box").modal('hide');
1605
        return false;
1606
    });
1607
 
1608
 
1609
    var validatorTitle = $('#form-title').validate({
1610
        debug: true,
1611
        onclick: false,
1612
        onkeyup: false,
1613
        ignore: [],
1614
        rules: {
1615
            'title': {
1616
                required: true,
1617
                maxlength: 128,
1618
            },
1619
        },
1620
        submitHandler: function(form)
1621
        {
1622
            NProgress.start();
1623
            $.ajax({
1624
                'dataType'  : 'json',
1625
                'accept'    : 'application/json',
1626
                'method'    : 'post',
1627
                'url'       :  route_title,
1628
                'data'      :  $('#form-title').serialize()
1629
            }).done(function(response) {
1630
                if(response['success']) {
1631
					$('#overview-title').html(response['data']['title']);
1632
                    $("#title-box").modal('hide');
1633
                } else {
1634
                    validatorTitle.resetForm();
1635
                    if(jQuery.type(response['data']) == 'string') {
1636
                        $.fn.showError(response['data']);
1637
                    } else  {
1638
                        $.each(response['data'], function( fieldname, errors ) {
1639
                            $.fn.showFormErrorValidator('#form-title #' + fieldname, errors);
1640
                        });
1641
                    }
1642
                }
1643
            }).fail(function( jqXHR, textTitle, errorThrown) {
1644
                $.fn.showError(textTitle);
1645
            }).always(function() {
1646
                NProgress.done();
1647
            });
1648
            return false;
1649
        },
1650
        invalidHandler: function(form, validator) {
1651
 
1652
        }
1653
    });
1654
 
1655
    $('.btn-title-edit').on("click", function(e){
1656
        e.preventDefault();
1657
 
1658
        NProgress.start();
1659
        $.ajax({
1660
            'dataType'  : 'json',
1661
            'accept'    : 'application/json',
1662
            'method'    : 'get',
1663
            'url'       : route_title,
1664
        }).done(function(response) {
1665
           if(response['success']) {
1666
                $('#form-title #title').val(response['data']['title'] );
1667
                validatorTitle.resetForm();
1668
                $("#title-box").modal('show');
1669
            } else {
1670
                $.fn.showError(response['data']);
1671
            }
1672
        }).fail(function( jqXHR, textTitle, errorThrown) {
1673
            $.fn.showError(textTitle);
1674
        }).always(function() {
1675
            NProgress.done();
1676
        });
1677
        return false;
1678
 
1679
    });
1680
 
1681
    $('.btn-title-close').on("click", function(e){
1682
        e.preventDefault();
1683
 
1684
        $("#title-box").modal('hide');
1685
        return false;
1686
    });
1687
 
1688
    $('h1.btn-edit-back').on("click", function(e){
1689
        e.preventDefault();
1690
 
1691
 
1692
 
1693
        $('#divEdit').hide();
1694
        $('#divListing').show();
1695
        return false;
1696
    });
1697
 
1698
 
3766 stevensc 1699
    CKEDITOR.replace('description', {
1700
        toolbar: [
1701
            { name: 'editing', items: [ 'Scayt' ] },
1702
            { name: 'links', items: [ 'Link', 'Unlink'] },
1703
            { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ] },
1704
            { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Strike', 'RemoveFormat' ] },
1705
            '/',
1706
            { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
1707
            { name: 'styles', items: [ 'Styles', 'Format' ] },
1708
            { name: 'tools', items: [ 'Maximize' ] }
1709
        ],
3928 stevensc 1710
        removePlugins: 'elementspath,Anchor',
3766 stevensc 1711
        height: 100
1712
    });
1 www 1713
 
1714
});
1715
JS;
1716
$this->inlineScript()->captureEnd();
6628 stevensc 1717
 
1718
$js = <<<JS
6629 stevensc 1719
const linksVars = {
6680 stevensc 1720
    link_add:"$routeAdd",
1721
    link_table: "$routeDatatable",
1722
    allowAdd: "$allowAdd",
1723
    allowDelete: "$allowDelete",
1724
    allowEdit: "$allowEdit",
7768 stevensc 1725
    allowUsersWhoApplied: "$allowUsersWhoApplied",
1726
    googleApi: "$google_map_key"
6628 stevensc 1727
}
1728
JS;
1729
 
1730
$this->inlineScript()->appendScript($js);
7124 stevensc 1731
$this->headLink()->appendStylesheet('/react-bundles/jobs/main.css');
6628 stevensc 1732
$this->inlineScript()->appendFile('/react-bundles/jobs/jobsBundle.js');
1 www 1733
?>
3766 stevensc 1734
 
1 www 1735
<!-- Content Header (Page header) -->
6628 stevensc 1736
<div id="jobs"></div>
1 www 1737
<div id="divListing">
1738
 
1739
    <section class="content-header">
3766 stevensc 1740
        <div class="container-fluid">
1741
            <div class="row mb-2">
1742
                <div class="col-sm-12">
1743
                    <h1>LABEL_JOBS</h1>
1744
                </div>
1745
            </div>
1746
        </div><!-- /.container-fluid -->
1 www 1747
    </section>
3766 stevensc 1748
 
1 www 1749
    <section class="content">
3766 stevensc 1750
        <div class="container-fluid">
1751
            <div class="row">
1752
                <div class="col-12">
1753
                    <div class="card">
1754
                        <div class="card-body">
1755
                            <table id="gridTable" class="table   table-hover">
1756
                                <thead>
1757
                                    <tr>
1758
 
1759
                                        <th>LABEL_LAST_DATE_OF_APPLICATION</th>
1760
                                        <th>LABEL_TITLE</th>
1761
                                        <th>LABEL_DETAILS</th>
1762
                                        <th>LABEL_ACTIONS</th>
1 www 1763
                                    </tr>
3766 stevensc 1764
                                </thead>
1765
                                <tbody>
1766
                                </tbody>
1767
                            </table>
1768
                        </div>
1769
                        <div class="card-footer clearfix">
1770
                            <div style="float:right;">
1771
                                <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1772
                                <?php if ($allowAdd) : ?>
1773
                                    <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1774
                                <?php endif; ?>
1775
                            </div>
1776
                        </div>
1777
                    </div>
1778
                </div>
1 www 1779
            </div>
3766 stevensc 1780
        </div>
1781
    </section>
1782
</div>
1 www 1783
 
1784
<div id="divEdit" style="display: none">
1785
 
1786
    <section class="content-header">
3766 stevensc 1787
        <div class="container-fluid">
1788
            <div class="row mb-2">
1789
                <div class="col-sm-12">
1790
                    <h1 class="btn-edit-back"><i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_EDIT_JOB</h1>
1 www 1791
 
3766 stevensc 1792
                </div>
1793
            </div>
1794
        </div><!-- /.container-fluid -->
1 www 1795
    </section>
3766 stevensc 1796
 
1 www 1797
    <section class="content">
3766 stevensc 1798
        <div class="container-fluid">
1 www 1799
 
3766 stevensc 1800
            <div class="row">
1801
                <div class="col-lg-3">
1802
                </div>
1803
                <div class="col-lg-6">
1804
                    <div class="main-ws-sec">
1 www 1805
 
3766 stevensc 1806
                        <!--user-profile-ov end -->
1807
                        <div class="user-profile-ov">
1808
                            <h3>
1809
                                LABEL_STATUS <a href="#" title="" class="btn-status-edit"> <i class="fa fa-pencil"></i></a>
1810
                            </h3>
1811
                            <p id="overview-status"></p>
1812
                        </div>
1 www 1813
 
3766 stevensc 1814
                        <div class="user-profile-ov">
1815
                            <h3>LABEL_TITLE
1816
                                <a href="#" title="" class="btn-title-edit"><i class="fa fa-pencil"></i></a>
1817
                            </h3>
1818
                            <p id="overview-title"></p>
1819
                        </div>
1820
                        <div class="user-profile-ov">
1821
                            <h3>LABEL_OVERVIEW
1822
                                <a href="#" title="" class="btn-extended-edit"><i class="fa fa-pencil"></i></a>
1823
                            </h3>
1824
                            <p id="overview-description"></p>
1825
                        </div>
1826
                        <!--user-profile-ov end-->
1827
                        <div class="user-profile-ov st2">
1828
                            <h3>LABEL_LAST_DATE_OF_APPLICATION
1829
                                <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>
1830
                            </h3>
1831
                            <span id="overview-last-date-of-application"></span>
1832
                        </div>
1833
                        <!--user-profile-ov end-->
1834
                        <div class="user-profile-ov">
1835
                            <h3>LABEL_EMPLOYMENT_TYPE
1836
                                <a href="#" title="" class="btn-employment-type-edit"><i class="fa fa-pencil"></i></a>
1837
                            </h3>
1838
                            <span id="overview-employment-type"></span>
1839
                        </div>
1840
                        <!--user-profile-ov end-->
1841
                        <div class="user-profile-ov">
1842
                            <h3>
1843
                                <a href="#" title="">LABEL_LOCATION</a>
1844
                                <a href="#" title="" class="btn-location-edit"><i class="fa fa-pencil"></i></a>
1845
                            </h3>
1846
                            <span id="overview-location"></span>
1847
                        </div>
1848
                        <!--user-profile-ov end-->
1849
                        <div class="user-profile-ov">
1850
                            <h3>
1851
                                LABEL_EXPERIENCE
1852
                                <a href="#" title="" class="btn-experience-edit"><i class="fa fa-pencil"></i></a>
1853
                            </h3>
1854
                            <span id="overview-experience"> </span>
1855
                        </div>
1856
                        <!--user-profile-ov end-->
1857
                        <div class="user-profile-ov">
1858
                            <h3>
1859
                                LABEL_SALARY
1860
                                <a href="#" title="" class="btn-salary-edit"><i class="fa fa-pencil"></i></a>
1861
                            </h3>
1862
                            <span id="overview-salary"></span>
1863
                        </div>
1864
                        <!--user-profile-ov end-->
1865
                        <div class="user-profile-ov">
1866
                            <h3>
1867
                                LABEL_CATEGORIE
1868
                                <a href="#" title="" class="btn-job-category-edit"><i class="fa fa-pencil"></i></a>
1869
                            </h3>
1870
                            <span id="overview-job-category"></span>
1871
                        </div>
1872
                        <!--user-profile-ov end-->
1873
                        <div class="user-profile-ov">
1874
                            <h3>
1875
                                LABEL_SKILLS <a href="#" title="" class="btn-skills-edit"> <i class="fa fa-pencil"></i></a>
1876
                            </h3>
1877
                            <ul id="list-skills">
1 www 1878
 
1879
 
3766 stevensc 1880
                            </ul>
1881
                        </div>
1882
                        <!--user-profile-ov end -->
1883
                        <div class="user-profile-ov">
1884
                            <h3>
1885
                                LABEL_LANGUAGES <a href="#" title="" class="btn-languages-edit"> <i class="fa fa-pencil"></i></a>
1886
                            </h3>
1887
                            <ul id="list-languages">
1 www 1888
 
3766 stevensc 1889
 
1890
                            </ul>
1891
                        </div>
1892
                        <!--user-profile-ov end -->
1893
                        <div class="user-profile-ov">
1894
                            <h3>
1895
                                LABEL_DEGREES <a href="#" title="" class="btn-degrees-edit"> <i class="fa fa-pencil"></i></a>
1896
                            </h3>
1897
                            <ul id="list-degrees">
1898
 
1899
 
1900
                            </ul>
1901
                        </div>
1902
 
1903
 
1904
 
1905
                    </div>
1906
                </div>
1907
                <div class="col-lg-3">
1908
                </div>
1909
            </div>
1910
        </div>
1911
    </section>
1 www 1912
</div>
1913
 
1914
<div class="modal" tabindex="-1" role="dialog" id="add-job-box">
3766 stevensc 1915
    <div class="modal-dialog" role="document">
1916
        <?php
1917
        $form = $this->formAdd;
1918
        $form->setAttributes([
1919
            'method'    => 'post',
1920
            'name'      => 'form-add',
1921
            'id'        => 'form-add'
1922
        ]);
1923
        $form->prepare();
1924
        echo $this->form()->openTag($form);
1925
 
1926
        $fieldnames = [
1927
            'formatted_address',
1928
            'address1',
1929
            'address2',
1930
            'country',
1931
            'state',
1932
            'city1',
1933
            'city2',
1934
            'postal_code',
1935
            'latitude',
1936
            'longitude',
1937
        ];
1938
 
1939
        foreach ($fieldnames as $fieldname) {
1940
 
1941
            $element = $form->get($fieldname);
1942
            echo $this->formHidden($element);
1943
        }
1944
        ?>
1945
        <div class="modal-content">
1946
            <div class="modal-header">
1947
                <h3 class="modal-title">LABEL_NEW_JOB</h3>
1948
            </div>
1949
            <div class="modal-body">
1950
                <div class="form-group">
1951
                    <?php
1952
                    $element = $form->get('title');
1953
                    $element->setOptions(['label' => 'LABEL_TITLE']);
1954
                    $element->setAttributes(['class' => 'form-control']);
1955
                    echo $this->formLabel($element);
1956
                    echo $this->formText($element);
1 www 1957
                    ?>
3766 stevensc 1958
                </div>
1959
                <div class="form-group">
1960
                    <?php
1961
                    $element = $form->get('employment_type');
1962
                    $element->setAttributes(['class' => 'form-control']);
1963
                    $element->setOptions(['empty_option' => 'LABEL_SELECT_EMPLOYMENT_TYPE', 'label' => 'LABEL_EMPLOYMENT_TYPE']);
1964
                    echo $this->formLabel($element);
1965
                    echo $this->formSelect($element);
1 www 1966
                    ?>
3766 stevensc 1967
                </div>
1968
                <div class="form-group">
1969
                    <?php
1970
                    $element = $form->get('last_date_of_application');
1971
                    $element->setAttributes(['class' => 'form-control']);
1972
                    $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
1973
                    echo $this->formLabel($element);
1974
                    echo $this->formText($element);
1 www 1975
                    ?>
3766 stevensc 1976
                </div>
1977
 
1978
                <div class="form-group">
1979
                    <?php
1980
                    $element = $form->get('job_category_id');
1981
                    $element->setOptions(['empty_option' => 'LABEL_SELECT_JOB_CATEGORY', 'label' => 'LABEL_JOB_CATEGORY']);
1982
                    $element->setAttributes(['class' => 'form-control']);
1983
                    echo $this->formLabel($element);
1984
                    echo $this->formSelect($element);
1 www 1985
                    ?>
3766 stevensc 1986
                </div>
1987
                <div class="form-group">
1988
                    <?php
1989
                    $element = $form->get('location_search');
1990
                    $element->setAttributes(['name' => 'add_location_search',  'id' => 'add_location_search', 'class' => 'form-control']);
1991
                    $element->setOptions(['label' => 'LABEL_LOCATION']);
1992
                    echo $this->formLabel($element);
1993
                    echo $this->formText($element);
1 www 1994
                    ?>
3766 stevensc 1995
                </div>
1996
            </div>
1997
 
1998
            <div class="modal-footer">
1999
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2000
                <button type="button" class="btn btn-default btn-add-job-cancel">LABEL_CANCEL</button>
2001
            </div>
2002
            <?php echo $this->form()->closeTag($form); ?>
2003
        </div>
2004
    </div>
1 www 2005
</div>
3766 stevensc 2006
 
2007
 
1 www 2008
<!-- The Modal -->
2009
<div class="modal" id="modalUsersWhoApplied">
3766 stevensc 2010
    <div class="modal-dialog modal-xl">
2011
        <div class="modal-content">
1 www 2012
 
2013
            <!-- Modal Header -->
3766 stevensc 2014
            <div class="modal-header">
2015
                <h4 class="modal-title">LABEL_USERS_WHO_APPLIED</h4>
2016
                <button type="button" class="close" data-dismiss="modal">&times;</button>
2017
            </div>
1 www 2018
 
2019
            <!-- Modal body -->
3766 stevensc 2020
            <div class="modal-body">
2021
                <div style="height: 300px;overflow: scroll;">
2022
                    <table id="gridTableUsersWhoApplied" style="width: 100%" class="table table-bordered table-hover">
2023
                        <thead>
2024
                            <tr>
2025
                                <th>LABEL_FIRST_NAME</th>
2026
                                <th>LABEL_LAST_NAME</th>
2027
                                <th>LABEL_EMAIL</th>
2028
                                <th>LABEL_ACTIONS</th>
2029
                            </tr>
2030
                        </thead>
2031
                        <tbody>
2032
                        </tbody>
2033
                    </table>
2034
                </div>
1 www 2035
 
3766 stevensc 2036
            </div>
2037
 
1 www 2038
            <!-- Modal footer -->
3766 stevensc 2039
            <div class="modal-footer">
2040
                <button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
2041
            </div>
1 www 2042
 
3766 stevensc 2043
        </div>
2044
    </div>
2045
</div>
1 www 2046
 
2047
<div class="modal" tabindex="-1" role="dialog" id="extended-box">
3766 stevensc 2048
    <div class="modal-dialog" role="document">
2049
        <?php
1 www 2050
        $form = $this->formExtended;
2051
        $form->setAttributes([
2052
            'method' => 'post',
2053
            'name' => 'form-extended',
2054
            'id' => 'form-extended'
2055
        ]);
2056
        $form->prepare();
2057
        echo $this->form()->openTag($form);
3766 stevensc 2058
        ?>
2059
        <div class="modal-content">
2060
            <div class="modal-header">
2061
                <h3 class="modal-title">LABEL_OVERVIEW</h3>
2062
            </div>
2063
            <div class="modal-body">
1 www 2064
                <div class="form-group">
3766 stevensc 2065
                    <?php
2066
                    $element = $form->get('description');
2067
                    $element->setOptions(['label' => 'LABEL_OVERVIEW']);
2068
                    $element->setAttributes(['class' => 'form-control']);
2069
                    echo $this->formLabel($element);
2070
                    echo $this->formTextArea($element);
2071
                    ?>
1 www 2072
                </div>
3766 stevensc 2073
            </div>
2074
            <div class="modal-footer">
2075
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2076
                <button type="button" class="btn btn-default btn-extended-close">LABEL_CANCEL</button>
2077
            </div>
2078
            <?php echo $this->form()->closeTag($form); ?>
2079
        </div>
2080
    </div>
1 www 2081
</div>
2082
 
2083
<div class="modal" tabindex="-1" role="dialog" id="location-box">
3766 stevensc 2084
    <div class="modal-dialog" role="document">
2085
        <?php
1 www 2086
        $form = $this->formLocation;
2087
        $form->setAttributes([
2088
            'method' => 'post',
2089
            'name' => 'form-location',
2090
            'id' => 'form-location'
2091
        ]);
2092
        $form->prepare();
2093
        echo $this->form()->openTag($form);
3766 stevensc 2094
 
1 www 2095
        $fieldnames = [
2096
            'formatted_address',
2097
            'address1',
2098
            'address2',
2099
            'country',
2100
            'state',
2101
            'city1',
2102
            'city2',
2103
            'postal_code',
2104
            'latitude',
2105
            'longitude',
2106
        ];
3766 stevensc 2107
 
2108
        foreach ($fieldnames as $fieldname) {
2109
 
1 www 2110
            $element = $form->get($fieldname);
2111
            echo $this->formHidden($element);
2112
        }
2113
        ?>
3766 stevensc 2114
        <div class="modal-content">
2115
            <div class="modal-header">
2116
                <h3 class="modal-title">LABEL_LOCATION</h3>
2117
            </div>
2118
            <div class="modal-body">
2119
                <div class="form-group datefm">
2120
                    <?php
2121
                    $element = $form->get('location_search');
2122
                    $element->setOptions(['label' => 'LABEL_LOCATION']);
2123
                    $element->setAttributes(['class' => 'form-control']);
2124
                    echo $this->formLabel($element);
2125
                    echo $this->formText($element);
1 www 2126
                    ?>
3766 stevensc 2127
                    <i class="fa fa-map-marker"></i>
2128
                </div>
2129
            </div>
2130
            <div class="modal-footer">
2131
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2132
                <button type="button" class="btn btn-default btn-location-close">LABEL_CANCEL</button>
2133
            </div>
2134
            <?php echo $this->form()->closeTag($form); ?>
2135
        </div>
2136
    </div>
2137
</div>
1 www 2138
 
2139
<div class="modal" tabindex="-1" role="dialog" id="employment-type-box">
3766 stevensc 2140
    <div class="modal-dialog" role="document">
2141
        <?php
1 www 2142
        $form = $this->formEmploymentType;
2143
        $form->setAttributes([
2144
            'method' => 'post',
2145
            'name' => 'form-employment-type',
2146
            'id' => 'form-employment-type'
2147
        ]);
2148
        $form->prepare();
2149
        echo $this->form()->openTag($form);
3766 stevensc 2150
        ?>
2151
        <div class="modal-content">
2152
            <div class="modal-header">
2153
                <h3 class="modal-title">LABEL_EMPLOYMENT_TYPE</h3>
2154
            </div>
2155
            <div class="modal-body">
1 www 2156
                <div class="form-group">
3766 stevensc 2157
                    <?php
2158
                    $element = $form->get('employment_type');
2159
                    $element->setOptions(['label' => 'LABEL_EMPLOYMENT_TYPE']);
2160
                    $element->setAttributes(['class' => 'form-control']);
2161
                    echo $this->formLabel($element);
2162
                    echo $this->formSelect($element);
2163
                    ?>
1 www 2164
                </div>
3766 stevensc 2165
            </div>
2166
            <div class="modal-footer">
2167
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2168
                <button type="button" class="btn btn-default btn-employment-type-close">LABEL_CANCEL</button>
2169
            </div>
2170
            <?php echo $this->form()->closeTag($form); ?>
2171
        </div>
2172
    </div>
2173
</div>
1 www 2174
 
2175
<div class="modal" tabindex="-1" role="dialog" id="job-category-box">
3766 stevensc 2176
    <div class="modal-dialog" role="document">
2177
        <?php
1 www 2178
        $form = $this->formJobCategory;
2179
        $form->setAttributes([
2180
            'method' => 'post',
2181
            'name' => 'form-job-category',
2182
            'id' => 'form-job-category'
2183
        ]);
2184
        $form->prepare();
2185
        echo $this->form()->openTag($form);
3766 stevensc 2186
        ?>
2187
        <div class="modal-content">
2188
            <div class="modal-header">
2189
                <h3 class="modal-title">LABEL_JOB_CATEGORY</h3>
2190
            </div>
2191
            <div class="modal-body">
1 www 2192
                <div class="form-group">
3766 stevensc 2193
                    <?php
2194
                    $element = $form->get('job_category_id');
2195
                    $element->setOptions(['label' => 'LABEL_JOB_CATEGORY']);
2196
                    $element->setAttributes(['class' => 'form-control']);
2197
                    echo $this->formLabel($element);
2198
                    echo $this->formSelect($element);
2199
                    ?>
1 www 2200
                </div>
3766 stevensc 2201
            </div>
2202
            <div class="modal-footer">
2203
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2204
                <button type="button" class="btn btn-default btn-job-category-close">LABEL_CANCEL</button>
2205
            </div>
2206
            <?php echo $this->form()->closeTag($form); ?>
2207
        </div>
2208
    </div>
2209
</div>
1 www 2210
 
2211
<div class="modal" tabindex="-1" role="dialog" id="salary-box">
3766 stevensc 2212
    <div class="modal-dialog" role="document">
2213
        <?php
1 www 2214
        $form = $this->formSalary;
2215
        $form->setAttributes([
2216
            'method' => 'post',
2217
            'name' => 'form-salary',
2218
            'id' => 'form-salary'
2219
        ]);
2220
        $form->prepare();
2221
        echo $this->form()->openTag($form);
3766 stevensc 2222
        ?>
2223
        <div class="modal-content">
2224
            <div class="modal-header">
2225
                <h3 class="modal-title">LABEL_SALARY</h3>
2226
            </div>
2227
            <div class="modal-body">
1 www 2228
                <div class="form-group">
3766 stevensc 2229
                    <?php
2230
                    $element = $form->get('salary_visible');
2231
                    echo $this->formCheckbox($element);
2232
                    ?>
1 www 2233
                </div>
2234
                <div class="form-group">
3766 stevensc 2235
                    <?php
2236
                    $element = $form->get('salary_currency');
2237
                    $element->setAttributes(['class' => 'form-control']);
2238
                    $element->setOptions(['label' => 'LABEL_CURRENCY']);
2239
                    echo $this->formLabel($element);
2240
                    echo $this->formSelect($element);
2241
                    ?>
1 www 2242
                </div>
3766 stevensc 2243
                <div class="form-group">
2244
                    <?php
2245
                    $element = $form->get('salary_min');
2246
                    $element->setOptions(['label' => 'LABEL_MINIMUM']);
2247
                    $element->setAttributes(['class' => 'form-control']);
2248
                    echo $this->formLabel($element);
2249
                    echo $this->formText($element);
2250
                    ?>
1 www 2251
                </div>
2252
                <div class="form-group">
3766 stevensc 2253
                    <?php
2254
                    $element = $form->get('salary_max');
2255
                    $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2256
                    $element->setAttributes(['class' => 'form-control']);
2257
                    echo $this->formLabel($element);
2258
                    echo $this->formText($element);
2259
                    ?>
1 www 2260
                </div>
3766 stevensc 2261
            </div>
2262
            <div class="modal-footer">
2263
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2264
                <button type="button" class="btn btn-default btn-salary-close">LABEL_CANCEL</button>
2265
            </div>
2266
            <?php echo $this->form()->closeTag($form); ?>
2267
        </div>
2268
    </div>
2269
</div>
1 www 2270
 
2271
<div class="modal" tabindex="-1" role="dialog" id="experience-box">
3766 stevensc 2272
    <div class="modal-dialog" role="document">
2273
        <?php
1 www 2274
        $form = $this->formExperience;
2275
        $form->setAttributes([
2276
            'method' => 'post',
2277
            'name' => 'form-experience',
2278
            'id' => 'form-experience'
2279
        ]);
2280
        $form->prepare();
2281
        echo $this->form()->openTag($form);
3766 stevensc 2282
        ?>
2283
        <div class="modal-content">
2284
            <div class="modal-header">
2285
                <h3 class="modal-title">LABEL_EXPERIENCE</h3>
2286
            </div>
2287
            <div class="modal-body">
1 www 2288
                <div class="form-group">
3766 stevensc 2289
                    <?php
2290
                    $element = $form->get('experience_visible');
2291
 
2292
                    echo $this->formCheckbox($element);
2293
                    ?>
1 www 2294
                </div>
3766 stevensc 2295
                <div class="form-group">
2296
                    <?php
2297
                    $element = $form->get('experience_min');
2298
                    $element->setOptions(['label' => 'LABEL_MINIMUM']);
2299
                    $element->setAttributes(['class' => 'form-control']);
2300
                    echo $this->formLabel($element);
2301
                    echo $this->formText($element);
2302
                    ?>
1 www 2303
                </div>
2304
                <div class="form-group">
3766 stevensc 2305
                    <?php
2306
                    $element = $form->get('experience_max');
2307
                    $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2308
                    $element->setAttributes(['class' => 'form-control']);
2309
                    echo $this->formLabel($element);
2310
                    echo $this->formText($element);
2311
                    ?>
1 www 2312
                </div>
3766 stevensc 2313
            </div>
2314
            <div class="modal-footer">
2315
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2316
                <button type="button" class="btn btn-default btn-experience-close">LABEL_CANCEL</button>
2317
            </div>
2318
            <?php echo $this->form()->closeTag($form); ?>
2319
        </div>
2320
    </div>
2321
</div>
1 www 2322
 
2323
 
2324
<div class="modal" tabindex="-1" role="dialog" id="skills-box">
3766 stevensc 2325
    <div class="modal-dialog" role="document">
2326
        <?php
2327
        $form = $this->formSkill;
2328
        $form->setAttributes([
2329
            'method' => 'post',
2330
            'name' => 'form-skill',
2331
            'id' => 'form-skill'
2332
        ]);
2333
        $form->prepare();
2334
        echo $this->form()->openTag($form);
2335
        ?>
2336
        <div class="modal-content">
2337
            <div class="modal-header">
2338
                <h3 class="modal-title">LABEL_SKILLS</h3>
2339
            </div>
2340
            <div class="modal-body">
1 www 2341
                <div class="form-group">
3766 stevensc 2342
                    <?php
1 www 2343
                    $element = $form->get('skills');
2344
                    $element->setOptions(['label' => 'LABEL_SKILLS']);
2345
                    $element->setAttributes(['class' => 'form-control']);
2346
                    echo $this->formLabel($element);
2347
                    echo $this->formSelect($element);
3766 stevensc 2348
                    ?>
1 www 2349
                </div>
3766 stevensc 2350
            </div>
2351
 
2352
 
2353
            <div class="modal-footer">
2354
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2355
                <button type="button" class="btn btn-default btn-skills-close">LABEL_CANCEL</button>
2356
            </div>
2357
            <?php echo $this->form()->closeTag($form); ?>
2358
        </div>
2359
    </div>
1 www 2360
</div>
2361
 
2362
<div class="modal" tabindex="-1" role="dialog" id="languages-box">
3766 stevensc 2363
    <div class="modal-dialog" role="document">
2364
        <?php
1 www 2365
        $form = $this->formLanguage;
2366
        $form->setAttributes([
2367
            'method' => 'post',
2368
            'name' => 'form-language',
2369
            'id' => 'form-language'
2370
        ]);
2371
        $form->prepare();
2372
        echo $this->form()->openTag($form);
3766 stevensc 2373
        ?>
2374
        <div class="modal-content">
2375
            <div class="modal-header">
2376
                <h3 class="modal-title">LABEL_LANGUAGES</h3>
2377
            </div>
2378
            <div class="modal-body">
1 www 2379
                <div class="form-group">
3766 stevensc 2380
                    <?php
1 www 2381
                    $element = $form->get('languages');
2382
                    $element->setOptions(['label' => 'LABEL_LANGUAGES']);
2383
                    $element->setAttributes(['class' => 'form-control']);
2384
                    echo $this->formLabel($element);
2385
                    echo $this->formSelect($element);
3766 stevensc 2386
                    ?>
1 www 2387
                </div>
3766 stevensc 2388
            </div>
2389
            <div class="modal-footer">
2390
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2391
                <button type="button" class="btn btn-default btn-languages-close">LABEL_CANCEL</button>
2392
            </div>
2393
            <?php echo $this->form()->closeTag($form); ?>
2394
        </div>
2395
    </div>
1 www 2396
</div>
2397
 
2398
<div class="modal" tabindex="-1" role="dialog" id="last-date-of-application-box">
3766 stevensc 2399
    <div class="modal-dialog" role="document">
2400
        <?php
2401
        $form = $this->fromLastDateOfApplication;
1 www 2402
        $form->setAttributes([
2403
            'method' => 'post',
2404
            'name' => 'form-last-date-of-application',
2405
            'id' => 'form-last-date-of-application'
2406
        ]);
2407
        $form->prepare();
2408
        echo $this->form()->openTag($form);
3766 stevensc 2409
        ?>
2410
        <div class="modal-content">
2411
            <div class="modal-header">
2412
                <h3 class="modal-title">LABEL_LAST_DATE_OF_APPLICATION</h3>
2413
            </div>
2414
            <div class="modal-body">
1 www 2415
                <div class="form-group">
3766 stevensc 2416
                    <?php
1 www 2417
                    $element = $form->get('last_date_of_application');
2418
                    $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
2419
                    $element->setAttributes(['class' => 'form-control']);
2420
                    echo $this->formLabel($element);
2421
                    echo $this->formText($element);
3766 stevensc 2422
                    ?>
1 www 2423
                </div>
3766 stevensc 2424
            </div>
2425
            <div class="modal-footer">
2426
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2427
                <button type="button" class="btn btn-default btn-last-date-of-application-close">LABEL_CANCEL</button>
2428
            </div>
2429
            <?php echo $this->form()->closeTag($form); ?>
2430
        </div>
2431
    </div>
1 www 2432
</div>
2433
 
2434
<div class="modal" tabindex="-1" role="dialog" id="degrees-box">
3766 stevensc 2435
    <div class="modal-dialog" role="document">
2436
        <?php
1 www 2437
        $form = $this->formDegree;
2438
        $form->setAttributes([
2439
            'method' => 'post',
2440
            'name' => 'form-degree',
2441
            'id' => 'form-degree'
2442
        ]);
2443
        $form->prepare();
2444
        echo $this->form()->openTag($form);
3766 stevensc 2445
        ?>
2446
        <div class="modal-content">
2447
            <div class="modal-header">
2448
                <h3 class="modal-title">LABEL_DEGREES</h3>
2449
            </div>
2450
            <div class="modal-body">
1 www 2451
                <div class="form-group">
3766 stevensc 2452
                    <?php
1 www 2453
                    $element = $form->get('degrees');
2454
                    $element->setOptions(['label' => 'LABEL_DEGREES']);
2455
                    $element->setAttributes(['class' => 'form-control']);
2456
                    echo $this->formLabel($element);
2457
                    echo $this->formSelect($element);
3766 stevensc 2458
                    ?>
1 www 2459
                </div>
3766 stevensc 2460
            </div>
2461
            <div class="modal-footer">
2462
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2463
                <button type="button" class="btn btn-default btn-degrees-close">LABEL_CANCEL</button>
2464
            </div>
2465
            <?php echo $this->form()->closeTag($form); ?>
2466
        </div>
2467
    </div>
1 www 2468
</div>
2469
 
2470
<div class="modal" tabindex="-1" role="dialog" id="status-box">
3766 stevensc 2471
    <div class="modal-dialog" role="document">
2472
        <?php
2473
        $form = $this->formStatus;
2474
        $form->setAttributes([
2475
            'method' => 'post',
2476
            'name' => 'form-status',
2477
            'id' => 'form-status'
2478
        ]);
2479
        $form->prepare();
2480
        echo $this->form()->openTag($form);
2481
        ?>
2482
        <div class="modal-content">
2483
            <div class="modal-header">
2484
                <h3 class="modal-title">LABEL_STATUS</h3>
2485
            </div>
2486
            <div class="modal-body">
1 www 2487
                <div class="form-group">
3766 stevensc 2488
                    <?php
1 www 2489
                    $element = $form->get('status');
2490
                    $element->setOptions(['label' => 'LABEL_STATUS']);
2491
                    $element->setAttributes(['class' => 'form-control']);
2492
                    echo $this->formLabel($element);
2493
                    echo $this->formSelect($element);
3766 stevensc 2494
                    ?>
1 www 2495
                </div>
3766 stevensc 2496
            </div>
2497
 
2498
 
2499
            <div class="modal-footer">
2500
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2501
                <button type="button" class="btn btn-default btn-status-close">LABEL_CANCEL</button>
2502
            </div>
2503
            <?php echo $this->form()->closeTag($form); ?>
2504
        </div>
2505
    </div>
1 www 2506
</div>
2507
 
2508
<div class="modal" tabindex="-1" role="dialog" id="title-box">
3766 stevensc 2509
    <div class="modal-dialog" role="document">
2510
        <?php
2511
        $form = $this->formTitle;
2512
        $form->setAttributes([
2513
            'method' => 'post',
2514
            'name' => 'form-title',
2515
            'id' => 'form-title'
2516
        ]);
2517
        $form->prepare();
2518
        echo $this->form()->openTag($form);
2519
        ?>
2520
        <div class="modal-content">
2521
            <div class="modal-header">
2522
                <h3 class="modal-title">LABEL_TITLE</h3>
2523
            </div>
2524
            <div class="modal-body">
1 www 2525
                <div class="form-group">
3766 stevensc 2526
                    <?php
1 www 2527
                    $element = $form->get('title');
2528
                    $element->setOptions(['label' => 'LABEL_TITLE']);
2529
                    $element->setAttributes(['class' => 'form-control']);
2530
                    echo $this->formLabel($element);
2531
                    echo $this->formText($element);
3766 stevensc 2532
                    ?>
1 www 2533
                </div>
3766 stevensc 2534
            </div>
2535
 
2536
 
2537
            <div class="modal-footer">
2538
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2539
                <button type="button" class="btn btn-default btn-title-close">LABEL_CANCEL</button>
2540
            </div>
2541
            <?php echo $this->form()->closeTag($form); ?>
2542
        </div>
2543
    </div>
1 www 2544
</div>