Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/resources/views/front/travelAgent/profile.blade.php
Назад
@extends('front.layouts.travel-agent-master', ['is_travel_agent' => true]) @section('title', 'Profile Settings') @section('content') <!-- Profile EDIT SECTION BEGIN --> <section class="portfolio-edit-sec"> <div class="container-fluid"> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-12"> <div class="portfolio-edit-flex"> @include('front.travelAgent.setting-sidebar') <div class="scrollbar2" id="style-3"> <div class="force-overflow"> <div class="right-setting-cont"> <h5>My Profile</h5> @if (session('success')) <div class="alert alert-success"> {{ session('success') }} </div> @endif <form id="profile-form" action="{{ route('agent.profile.setting.update') }}" method="POST"> @csrf <div class="form-label-xont"> <label>Full Name <a href="javascript:void(0)" id="edit-input">Edit</a></label> <input type="text" class="form-control @error('full_name') is-invalid @enderror" name="full_name" value="{{ old('full_name', auth()->user()->full_name) }}" readonly> @error('full_name') <div class="invalid-feedback"> {{ $message }} </div> @enderror </div> <div class="form-label-xont"> <label>Specialist</label> <textarea name="specialist" id="specialist" class="form-control @error('specialist') is-invalid @enderror" maxlength="30" readonly>{{ old('specialist', auth()->user()->specialist ?? 'N/A') }}</textarea> <div id="specialist-counter" class="d-none">30 characters remaining</div> @error('specialist') <div class="invalid-feedback"> {{ $message }} </div> @enderror </div> <div class="form-label-xont"> <label>Summary</label> <textarea name="summary" id="summary" cols="4" rows="4" readonly class="form-control @error('summary') is-invalid @enderror">{{ old('summary', auth()->user()->summary) }}</textarea> <div id="summary-counter" class="d-none">700 characters remaining</div> @error('summary') <div class="invalid-feedback"> {{ $message }} </div> @enderror </div> <div class="form-label-xont"> <label>Languages</label> <input name="languages" type="text" class="form-control tagify @error('languages') is-invalid @enderror" id="languages" value="{{ old('languages', auth()->user()->languages) }}" readonly> @error('languages') <div class="invalid-feedback"> {{ $message }} </div> @enderror </div> <div class="form-label-xont"> <label for="yearsExperience">Years of experience</label> <select id="yearsExperience" class="form-control" name="years_of_experience" disabled> <option value="" disabled {{ is_null(auth()->user()->years_of_experience) ? 'selected' : '' }}>Select Years</option> @for ($i = 1; $i <= 30; $i++) <option value="{{ $i }}" {{ auth()->user()->years_of_experience == $i ? 'selected' : '' }}> {{ $i }} Year{{ $i > 1 ? 's' : '' }} </option> @endfor </select> </div> <div class="form-label-xont"> <label>Destination you serve</label> <input name="destinationsTagify" id="destinationSelect" class="form-control tagify @error('destinations') is-invalid @enderror" placeholder="Select Destinations You Serve" value="{{ old('destinationsTagify') }}" readonly /> <input type="hidden" name="destinations" id="destinations" value="{{ old('destinations') }}"> @error('destinations') <div class="invalid-feedback"> {{ $message }} </div> @enderror </div> {{-- @dd($errors->all()); --}} {{-- <div class="form-label-xont"> <label>Countries you serve</label> <input name="countriesTagify" id="countrySelect" class="form-control tagify @error('countries') is-invalid @enderror" placeholder="Select Countries You Serve:" value="{{ old('countriesTagify') }}" readonly /> <input type="hidden" name="countries" id="countries" value="{{ old('countries') }}"> @error('countries') <div class="invalid-feedback" style="display: block"> {{ $message }} </div> @enderror </div> --}} <div class="form-label-xont"> <label>Categories you serve</label> <input name="categoriesTagify" id="categoriesSelect" class="form-control tagify @error('categories') is-invalid @enderror" placeholder="Select Categories You Serve:" value="{{ old('categoriesTagify') }}" readonly /> <input type="hidden" name="categories" id="categories" value="{{ old('categories') }}"> @error('categories') <div class="invalid-feedback" style="display: block"> {{ $message }} </div> @enderror </div> <div class="save-changes-setting"> <button type="submit" class="btn btn-primary" id="save-btn" style="display: none;">Save changes</button> </div> </form> </div> </div> </div> </div> </div> </div> </section> <!-- Profile EDIT SECTION END --> @endsection @push('front-scripts') {{-- <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v1.9.4/dist/alpine.js"></script> --}} <script src="{{ asset('assets/admin/vendor/libs/tagify/tagify.js') }}"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </script> <script> var hasValidationErrors = {{ $errors->any() ? 'true' : 'false' }}; </script> <script> // TOGGLE FIELDS HIDE & SHOW SCRIPT BEGIN $(".pass-shw").click(function() { $(".fields-hide-show").toggle(); }); // TOGGLE FIELDS HIDE & SHOW SCRIPT END // EYE ICON HIDE & SHOW PASSSWORD SCRIPT BEGIN function togglePassword(eyeIcon) { const passwordField = eyeIcon .closest(".pass-grd-field") .querySelector(".password-field"); if (passwordField.type === "password") { passwordField.type = "text"; eyeIcon.classList.remove("fa-eye"); eyeIcon.classList.add("fa-eye-slash"); } else { passwordField.type = "password"; eyeIcon.classList.remove("fa-eye-slash"); eyeIcon.classList.add("fa-eye"); } } // EYE ICON HIDE & SHOW PASSSWORD SCRIPT END </script> <script> document.addEventListener('DOMContentLoaded', function() { const languageInput = document.getElementById('languages'); const languageTagify = new Tagify(languageInput, { whitelist: {!! json_encode(explode(',', auth()->user()->languages)) !!}, maxTags: 10, enforceWhitelist: false, dropdown: { maxItems: 50, classname: "tags-look", enabled: 0, closeOnSelect: false } }); //Destination var $destinationSelect = $('#destinationSelect'); var destinationInput = document.querySelector('input[name="destinationsTagify"]'); var hiddenDestinationInput = document.querySelector('input[name="destinations"]'); var selectedDestinations = {!! json_encode($selectedDestinations) !!}; // $('#destinationSelect').on('change', function() { // var selectedDestinations = $(this).val(); // Get selected destinations // fetchCountriesByDestinations( // selectedDestinations); // Call the function with selected destinations // }); var oldDestinations = "{{ old('destinations') }}".split(',').filter(function(item) { return item.trim().length > 0; }); // Initialize Tagify var destinationTagify = new Tagify(destinationInput, { enforceWhitelist: true, whitelist: {!! json_encode($destinationsData) !!}, dropdown: { maxItems: 200, enabled: 0, closeOnSelect: false } }); if (oldDestinations.length > 0) { hiddenDestinationInput.value = oldDestinations.join(','); } else { // Use selectedDestinations if no old values are present destinationTagify.addTags(selectedDestinations); hiddenDestinationInput.value = selectedDestinations.map(tag => tag.name).join(','); } destinationTagify.on('change', function() { var selectedDestinationIds = destinationTagify.value.map(tag => tag.name); hiddenDestinationInput.value = selectedDestinationIds.join(','); // Clear hidden input if no destinations are selected if (selectedDestinationIds.length === 0) { hiddenDestinationInput.value = ''; } }); // function fetchCountriesByDestinations(selectedDestinations) { // $.ajax({ // url: '{{ route('get.countries.by.destination') }}', // type: 'GET', // data: { // destination_ids: selectedDestinations // Adjusted payload // }, // success: function(countries) { // var currentTags = countryTagify.value.map(tag => tag.value); // countryTagify.settings.whitelist = countries.map(country => ({ // value: country.value, // name: country.name // })); // var newTags = currentTags.filter(tagValue => // countryTagify.settings.whitelist.some(country => country.value === // tagValue) // ); // countryTagify.removeAllTags(); // countryTagify.addTags(newTags); // $countryField.show(); // } // }); // } @error('destinations') // Clear the Tagify input if there's an error and old value is empty destinationTagify.removeAllTags(); hiddenDestinationInput.value = ''; @enderror // TODO: json encode add curlybraces and !! // var countries = json_encode($selectedCountries) ; // var selectedCountries = json_encode($selectedCountries); // var $countryField = $('#countrySelect').closest('.form-label-xont'); // var countryInput = document.querySelector('input[name="countriesTagify"]'); // var hiddenCountryInput = document.querySelector('input[name="countries"]'); // var countryTagify = new Tagify(countryInput, { // enforceWhitelist: true, // whitelist: countries, // dropdown: { // maxItems: 200, // enabled: 0, // closeOnSelect: false // } // }); // var oldCountries = "{{ old('countries') }}".split(',').filter(function(item) { // return item.trim().length > 0; // }); // if (oldCountries.length > 0) { // countryTagify.addTags(oldCountries); // hiddenCountryInput.value = oldCountries.join(','); // } else { // countryTagify.addTags(selectedCountries); // hiddenCountryInput.value = selectedCountries.map(tag => tag.name).join(','); // } // countryTagify.on('change', function() { // var selectedCountryIds = countryTagify.value.map(tag => tag.name); // hiddenCountryInput.value = selectedCountryIds.join(','); // if (selectedCountryIds.length === 0) { // hiddenCountryInput.value = ''; // } // }); // @error('countries') // countryTagify.removeAllTags(); // hiddenCountryInput.value = ''; // var selectedDestinations = $('#destinationSelect').val(); // fetchCountriesByDestinations( // selectedDestinations); // Call the function with selected destinations // @enderror // $destinationSelect.on('change', function() { // var selectedDestinations = $(this).val(); // if (selectedDestinations && selectedDestinations.length > 0) { // $.ajax({ // url: '{{ route('get.countries.by.destination') }}', // type: 'GET', // data: { // destination_ids: selectedDestinations // }, // success: function(countries) { // var currentTags = countryTagify.value.map(tag => tag.value); // countryTagify.settings.whitelist = countries.map(country => ({ // value: country.value, // name: country.name // })); // var newTags = currentTags.filter(tagValue => // countryTagify.settings.whitelist.some(country => country // .value === tagValue) // ); // countryTagify.removeAllTags(); // countryTagify.addTags(newTags); // $countryField.show(); // } // }); // } else { // // If no destinations are selected, clear and hide the country field // $countryField.hide(); // countryTagify.removeAllTags(); // hiddenCountryInput.value = ''; // } // }); var selectedCategories = {!! json_encode($selectedCategories) !!}; var categoriesInput = document.querySelector('input[name="categoriesTagify"]'); var hiddenCategoriesInput = document.querySelector('input[name="categories"]'); var categoriesTagify = new Tagify(categoriesInput, { enforceWhitelist: true, whitelist: {!! json_encode($categoriesData) !!}, dropdown: { maxItems: 200, enabled: 0, closeOnSelect: false } }); var oldCategories = "{{ old('categories') }}".split(',').filter(function(item) { return item.trim().length > 0; }); if (oldCategories.length > 0) { categoriesTagify.addTags(oldCategories); hiddenCategoriesInput.value = oldCategories.join(','); } else { categoriesTagify.addTags(selectedCategories); hiddenCategoriesInput.value = selectedCategories.map(tag => tag.name).join(','); } categoriesTagify.on('change', function() { var selectedCategoryIds = categoriesTagify.value.map(tag => tag.name); hiddenCategoriesInput.value = selectedCategoryIds.join(','); if (selectedCategoryIds.length === 0) { hiddenCategoriesInput.value = ''; } }); @error('categories') categoriesTagify.removeAllTags(); hiddenCategoriesInput.value = ''; @enderror var isEditing = hasValidationErrors; $('input, textarea').prop('readonly', !hasValidationErrors); $('#save-btn').hide(); destinationTagify.setReadonly(!hasValidationErrors); categoriesTagify.setReadonly(!hasValidationErrors); // countryTagify.setReadonly(!hasValidationErrors); languageTagify.setReadonly(!hasValidationErrors); $('#yearsExperience').prop('disabled', !hasValidationErrors); $('#edit-input').data('editing', hasValidationErrors).text(hasValidationErrors ? 'Cancel' : 'Edit'); $('#specialist-counter, #summary-counter').toggleClass('d-none', !hasValidationErrors); $('#edit-input').click(function() { isEditing = !isEditing; $('input, textarea').prop('readonly', !isEditing); if (isEditing) { $('#save-btn').show(); } else { $('#save-btn').hide(); } destinationTagify.setReadonly(!isEditing); categoriesTagify.setReadonly(!isEditing); // countryTagify.setReadonly(!isEditing); languageTagify.setReadonly(!isEditing); $('#yearsExperience').prop('disabled', !isEditing); $('#specialist-counter, #summary-counter').toggleClass('d-none', !isEditing); $(this).data('editing', isEditing).text(isEditing ? 'Cancel' : 'Edit'); }); }); document.addEventListener('DOMContentLoaded', function() { const textareas = [{ element: document.getElementById('specialist'), counter: document.getElementById('specialist-counter'), max: 30 }, { element: document.getElementById('summary'), counter: document.getElementById('summary-counter'), max: 700 } ]; function updateCounter(textarea) { const remaining = textarea.max - textarea.element.value.length; textarea.counter.textContent = `${Math.max(remaining, 0)} /${textarea.max}`; if (remaining < 0) textarea.element.value = textarea.element.value.substring(0, textarea.max); } textareas.forEach(textarea => { updateCounter(textarea); textarea.element.addEventListener('input', () => updateCounter(textarea)); }); }); // PROFILE PAGE HEIGHT SETTING SCRIPT BEGIN const container = document.querySelector(".scrollbar2"); function checkHeight() { if (container.scrollHeight > 710) { container.classList.add("exceed"); } else { container.classList.remove("exceed"); } } checkHeight(); window.addEventListener("resize", checkHeight); // PROFILE PAGE HEIGHT SETTING SCRIPT END </script> @endpush
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка