Viewing file: b9bcb0cb97067f860f15255872d39374.php (14.72 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<div class="seller-hero-area border border-gray-100 dark:border-gray-600 p-6 rounded-lg shadow-[0px_4px_8px_0px_rgba(28,33,38,0.08)] bg-white dark:bg-gray-900"> <div class="flex flex-wrap items-center gap-5 justify-between"> <div class="flex gap-4 items-center"> <div class="bg-error-100 py-5 px-8 rounded-md heading-03"><?php echo e($rating_details['average']); ?></div> <div> <div class="flex gap-1 items-center mb-2"> <?php for($i = 0; $i < $rating_details['average']; $i++): ?> <?php if (isset($component)) { $__componentOriginald6a91a0bbf5ad92916b9b2075b1af144 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginald6a91a0bbf5ad92916b9b2075b1af144 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.frontend.icons.star-yellow','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?> <?php $component->withName('frontend.icons.star-yellow'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?> <?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginald6a91a0bbf5ad92916b9b2075b1af144)): ?> <?php $attributes = $__attributesOriginald6a91a0bbf5ad92916b9b2075b1af144; ?> <?php unset($__attributesOriginald6a91a0bbf5ad92916b9b2075b1af144); ?> <?php endif; ?> <?php if (isset($__componentOriginald6a91a0bbf5ad92916b9b2075b1af144)): ?> <?php $component = $__componentOriginald6a91a0bbf5ad92916b9b2075b1af144; ?> <?php unset($__componentOriginald6a91a0bbf5ad92916b9b2075b1af144); ?> <?php endif; ?> <?php endfor; ?> </div> <p class="heading-07 mb-0.5 text-gray-900 dark:text-white"><?php echo e($rating_details['average']); ?> <?php echo e(__('star_average_rating')); ?></p> <p class="body-sm-400 text-gray-600 dark:text-gray-300"><?php echo e($rating_details['total']); ?> <?php echo e(__('people_written_reviews')); ?></p> </div> </div>
<!-- Write review Button If Authenticate --> <?php if( auth()->check() && $user->id != auth()->id()): ?> <div> <?php if(!$already_review): ?> <button type="button" data-modal-target="review-modal" data-modal-toggle="review-modal" class="btn-primary"><?php echo e(__('write_review')); ?></button> <?php endif; ?>
<div id="review-modal" tabindex="-1" aria-hidden="true" class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 bg-black/50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full"> <div class="relative p-4 w-full max-w-2xl max-h-full"> <!-- Modal content --> <div class="relative bg-white rounded-lg shadow">
<form action="<?php echo e(route('frontend.seller.review')); ?>" method="post"> <?php echo csrf_field(); ?> <!-- Modal header --> <div class="flex items-center justify-between p-4 md:p-5 rounded-t"> <h3 class="text-xl font-semibold text-gray-900 "><?php echo e(__('write_review')); ?></h3> <button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center " data-modal-hide="review-modal"> <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" /> </svg> <span class="sr-only">Close modal</span> </button> </div>
<!-- displaying flash messages --> <div class="flash-messages px-4"></div>
<div class="p-4 pt-0 space-y-4"> <h6 class="heading-06 text-gray-900"><?php echo e(__('ratings')); ?>:</h6> <div id="rateYo"></div> <?php $__errorArgs = ['stars']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <span class="invalid-feedback d-block text-red-600"><?php echo e($message); ?></span> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div>
<input type="hidden" name="stars" id="rating" value="<?php echo e(old('stars')); ?>"> <input type="hidden" name="seller_id" value="<?php echo e($user->id); ?>"> <input type="hidden" name="seller_username" value="<?php echo e($user->username); ?>">
<div class="p-4 md:p-5 space-y-4"> <textarea name="comment" rows="4" id="description" class="<?php $__errorArgs = ['comment']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> border-danger <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> block p-2.5 w-full text-sm text-gray-900 rounded-lg border border-gray-100 focus:ring-blue-500 " placeholder="<?php echo e(__('your_review')); ?>"></textarea> <?php $__errorArgs = ['comment']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?> <span class="invalid-feedback d-block text-red-600"><?php echo e($message); ?></span> <?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?> </div> <div class="flex items-center p-4 md:p-5 rounded-b"> <button id="submit-rating-review" type="submit" class="btn-primary"> <?php echo e(__('publish_review')); ?>
</button> </div>
</form> </div> </div> </div>
</div> <?php endif; ?> <!-- Write review Button If Authenticate -->
<!-- Write review Button If Unauthorize --> <?php if( !auth('user')->check() && $user->id != auth('user')->id()): ?> <a href="<?php echo e(route('users.login')); ?>" class="login_required btn-primary"> <?php echo e(__('write_review')); ?>
</a> <?php endif; ?> <!-- Write review Button If Unauthorize -->
<div class="bg-primary-50 dark:bg-gray-700 flex justify-between items-center gap-8 p-6 rounded-md"> <div> <h2 class="heading-06 dark:text-white mb-2"><?php echo e($total_active_ad); ?></h2> <p class="body-md-400 text-gray-600 dark:text-gray-300"><?php echo e(__('active_ads')); ?></p> </div> <div class="bg-white text-primary-500 w-14 h-14 rounded-md inline-flex justify-center items-center"> <?php if (isset($component)) { $__componentOriginalc44ab6c236494a4af012ce657a7f5d4f = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginalc44ab6c236494a4af012ce657a7f5d4f = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.frontend.icons.outline-document','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?> <?php $component->withName('frontend.icons.outline-document'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?> <?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginalc44ab6c236494a4af012ce657a7f5d4f)): ?> <?php $attributes = $__attributesOriginalc44ab6c236494a4af012ce657a7f5d4f; ?> <?php unset($__attributesOriginalc44ab6c236494a4af012ce657a7f5d4f); ?> <?php endif; ?> <?php if (isset($__componentOriginalc44ab6c236494a4af012ce657a7f5d4f)): ?> <?php $component = $__componentOriginalc44ab6c236494a4af012ce657a7f5d4f; ?> <?php unset($__componentOriginalc44ab6c236494a4af012ce657a7f5d4f); ?> <?php endif; ?> </div> </div> </div> </div>
<?php $__env->startPush('css'); ?> <link rel="stylesheet" href="<?php echo e(asset('backend/css/jquery.rateyo.min.css')); ?>"> <?php $__env->stopPush(); ?>
<?php $__env->startPush('js'); ?> <script src="<?php echo e(asset('backend/js/jquery.rateyo.min.js')); ?>"></script> <script> $(document).ready(function() { $("#rateYo").rateYo({ starWidth: '30px', fullStar: true, mormalFill: 'yellow', ratedFill: 'orange', onSet: function(rating, rateYoInstance) { $('#rating').val(rating); } }); }); </script> <script> setTimeout(() => { $('.jq-ry-normal-group').addClass('d-flex'); $('.jq-ry-normal-group').addClass('gap-1'); }, 1000); </script>
<script> // Submit Rating modal script start $(document).ready(function() { $('#submit-rating-review').click(function(e) { e.preventDefault();
var form = $('#review-modal form'); var formData = form.serialize();
$.ajax({ type: 'POST', url: form.attr('action'), data: formData, success: function(data) { // Clear existing flash messages $('.flash-messages').empty();
if (data.success) { // Create a text node with the message var successMessage = document.createTextNode(data.message); var successAlert = $( '<div class="rounded-md bg-green-50 p-4 text-green-800"></div>' ).append(successMessage); // Append the success message to the flash-messages element //$('.flash-messages').append(successAlert); // Optionally, you can clear the form or close the modal here //$('#description').val(''); // Clear the textarea //$('#rating').val(''); // Clear the stars rating window.location.href = data.redirectUrl; } else { // Create a text node with the message var errorMessage = document.createTextNode(data.message); var errorAlert = $( '<div class="rounded-md bg-red-50 p-4 text-red-800"></div>') .append(errorMessage); // Append the error message to the flash-messages element $('.flash-messages').append(errorAlert); } }, error: function(xhr, status, error) { // Handle AJAX error $('.flash-messages').empty(); if (xhr.status === 422) { // If the status code is 422 (validation error), display validation errors var errors = JSON.parse(xhr.responseText); var errorHtml = '<div class="rounded-md bg-red-50 p-4 text-red-800"><ul>'; $.each(errors.errors, function(key, value) { errorHtml += '<li>' + value + '</li>'; }); errorHtml += '</ul></div>'; $('.flash-messages').html(errorHtml); } else { // Handle other errors // Create a text node with the error message var errorText = document.createTextNode('An error occurred: ' + error); var errorAlert = $( '<div class="rounded-md bg-red-50 p-4 text-red-700"></div>') .append(errorText); // Append the error message to the flash-messages element $('.flash-messages').append(errorAlert); } } }); }); }); // Submit Rating script end </script>
<?php $__env->stopPush(); ?> <?php /**PATH /home/picotech/domains/classify.picotech.app/public_html/resources/views/frontend/seller/hero.blade.php ENDPATH**/ ?>
|