Edit File: profile.blade.php
@extends('layouts.stores_dashboard_layout') @section('title') {{trans('stores_dashboard.settings_profile')}} @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('stores_dashboard.settings')}}</h6> <p class="mb-1">{{trans('stores_dashboard.settings_profile')}}</p> </div> </div> <form id="postForm" > @csrf <div class=" white-bg round7 mb-3 mt-2 p-3"> <h6 class="bold border-bottom pt-3 pb-3 mb-4">{{trans('stores_dashboard.profile_info')}}</h6> <div class="w-md-75 "> <input type="hidden" value="{{$user->id}}" name="id"> <div class="form-group"> <div class="row align-items-center justify-content-start "> <div class=" "> <label for="file1"> <div class="input-img-cont "> <img src="{{$user->AvatarPath}}" id="view1" class="input-img" alt=""> <img src="{{URL::to('site/imgs/icons/camera.png')}}" class="input-img-camera" alt=""> </div> <input onchange="viewImg(event ,'#view1')" class="d-none" type="file" name="avatar" id="file1"> </label> </div> <div class="col"> <h6 class="bold font14">{{trans('stores_dashboard.avatar')}}</h6> </div> </div> </div> <div class="form-group"> <label class="bold font14" for="Password1"> {{trans('stores_dashboard.name')}} </label> <div class="password-cont"> <input value="{{$user->name}}" name="name" type="text" class="form-control" aria-describedby="emailHelp" placeholder="{{trans('stores_dashboard.name')}}"> <i class="fa fa-edit color-gray" ></i> </div> </div> <div class="form-group"> <label class="bold font14" for="exampleInputEmail1">{{trans('stores_dashboard.phone')}}<span style="color: #ff3333;margin: auto 20px;"> * </span></label> <div class="row"> <div class="col-4 col-md-2 p-1 pr-0"> <select name="country_key" class="form-control"> @foreach($countries as $country) @if($user->country_key == $country->calling_code) <option value="{{$country->calling_code}}" selected >{{$country->calling_code}}</option> @else <option value="{{$country->calling_code}}" >{{$country->calling_code}}</option> @endif @endforeach </select> </div> <div class="col pt-1 pb-1 pl-0 pr-1"> <div class="form-group"> <div class="password-cont"> <input name="phone" class="form-control" type='number' aria-describedby="emailHelp" value="{{$user->phone}}" placeholder="{{trans('stores_dashboard.phone')}}"> <i class="fa fa-edit color-gray" ></i> </div> </div> </div> </div> </div> <div class="form-group"> <label class="bold font14" for="Password1"> {{trans('stores_dashboard.email')}} </label> <div class="password-cont"> <input name="email" type="email" class="form-control" aria-describedby="emailHelp" value="{{$user->email}}" placeholder="{{trans('stores_dashboard.email')}}"> <i class="fa fa-edit color-gray" ></i> </div> </div> </div> </div> <button id="postbtn" class="button1 mt-3 material-button" >{{trans('stores_dashboard.save')}} </button> </form> </div> </div> <!-- end of dashboard body --> </div> <!-- start page content --> <!-- end page content --> @endsection @section('scripts') <script> $("#postbtn").on('click',function(e){ e.preventDefault(); var form = $('#postForm').get(0); var formData = new FormData(form); var oldText = $(this).text(); $(this).prop('disabled', true).css({ opacity:'0.5' }).text("{{trans('stores_dashboard.loading')}}"); $.ajax({ url:"{{route('stores_dashboard.post_edit_profile')}}", type:"POST", data: formData, dataType: "json", processData: false, contentType: false, cache: false, success:function(data){ $('#postbtn').removeAttr("disabled").css({ opacity:'1' }).text(oldText); if(data.key =='success'){ Swal.fire({ title: data.msg, position:'top', timer: 3000, 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> <script> $(function(){ $('.side-button .active').siblings('.side-dropdown').slideDown(); }); </script> @endsection
Back to File Manager