diff --git a/resources/views/js/modals.blade.php b/resources/views/js/modals.blade.php index 6a16ad0..740c2d5 100644 --- a/resources/views/js/modals.blade.php +++ b/resources/views/js/modals.blade.php @@ -85,6 +85,54 @@ } } + function successfulRegistrationWorker() { + $.fancybox.close(); + + $('#email_worker').val(''); + $('#password_worker').val(''); + $('#password_confirmation_worker').val(''); + $('#politik').prop('checked', false); + $('#telephone_worker').val(''); + $('#job_titles_worker').val('').trigger('change'); + $('#surname_worker').val(''); + $('#name_man_worker').val(''); + $('#surname2_worker').val(''); + $('#cpatchaTextBox1').val(''); + + $('#block-info').hide(); + $('#messages_error_reg').html(''); + + $.fancybox.open({ + src: '#successful-registration', + type: 'inline', + opts: {touch: false} + }); + } + + function successfulRegistrationEmployer() { + $.fancybox.close(); + + $('#email_employer').val(''); + $('#password_employer').val(''); + $('#password_confirmation_employer').val(''); + $('#politik').prop('checked', false); + $('#telephone_employer').val(''); + $('#surname_employer').val(''); + $('#name_man_employer').val(''); + $('#surname2_employer').val(''); + $('#company_employer').val(''); + $('#cpatchaTextBox1').val(''); + + $('#block-info').hide(); + $('#messages_error_reg').html(''); + + $.fancybox.open({ + src: '#successful-registration', + type: 'inline', + opts: {touch: false} + }); + } + $(document).on('click', '#button_send', function() { var field_login = $('#email_input'); var field_pwd = $('#password'); @@ -165,9 +213,6 @@ return false; } - - console.log('login: '+login+' password: '+pwd); - $.ajax({ type: "GET", url: "{{ route('register_worker') }}", @@ -178,27 +223,7 @@ console.log('Вход в систему'); let d = JSON.parse(data); if (typeof d['REDIRECT'] !== "undefined") { - $.fancybox.close(); - - $('#email_worker').val(''); - $('#password_worker').val(''); - $('#password_confirmation_worker').val(''); - $('#politik').prop('checked', false); - $('#telephone_worker').val(''); - $('#job_titles_worker').val('').trigger('change'); - $('#surname_worker').val(''); - $('#name_man_worker').val(''); - $('#surname2_worker').val(''); - $('#cpatchaTextBox1').val(''); - - $('#block-info').hide(); - $('#messages_error_reg').html(''); - - $.fancybox.open({ - src: '#successful-registration', - type: 'inline', - opts: {touch: false} - }); + successfulRegistrationWorker() } if (typeof d['ERROR'] !== "undefined") { @@ -284,8 +309,7 @@ console.log('Вход в систему'); let d = JSON.parse(data); if(typeof d['REDIRECT'] !== "undefined") { - console.log(d['REDIRECT']); - location.href = d['REDIRECT']; + successfulRegistrationEmployer() } if (typeof d['ERROR'] !== "undefined") { console.log(d['ERROR']); diff --git a/resources/views/modals/successful_registration.blade.php b/resources/views/modals/successful_registration.blade.php index 35ce9cb..4755fb3 100644 --- a/resources/views/modals/successful_registration.blade.php +++ b/resources/views/modals/successful_registration.blade.php @@ -2,6 +2,5 @@