File manager - Edit - /home/autoph/public_html/connectv1/lms/resources/views/common/scripts/signup.js
Back
var init_signup = function() { init_toastr(); return $.ajax({ url: "resources/views/signup.php", data: {}, type: "POST", beforeSend: function() { show_hide_preloader(true); }, success: function(data) { document.title = 'Sign up'; side_menu_loaded = false; $('#header_content').html(''); $('#main_content').html(data); $("#dealer").select2({ // tags:true, // multiple: true, placeholder: "Select dealer", allowClear: true, escapeMarkup: function(markup) { return markup; }, ajax: { url: 'app/models/dealer.php', dataType: 'json', delay: 250, data: function(data) { return { model: 'dealer_list', api: true, search: data.term // search term }; }, processResults: function(response) { return { results: response }; }, cache: true } }); $("#position").select2({ // tags:true, // multiple: true, placeholder: "Select position", allowClear: true, escapeMarkup: function(markup) { return markup; }, ajax: { url: 'app/models/position.php', dataType: 'json', delay: 250, data: function(data) { return { model: 'position_list', api: true, search: data.term // search term }; }, processResults: function(response) { return { results: response }; }, cache: true } }); $('#id_no').on('keyup',function() { str = $(this).val().trim() str = str.replace(/\s/g, '') $(this).val(str) }); $('#login_account').on('click', function() { init_signin(); }); $('#btn_signup').on('click', function() { if (check_if_empty_field($('#dealer'), 'Dealer is required.')) { return; } if (check_if_empty_field($('#id_no'), 'ID number is required.')) { return; } if (check_if_empty_field($('#firstname'), 'Firstname is required.')) { return; } if (check_if_empty_field($('#lastname'), 'Lastname is required.')) { return; } if (check_if_empty_field($('#email'), 'Email address is required.')) { return; } if (!isValidEmailAddress($('#email').val().trim())) { $('#email').focus(); toastr.remove(); toastr.error('Invalid email address.'); return; } if (check_if_empty_field($('#mobile'), 'Mobile is required.')) { return; } if ($('#mobile').val().trim().length < 10) { $('#mobile').focus(); toastr.remove(); toastr.error('Invalid mobile format.'); return; } if (check_if_empty_field($('#password'), 'Password is required.')) { return; } if ($('#password').val().trim().length < 6) { $('#password').focus(); toastr.remove(); toastr.error('Password must be 6 characters and above.'); return; } var $element = $("[json-signup]"); var json_data = generate_json('json-signup', $element); return $.ajax({ url: "app/models/user.php", data: { model: 'signup', api: true, json_data: json_data }, type: "POST", dataType: 'json', beforeSend: function() { toastr.remove(); toastr.info("Signing up."); }, success: function(result) { if (parseInt(result.status) === 1) { toastr.remove(); toastr.success(result.message); init_signin(); } else { toastr.remove(); toastr.error(result.message); } }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); }); show_hide_preloader(false); }, error: function() { toastr.remove(); toastr.error("Error has occurred. Try again.") } }); };
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings