Edit File: edit_password.blade.php
@extends('layouts.delegates_dashboard_layout') @section('title') {{Session::has('lang')&&Session::get('lang')=='en'?' update password':' تعديل كلمة المرور'}} @endsection @section('style') @endsection @section('content') <div class="table-cont p-2 "> <div class="row align-items-center"> <div class="dash-title col-md p-0 mt-0"> <h6 class="bold">{{trans('delegates_dashboard.settings')}}</h6> <p class="mb-1">{{trans('delegates_dashboard.settings')}} / {{trans('delegates_dashboard.profile_settings')}}</p> </div> </div> <form id="updateform" method="post" enctype="multipart/form-data"> @csrf <div class=" white-bg round7 mb-3 mt-2 p-3"> <h6 class="bold border-bottom pt-3 pb-3 mb-4"> {{trans('delegates_dashboard.change_password')}}</h6> <div class="w-md-75 "> <div class="form-group"> <label class="bold font14" for="Password1"> {{trans('delegates_dashboard.current_pass')}}</label> <div class="password-cont"> <input type="password" name="old_password" class="form-control" id="Password1" aria-describedby="emailHelp" placeholder="{{trans('delegates_dashboard.current_pass')}}"> <i class="fa fa-eye color-gray" id="signInShowPassword1"></i> </div> </div> <div class="form-group"> <label class="bold font14" for="Password3"> {{trans('delegates_dashboard.new_pass')}} </label> <div class="password-cont"> <input type="password" name="password" class="form-control" id="Password3" aria-describedby="emailHelp" placeholder=" {{trans('delegates_dashboard.new_pass')}}"> <i class="fa fa-eye color-gray" id="signInShowPassword3"></i> </div> </div> <div class="form-group"> <label class="bold font14" for="Password2"> {{trans('delegates_dashboard.password_confirm')}} </label> <div class="password-cont"> <input type="password" name="password_confirmation" class="form-control" id="Password2" aria-describedby="emailHelp" placeholder="{{trans('delegates_dashboard.password_confirm')}} "> <i class="fa fa-eye color-gray" id="signInShowPassword2"></i> </div> </div> </div> </div> <button type="submit" id="updatebtn" class="button1 mt-3 material-button" > {{trans('delegates_dashboard.save_changes')}} </button> </form> </div> @endsection @section('scripts') <script> $(function(){ $('.side-button .active').siblings('.side-dropdown').slideDown(); }); </script> <script> $("#updatebtn").on('click',function(e){ e.preventDefault(); var form = $('#updateform').get(0); var formData = new FormData(form); var oldText = $(this).text(); $(this).prop('disabled', true).css({ opacity:'0.5' }).text("{{trans('delegates_dashboard.loading')}}"); $.ajax({ url:"{{ route('delegates_dashboard.update_password') }}", type:"POST", data: formData, dataType: "json", processData: false, contentType: false, cache: false, success:function(data){ $('#updatebtn').removeAttr("disabled").css({ opacity:'1' }).text(oldText); if(data.key =='success'){ Swal.fire({ title: data.msg, position:'top', timer: 15000, type:'success', showCloseButton: false, showConfirmButton:false, animation: true }) location.assign(data.url); }else{ Swal.fire({ title: data.msg, position:'top', timer: 3000, type:'error', showCloseButton: false, showConfirmButton:false, animation: true }) } } }); }); </script> @endsection
Back to File Manager