diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-06 00:46:19 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-06 00:46:19 +0300 |
| commit | 1388a64651f1c61a6aafc32f8e3e60f7a6ffd339 (patch) | |
| tree | dd5bcd7b438929ffec89d32011144831eebabb06 /public/app/views/js/submit/update-password.php | |
| parent | d5475ce60729c3f743a6451b42072f1a13ffed59 (diff) | |
| download | gyraf1gov-1388a64651f1c61a6aafc32f8e3e60f7a6ffd339.tar.gz gyraf1gov-1388a64651f1c61a6aafc32f8e3e60f7a6ffd339.tar.bz2 gyraf1gov-1388a64651f1c61a6aafc32f8e3e60f7a6ffd339.zip | |
admin petition ready
Diffstat (limited to 'public/app/views/js/submit/update-password.php')
| -rw-r--r-- | public/app/views/js/submit/update-password.php | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/public/app/views/js/submit/update-password.php b/public/app/views/js/submit/update-password.php new file mode 100644 index 0000000..625d7cd --- /dev/null +++ b/public/app/views/js/submit/update-password.php @@ -0,0 +1,61 @@ +<script> + $(document).ready(function() { + + // When form is submited + //////////////////////////////////////////////////////////////////////////// + + $('form').submit( event => { + event.preventDefault(); + + if ($('input[name=password]').val() != $('input[name=confirm_password]').val()) { + alert('Τα δυο κωδικοί πρόσβασης δεν ταιριάζουν!'); + + } else if ($('input[name=password]').val() == "") { + alert('Ο κωδικός πρόσβασης δεν μπορεί να είναι κενός') + + } else if ( ($('input[name=password]').val() == '0') + || ($('input[name=password]').val() =='') ) { + alert('Παρκαλώ συμπληρώστε ένα τηλέφωνο επικοινωνίας') + + } else if ($('input[name=oldpass]').val() == "") { + alert('Παρκαλώ συμπληρώστε τον τρέχοντα κωδικό πρόβασης') + + } else { + + // prepare data to POST + var data = { + // identification fields + id: $('input[name=id]').val(), + // data fields + oldpass: $('input[name=oldpass]').val(), + password: $('input[name=password]').val(), + }; + console.log(data); + + var request = '/user/update/password'; // set action url + + // send POST request + $.post(request, data) + .done(function( data ) { + $('.office .content-form').html(`<h4>${data.title}<h4><br>${data.message}`) + }); + } + + }); + + + + // go-back event + //////////////////////////////////////////////////////////////////////////// + + $('.btn-back2panel').click( event => { + event.preventDefault(); + + let confirm_exit = confirm('<?=CONFIRM_EXIT?>'); + if (confirm_exit) { + window.location.href = '/panel'; + } + }); + + }); +</script>
\ No newline at end of file |
