HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: /var/www/javago-portal-updates/resources/views/cafe/edit-profile.blade.php
<x-app-layout>
    <x-slot name="css">
        <link rel="stylesheet" href="{{ asset('assets/css/components/custom-modal.css') }}">
        <link rel="stylesheet" href="{{ asset('plugins/select2/select2.min.css') }}">
        <style>
            /* Chrome, Safari, Edge, Opera */
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button {
                -webkit-appearance: none;
                margin: 0;
            }

            /* Firefox */
            input[type=number] {
                -moz-appearance: textfield;
            }

            .form-group label,
            label {
                text-transform: capitalize;
            }
        </style>
    </x-slot>
    <x-app-breadcrumb>
        @if (Auth::getDefaultDriver() == config('constants.cafe'))
            <li class="breadcrumb-item">
                <a href="{{ $cancelUrl }}" class="breadcrumb_home">
                    {{ __('common.myProfile') }}
                </a>
            </li>
            <li class="breadcrumb-item active" aria-current="page">{{ __('common.editProfile') }}</li>
        @endif
        @if (Auth::getDefaultDriver() == config('constants.admin'))
            <li class="breadcrumb-item">
                <a href="{{ $cancelUrl }}" class="breadcrumb_home">
                    {{ __('common.CafeManagement') }}
                </a>
            </li>
            <li class="breadcrumb-item active" aria-current="page">{{ __('common.editCafe') }}</li>
        @endif
    </x-app-breadcrumb>
    <!-- Modal -->
    <div class="modal fade" id="setCafeHoursModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header border-remove-model">
                    <h3 class="modal-title fw-bold" id="exampleModalLabel">
                        <strong>{{ __('common.setCafeHours') }}</strong>
                    </h3>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <svg class="mt-2 model-close" width="25" height="25" viewBox="0 0 25 25" fill="none"
                            stroke="currentColor" stroke-width="2">
                            <path
                                d="M12.5002 22.9168C18.2531 22.9168 22.9168 18.2531 22.9168 12.5002C22.9168 6.7472 18.2531 2.0835 12.5002 2.0835C6.7472 2.0835 2.0835 6.7472 2.0835 12.5002C2.0835 18.2531 6.7472 22.9168 12.5002 22.9168Z"
                                stroke-linecap="round" stroke-linejoin="round" />
                            <path d="M15.625 9.375L9.375 15.625" stroke-linecap="round" stroke-linejoin="round" />
                            <path d="M9.375 9.375L15.625 15.625" stroke-linecap="round" stroke-linejoin="round" />
                        </svg>
                    </button>
                </div>
                {{-- add set cafe hours from --}}
                {{-- <form id="set_cafe_hours_from" data-action="{{ $setHoursUrl }}"> --}}
                <form id="set_cafe_hours_from" action="{{ $setHoursUrl }}" method="POST">
                    @csrf
                    @method('PUT')
                    <div class="modal-body pb-0">
                        @foreach ($timing as $time)
                            <div class="form-group d-flex">
                                <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 mx-0 px-0 form-group">
                                    <label class="form-label d-flex">
                                        <svg class="mr-2 svg-cafe-hours" width="25" height="24"
                                            viewBox="0 0 25 24" fill="none" stroke="currentColor" stroke-width="2">
                                            <path
                                                d="M12.0444 22C17.5673 22 22.0444 17.5228 22.0444 12C22.0444 6.47715 17.5673 2 12.0444 2C6.52159 2 2.04443 6.47715 2.04443 12C2.04443 17.5228 6.52159 22 12.0444 22Z"
                                                stroke-linecap="round" stroke-linejoin="round" />
                                            <path d="M12.0444 6V12L16.0444 14" stroke-linecap="round"
                                                stroke-linejoin="round" />
                                        </svg>
                                        <span>{{ $days[$time->day] }}</span>
                                    </label>
                                </div>
                                <div class="col-xl-3 col-lg-3 col-md-3 col-sm-3 form-group">
                                    <input type="text" class="form-control px-3 open_time" maxlength="5"
                                        name="cafe[{{ $time->day }}][open_time]" placeholder=""
                                        value="{{ $time->open_time != '' ? $time->open_time : '' }}">
                                </div>
                                <div class="col-xl-1 col-lg-1 col-md-1 col-sm-1 mx-0 px-0 text-center form-group">
                                    <label class="form-label">{{ __('common.to') }}</label>
                                </div>
                                <div class="col-xl-3 col-lg-3 col-md-3 col-sm-3 form-group">
                                    <input type="text" class="form-control px-3 close_time" maxlength="5"
                                        name="cafe[{{ $time->day }}][close_time]" placeholder=""
                                        value="{{ $time->close_time != '' ? $time->close_time : '' }}">
                                </div>
                                <div class="col-xl-1 col-lg-1 col-md-1 col-sm-1 mx-0 px-0 form-group">
                                    <label class="switch s-coffee-medium-light">
                                        <input type="checkbox" class="is_active"
                                            name="cafe[{{ $time->day }}][is_active]" value="1"
                                            {{ $time->is_active == 1 ? 'checked=' : '' }}>
                                        <span class="slider round"></span>
                                    </label>
                                </div>
                            </div>
                        @endforeach
                    </div>
                    <div class="modal-footer justify-content-start border-remove-model">
                        {{-- <button type="button" id="set_cafe_hours" class="btn btn-coffee-dark">{{ __('common.Save') }}</button> --}}
                        <button type="submit" id="set_cafe_hours"
                            class="btn btn-coffee-dark"
                            {{-- data-dismiss="modal" aria-label="Close" --}}
                            >{{ __('common.Save') }}</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="page-header row">
        <div class="page-title col-12 d-flex pr-4">
            <h3 class="my-auto">{{ __('common.editProfile') }}
            </h3>
            <button type="button" class="d-flex ml-auto btn btn-coffee-medium py-2 px-3" data-toggle="modal"
                data-target="#setCafeHoursModel">
                <svg class="mr-2 my-1" width="25" height="24" viewBox="0 0 25 24" fill="none"
                    stroke="currentColor" stroke-width="2">
                    <path
                        d="M12.0444 22C17.5673 22 22.0444 17.5228 22.0444 12C22.0444 6.47715 17.5673 2 12.0444 2C6.52159 2 2.04443 6.47715 2.04443 12C2.04443 17.5228 6.52159 22 12.0444 22Z"
                        stroke-linecap="round" stroke-linejoin="round" />
                    <path d="M12.0444 6V12L16.0444 14" stroke-linecap="round" stroke-linejoin="round" />
                </svg>
                <span class="my-1" id="getCafeHours" {{-- data-action={{ $editHoursUrl }} --}}>{{ __('common.setCafeHours') }}</span>
            </button>
        </div>
    </div>

    <div class="row layout-top-spacing">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
            {{-- <x-flash-message></x-flash-message> --}}
            <div class="row">
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <form class="mt-4" method="POST" id="edit_profile_form" action="{{ $url }}"
                        enctype="multipart/form-data">
                        @csrf
                        @method('PUT')
                        <input type="hidden" name="latitude" id="latitude" hidden
                            value="{{ isset($latitude) && $latitude != null ? $latitude : '' }}">
                        <input type="hidden" name="longitude" id="longitude" hidden
                            value="{{ isset($longitude) && $longitude != null ? $longitude : '' }}">
                        <div class="row mt-4">
                            <div class="col-xl-3 col-lg-3 col-md-4 col-sm-4 col-4">
                                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 px-0 form-group mb-4">
                                    <label for=""
                                        class="form-label mb-3">{{ __('common.bannerImage') }}</label>
                                    <label class="picture" for="picture__input" tabIndex="0">
                                        <span class="picture__image">
                                            <img src="{{ isset($banner_image) && $banner_image != '' ? asset($banner_image) : asset('assets/img/400x300.jpg') }}"
                                                class="picture__img">
                                        </span>
                                    </label>
                                    <input type="file" name="picture__input" id="picture__input"
                                        accept="image/jpg, image/jpeg, image/png">
                                </div>
                                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 px-0 form-group mb-4">
                                    <label for="cafe_filter" class="form-label">{{ __('common.cafe_filter') }}*</label>
                                    <select id="cafe_filter" name="cafe_filter[]" multiple="multiple"
                                        class="form-control @error('cafe_type') is-invalid @enderror">
                                        <option value="">{{ __('common.selectCafeFilter') }}</option>
                                        @foreach ($CafeFilter as $index => $filter)
                                            <option {{ isset($cafe_filter) && in_array($index, $cafe_filter) ? 'selected' : '' }}
                                                value="{{ $index }}">{{ $filter }}
                                            </option>
                                        @endforeach
                                    </select>
                                    @error('cafe_type')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>
                            <div class="col-xl-9 col-lg-9 col-md-8 col-sm-12 col-12 row justify-content-end p-0">
                                <div class="col-xl-5 col-lg-5 col-md-12 col-sm-12 col-12 form-group mb-4">
                                    <label for="cafe_name" class="form-label">{{ __('common.cafe_name') }}*</label>
                                    <input type="text"
                                        class="form-control @error('cafe_name') is-invalid @enderror" id="cafe_name"
                                        name="cafe_name" placeholder="{{ __('common.EnterCafeName') }}"
                                        value="{{ isset($name) && $name != '' ? $name : '' }}">
                                    @error('cafe_name')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div
                                    class="col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 form-group mb-4 offset-xl-1 offset-lg-1 offset-md-1">
                                    <label for="email" class="form-label">{{ __('common.email') }}*</label>
                                    <input type="text" class="form-control @error('email') is-invalid @enderror"
                                        id="email" name="email" placeholder="{{ __('common.EnterEmail') }}"
                                        value="{{ isset($email) && $email != '' ? $email : '' }}">
                                    @error('email')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div class="col-xl-5 col-lg-5 col-md-12 col-sm-12 col-12 form-group mb-4">
                                    <label for="phone" class="form-label">{{ __('common.phone') }}</label>
                                    <input type="text" class="form-control @error('phone') is-invalid @enderror"
                                        id="phone" name="phone" placeholder="{{ __('common.EnterPhone') }}"
                                        value="{{ isset($phone) && $phone != '' ? $phone : '' }}">
                                    @error('phone')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div
                                    class="col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 form-group mb-4 offset-xl-1 offset-lg-1 offset-md-1">
                                    <label for="cafe_type" class="form-label">{{ __('common.cafe_type') }}</label>
                                    <select id="cafe_type" name="cafe_type"
                                        class="form-control @error('cafe_type') is-invalid @enderror">
                                        @foreach ($types as $index => $type)
                                            <option value="{{ $index }}">{{ $type }}
                                            </option>
                                        @endforeach
                                    </select>
                                    @error('cafe_type')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div
                                    class="col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 form-group mb-4">
                                    <label for="address" class="form-label">{{ __('common.address') }}*</label>
                                    <input type="text"
                                        class="form-control text-wrap @error('address') is-invalid @enderror"
                                        id="address" name="address" placeholder="{{ __('common.EnterAddress') }}"
                                        value="{{ isset($address) && $address != '' ? $address : '' }}">
                                    @error('address')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div
                                    class="col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 form-group mb-4 offset-xl-1 offset-lg-1 offset-md-1">
                                    <label for="postcode" class="form-label">{{ __('common.postcode') }}*</label>
                                    <input type="text" class="form-control @error('postcode') is-invalid @enderror"
                                        maxlength="10" id="postcode" name="postcode"
                                        placeholder="{{ __('common.EnterPostcode') }}"
                                        value="{{ isset($postcode) && $postcode != '' ? $postcode : '' }}">
                                    @error('postcode')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div class="col-xl-5 col-lg-5 col-md-12 col-sm-12 col-12 form-group mb-4">
                                    <label for="bio" class="form-label">{{ __('common.bio') }}*</label>
                                    <textarea class="form-control @error('bio') is-invalid @enderror" id="bio" name="bio" rows="3"
                                        placeholder="{{ __('common.EnterBio') }}">{{ isset($bio) && $bio != '' ? $bio : '' }}</textarea>
                                    @error('bio')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                                <div class="col-xl-5 col-lg-5 col-md-12 col-sm-12 col-12 form-group mb-4 offset-xl-1 offset-lg-1 offset-md-1">
                                    <label for="website" class="form-label">{{ __('common.website') }}</label>
                                    <input type="text" class="form-control @error('website') is-invalid @enderror"
                                        id="website" name="website" placeholder="{{ __('common.EnterWebsite') }}"
                                        value="{{ isset($website) && $website != '' ? $website : '' }}">
                                    @error('website')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 mx-0 px-0">
                            <a href="{{ $cancelUrl }}"
                                class="btn btn-coffee-dark mt-4 py-2 px-4">{{ __('common.Cancel') }}</a>
                            <button type="submit"
                                class="btn btn-coffee-light mt-4 mx-3 py-2 px-4">{{ __('common.Save') }}</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <x-slot name="script">
        <script src="{{ asset('assets/js/libs/jquery.validate.min.js') }}"></script>
        <script src="{{ asset('assets/js/libs/additional-methods.min.js') }}"></script>
        <script src="{{ asset('plugins/select2/select2.min.js') }}"></script>
        <script>
            const imageFound = "{{ isset($banner_image) && $banner_image != '' }}";
            const upload = "{{ __('common.upload') }}";
            const maxSize = 500;
            const validation = {};
            validation.cafe_name_required = "{{ __('validation.validation.cafe_name.required') }}";
            validation.cafe_name_minlength = "{{ __('validation.validation.cafe_name.minlength') }}";
            validation.cafe_name_maxlength = "{{ __('validation.validation.cafe_name.maxlength') }}";
            validation.email_required = "{{ __('validation.validation.email.required') }}";
            validation.email_email = "{{ __('validation.validation.email.email') }}";
            validation.email_customEmail = "{{ __('validation.validation.email.customEmail') }}";
            validation.phone_required = "{{ __('validation.validation.phone.required') }}";
            validation.phone_minlength = "{{ __('validation.validation.phone.minlength') }}";
            validation.phone_maxlength = "{{ __('validation.validation.phone.maxlength') }}";
            validation.phone_maxlength = "{{ __('validation.validation.phone.maxlength') }}";
            validation.phone_regex = "{{ __('validation.validation.phone.regex') }}";
            validation.phone_pattern = "{{ __('validation.validation.phone.pattern') }}";
            validation.cafe_type_required = "{{ __('validation.validation.cafe_type.required') }}";
            validation.bio_required = "{{ __('validation.validation.bio.required') }}";
            validation.bio_minlength = "{{ __('validation.validation.bio.minlength') }}";
            validation.bio_maxlength = "{{ __('validation.validation.bio.maxlength') }}";
            validation.address_required = "{{ __('validation.validation.address.required') }}";
            validation.address_minlength = "{{ __('validation.validation.address.minlength') }}";
            validation.address_maxlength = "{{ __('validation.validation.address.maxlength') }}";
            validation.postcode_required = "{{ __('validation.validation.postcode.required') }}";
            validation.postcode_minlength = "{{ __('validation.validation.postcode.minlength') }}";
            validation.postcode_maxlength = "{{ __('validation.validation.postcode.maxlength') }}";
            validation.website_required = "{{ __('validation.validation.website.required') }}";
            validation.website_minlength = "{{ __('validation.validation.website.minlength') }}";
            validation.website_maxlength = "{{ __('validation.validation.website.maxlength') }}";
            validation.image_extension = "{{ __('validation.validation.image.extensionMimes') }}";
            validation.image_maxSize = "{{ __('validation.validation.image.maxsize') }}";
            validation.regexTime = "{{ __('validation.validation.time.regexTime') }}";
            validation.open_time_required = "{{ __('validation.validation.open_time.required') }}";
            validation.open_time_maxlength = "{{ __('validation.validation.open_time.maxlength') }}";
            validation.close_time_required = "{{ __('validation.validation.close_time.required') }}";
            validation.close_time_maxlength = "{{ __('validation.validation.close_time.maxlength') }}";
            validation.cafe_filter_required = "{{ __('validation.validation.cafe_filter.required') }}";
            const selectCafeFilter = "{{ __('common.selectCafeFilter') }}";
        </script>
        <script src="{{ asset('assets/js/inputImagePreview.js') }}"></script>
        <script src="{{ asset('assets/js/cafe/editProfile.js') }}"></script>
        <script src="{{ asset('assets/js/cafe/editCafeHours.js') }}"></script>
        <script type="text/javascript" src="{{ $urlGoogleAPI }}&callback=initAutocomplete" async defer></script>
        <script src="{{ asset('assets/js/getLatLng.js') }}"></script>
    </x-slot>
</x-app-layout>