From ae16527a952071c9683f52e822b4b208eeb0fbd5 Mon Sep 17 00:00:00 2001 From: suseendhiran17 <58357088+suseendhiran17@users.noreply.github.com> Date: Tue, 3 Jan 2023 12:03:55 +0530 Subject: [PATCH] suseendhiran --- application/modules/User/views/business.php | 52 ----------- .../modules/User/views/change_password.php | 48 ---------- application/modules/User/views/profile.php | 53 ----------- assets/default/customize/ajax.js | 91 +++++++++++++++++++ 4 files changed, 91 insertions(+), 153 deletions(-) diff --git a/application/modules/User/views/business.php b/application/modules/User/views/business.php index 00ec748..9fdf4b8 100644 --- a/application/modules/User/views/business.php +++ b/application/modules/User/views/business.php @@ -1,30 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - -
-
-
@@ -113,30 +88,3 @@
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/application/modules/User/views/change_password.php b/application/modules/User/views/change_password.php index 6ab3b9d..cdcf912 100644 --- a/application/modules/User/views/change_password.php +++ b/application/modules/User/views/change_password.php @@ -76,54 +76,6 @@ -
diff --git a/application/modules/User/views/profile.php b/application/modules/User/views/profile.php index 2ed390e..8fdffd4 100644 --- a/application/modules/User/views/profile.php +++ b/application/modules/User/views/profile.php @@ -1,30 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - -
-
-
@@ -112,31 +87,3 @@
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/assets/default/customize/ajax.js b/assets/default/customize/ajax.js index f854157..a7cb10e 100644 --- a/assets/default/customize/ajax.js +++ b/assets/default/customize/ajax.js @@ -147,4 +147,95 @@ $( document ).ready(function() { } }); + + +// ------------------------------------------------------ +$(document).on('click','#submit',function(){ + var data = $("#change-pass").serialize(); + $.ajax({ + type: "post", + url: "user/check_password", + data: data, + json: true, + success: function(response) { + if (response === "success") { + // location.href = "auth"; + } + else { + $('#message1').html('Worng password').css('color', 'red'); + alert(response); + } + }, + error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) } + }); + }); + + + // match the password and confirm password equal or not + $('#password, #confirm_password').on('keyup', function () { + $(':input[type="submit"]').prop('disabled', true); + if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val().length > 0 ) { + $('#message').html('Matching').css('color', 'green'); + $('button[type="submit"]').attr("disabled", false); + } + else if($('#password').val().length == 0 || $('#confirm_password').val().length == 0){ + $('#message').html(''); + } + else + $('#message').html('Not Matching').css('color', 'red'); + }); + + // password eye icon + $(".toggle-password").click(function() { + $(this).toggleClass("fa-eye fa-eye-slash"); + var input = $($(this).attr("toggle")); + if (input.attr("type") == "password") { + input.attr("type", "text"); + } + else { + input.attr("type", "password"); + } + }); + + // match the password and confirm password equal or not +$('#password, #confirm_password').on('keyup', function () { + $(':input[type="submit"]').prop('disabled', true); + if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val().length > 0 ) { + $('#message').html('Matching').css('color', 'green'); + $('button[type="submit"]').attr("disabled", false); + } + else if($('#password').val().length == 0 || $('#confirm_password').val().length == 0){ + $('#message').html(''); + } + else + $('#message').html('Not Matching').css('color', 'red'); + }); + + // password eye icon + $(".toggle-password").click(function() { + $(this).toggleClass("fa-eye fa-eye-slash"); + var input = $($(this).attr("toggle")); + if (input.attr("type") == "password") { + input.attr("type", "text"); + } + else { + input.attr("type", "password"); + } + }); + + // sadmin create admin onchange function select permit as all default + $('#role').on('change', function() { + if(this.value == "admin") + { + $('#action_permit').html(''); + $('#action_permit').attr("style", "pointer-events: none;"); + } + else + { + $('#action_permit').attr("style", "pointer-events: default;"); + $('#action_permit').html(` + + `); + } + }); \ No newline at end of file