Файловый менеджер - Редактировать - /home/clickysoft/public_html/somni.clickysoft.net/storage/framework/views/fdc3baf1dedf10764d35afdd61b0cf6f.php
Назад
<?php $__env->startSection('title', 'Messages - SOMNI'); ?> <?php $__env->startSection('content'); ?> <div class="db-backdrop"></div> <div class="main-section"> <div class="tooltip-text" id="tooltip1" tool-tip="1"> <div class="tooltip-close"> <button class="tt-close"><img src="<?php echo e(asset('/images/close-tt.svg')); ?>" alt="" class="img-fluid"></button> </div> <div class="tooltip-head"> <h4>Navigation</h4> <p>From here you can view a quick snapshot of occupancy rates, upcoming maintenance, and financial summaries.</p> </div> <div class="hide-next-cta"> <div class="hide-tips"> <button class="hide-tips"><img src="<?php echo e(asset('/images/hide-tt.svg')); ?>" alt="" class="hide-tt">Hide these tips</button> </div> <div class="next-tips"> <button class="next-tip-btn">Next</button> </div> </div> </div> <?php if($user->roles()->where('title', 'Tenant')->exists()): ?> <?php if (isset($component)) { $__componentOriginal71c6471fa76ce19017edc287b6f4508c = $component; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.tenant-side-nav','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?> <?php $component->withName('tenant-side-nav'); ?> <?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($__componentOriginal71c6471fa76ce19017edc287b6f4508c)): ?> <?php $component = $__componentOriginal71c6471fa76ce19017edc287b6f4508c; ?> <?php unset($__componentOriginal71c6471fa76ce19017edc287b6f4508c); ?> <?php endif; ?> <?php else: ?> <?php if (isset($component)) { $__componentOriginald201b4de0485c0604d1d04a0d3c62719 = $component; } ?> <?php $component = App\View\Components\LandlordSideNav::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?> <?php $component->withName('landlord-side-nav'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\LandlordSideNav::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($__componentOriginald201b4de0485c0604d1d04a0d3c62719)): ?> <?php $component = $__componentOriginald201b4de0485c0604d1d04a0d3c62719; ?> <?php unset($__componentOriginald201b4de0485c0604d1d04a0d3c62719); ?> <?php endif; ?> <?php endif; ?> <main class="layout-main"> <div class="content-wrapper"> <section class="profile-edit"> <div class="container-fluid custom-container"> <div class="row "> <div class="col-md-12"> <div class="main-db-layout"> <div class="mobile-nav-view"> <div class="db-nav"> <ul> <!-- <li><a href="javascript:void(0)" class="active">Home</a></li> --> <li><a href="javascript:void(0)">All Properties</a></li> <li><a href="javascript:void(0)">Add Property</a></li> </ul> </div> <!--here component--> <?php if (isset($component)) { $__componentOriginalac9c7b31882976d7e74498851bef36d0 = $component; } ?> <?php $component = App\View\Components\User\Dropdown::resolve(['user' => $user] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?> <?php $component->withName('user.dropdown'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\User\Dropdown::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($__componentOriginalac9c7b31882976d7e74498851bef36d0)): ?> <?php $component = $__componentOriginalac9c7b31882976d7e74498851bef36d0; ?> <?php unset($__componentOriginalac9c7b31882976d7e74498851bef36d0); ?> <?php endif; ?> </div> <div class="row"> <div class="col-md-12 col-lg-12"> <div class="mod-heads"> <h3> Messages </h3> <p>Placerat tempor ultricies bibendum fermentum turpis viverra nulla nullam</p> </div> <div class="mesage-box"> <div class="tabs-sec"> <div class="row"> <div class="col-md-12 col-lg-3"> <div class="message-left"> <div class="user-chat"> <div class="user-thumb-name"> <div class="user-thumb"> <p>R</p> <span class="chat-dot active"></span> </div> <div class="user-thumb-name-cont"> <h5><?php echo e(Auth::user()->name); ?></h5> <p class="online">Online</p> </div> </div> </div> <ul class="nav nav-tabs message-tabs" role="tablist"> <?php $__currentLoopData = $combinedData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <li class="nav-item" role="presentation"> <button class="nav-link <?php echo e($key === 0 ? 'active' : ''); ?>" id="home-<?php echo e($key); ?>-tab" data-bs-toggle="tab" data-bs-target="#home-<?php echo e($key); ?>" type="button" role="tab" aria-controls="home-<?php echo e($key); ?>" aria-selected="true"> <div class="user-chat-selection"> <div class="user-thumb"> <p>C</p> <span class="chat-dot active"></span> </div> <div class="user-thumb-name-cont"> <h5><?php echo e($data['name']); ?> </h5> <span class="chat-message-counter counter-<?php echo e($data['sender_id']); ?>"> <?php echo e(\App\Models\ChatMessage::where('receiver_id', auth()->user()->id)->where('sender_id', $data['sender_id'])->where('status', 'unread')->count()); ?> </span> <p class="online online-<?php echo e($data['sender_id']); ?>" style="display: none">Online </p> <p class="offline offline-<?php echo e($data['sender_id']); ?>" style="">offline </p> <span class="typing-tc typing-tc-<?php echo e($data['sender_id']); ?>-<?php echo e(Auth::user()->id); ?>" style="display: none">typing.... </span> </div> </div> </button> </li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </ul> <div class="need-help-button"> <button type="button" class="help-btn">Need Help?</button> </div> </div> </div> <div class="col-md-12 col-lg-9 d-flex flex-column"> <div class="tab-content"> <?php $__currentLoopData = $combinedData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="tab-pane fade <?php echo e($loop->first ? 'show active' : ''); ?>" id="home-<?php echo e($loop->index); ?>" role="tabpanel" aria-labelledby="home-<?php echo e($loop->index); ?>-tab"> <div class="message-panel" id="msg-panel<?php echo e($data['sender_id']); ?>"> <div class="force-flow h-100"> <div class="chat-right-main"> <div class="sender-left-<?php echo e($data['sender_id']); ?>-<?php echo e(Auth::user()->id); ?> unread"> <?php $__currentLoopData = $data['messages']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($message->status === 'read'): ?> <?php if($message->sender_id == auth()->id()): ?> <div class="chat-message-right read"> <div class="flex-column"> <span class="chat-username-time">Me, <?php echo e($message->created_at->diffForHumans()); ?></span> <div class="cht-box-right"> <p><?php echo e($message->message); ?> </p> </div> </div> </div> <?php else: ?> <div class="chat-message-left read"> <span class="chat-username-time"><?php echo e($data['name']); ?>, <?php echo e($message->created_at->diffForHumans()); ?></span> <div class="cht-box"> <p><?php echo e($message->message); ?> </p> </div> </div> <?php endif; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <div class="unread-bar-divider"> <h4>Unread <span></span></h4> </div> <?php $__currentLoopData = $data['messages']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($message->status === 'unread'): ?> <?php if($message->sender_id == auth()->id()): ?> <div class="chat-message-right unread-message---" data-message-id="<?php echo e($message->id); ?>"> <div class="flex-column"> <span class="chat-username-time">Me, <?php echo e($message->created_at->diffForHumans()); ?></span> <div class="cht-box-right"> <p><?php echo e($message->message); ?> </p> </div> </div> </div> <?php else: ?> <div class="chat-message-left unread-message-left unread-message" data-message-id="<?php echo e($message->id); ?>"> <span class="chat-username-time"><?php echo e($data['name']); ?>, <?php echo e($message->created_at->diffForHumans()); ?></span> <div class="cht-box"> <p><?php echo e($message->message); ?> </p> </div> </div> <?php endif; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <div class="chat-message-left"> <div class="typing typing-<?php echo e($data['sender_id']); ?>-<?php echo e(Auth::user()->id); ?>" style="display:none;"> <div class="dot"></div> <div class="dot"></div> <div class="dot"></div> </div> </div> </div> </div> </div> </div> <div class="message-send-box"> <div class="strt-type-field"> <input type="text" class="message-input" placeholder="Start typing here"> </div> <div class="attatch-send"> <div class="attatchment-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="21" viewBox="0 0 18 21" fill="none"> <path d="M8.49782 8.88379L5.18235 12.3374C4.33841 13.2165 4.33841 14.5979 5.18235 15.4771C6.02629 16.3562 7.35248 16.3562 8.19641 15.4771L15.4302 7.94189C16.9372 6.37207 16.9372 3.86034 15.4302 2.29052C13.9231 0.720694 11.5119 0.720694 10.0049 2.29052L2.16828 10.4536C-0.00184255 12.7142 -0.00184243 16.3562 2.16828 18.6167C4.33841 20.8773 7.83473 20.8773 10.0049 18.6167L13.9231 14.5352" stroke="#079E00" stroke-linecap="round" stroke-linejoin="round" /> </svg> </div> <div class="send-message-button"> <button type="button" data-receiver-user-id="<?php echo e($data['sender_id']); ?>" class="smssg-btn">Send</button> </div> </div> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> </div> </main> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://www.gstatic.com/firebasejs/8.3.2/firebase.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <link href="https://cdn.jsdelivr.net/npm/sweetalert2@11.7.27/dist/sweetalert2.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.7.27/dist/sweetalert2.all.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"> </script> <script src="<?php echo e(asset('/js/global.js')); ?>"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script src="https://cdn.socket.io/4.6.0/socket.io.min.js"></script> <script> <?php if(!empty($verification)): ?> toastr.options = { "closeButton": true, "progressBar": true } toastr.warning("<?php echo e($verification); ?>"); <?php endif; ?> </script> <script> let ip_address = "<?php echo e(env('SOCKET_URL')); ?>"; let socket_port = '4000'; const senderId = <?php echo e(auth()->id()); ?>; // let socket = io("wss://" + ip_address + ':' + socket_port); let host = "wss://" + ip_address + ':' + socket_port; //TODO:move to .env file const queryParams = { userId: senderId }; const socket = io(host, { // upgrade: false, query: queryParams, // reconnection: false, // rejectUnauthorized: false }); socket.once("connect", () => { socket.on("online", (userId) => { console.log(userId, "Is Online!"); jQuery('.online-' + userId).css("display", "flex"); jQuery('.offline-' + userId).css("display", "none"); }); socket.on("offline", (userId) => { jQuery('.online-' + userId).css("display", "none"); jQuery('.offline-' + userId).css("display", "flex"); }); }); const messageInputList = document.querySelectorAll('.message-input'); messageInputList.forEach((messageInput) => { messageInput.addEventListener('keydown', (e) => { const inputField = e.target; const button = inputField.closest('.message-send-box').querySelector('.smssg-btn'); if (button) { const receiverId = button.getAttribute('data-receiver-user-id'); socket.emit('typing', senderId, receiverId); } }); }); document.querySelectorAll('.smssg-btn').forEach((button) => { button.addEventListener('click', () => { const container = button.closest('.message-send-box'); const messageInput = container.querySelector('.message-input'); const message = messageInput.value; const receiverId = button.getAttribute('data-receiver-user-id'); let messageContainer = document.getElementById('msg-panel' + receiverId); messageContainer.scrollTop = messageContainer.scrollHeight; socket.emit('private chat message', message, senderId, receiverId); var html = '<div class="chat-message-right"><div class="flex-column"><span class="chat-username-time">Me, 0 second ago</span><div class="cht-box-right"><p>' + message + '</p></div></div>'; $('.unread').append(html); $.ajax({ type: 'POST', url: '<?php echo e(route('send.message')); ?>', data: { '_token': '<?php echo e(csrf_token()); ?>', 'sender_id': senderId, 'receiver_id': receiverId, 'message': message }, success: function(response) { console.log('Message saved successfully'); }, error: function(error) { console.error('Failed to save message'); } }); messageInput.value = ''; }); }); socket.on('private chat message', (message, senderId, receiverId) => { $.get('/chat-user-data', (data) => { var userData = data.userData; var serverTime = data.serverTime; var html = '<div class="chat-message-left"><span class="chat-username-time">' + userData.name + ', ' + serverTime + '</span><div class="cht-box"><p>' + message + '</p></div></div>'; $('.sender-left-' + senderId + '-' + receiverId).append(html); let messageContainer = document.getElementById('msg-panel' + receiverId); messageContainer.scrollTop = messageContainer.scrollHeight; }); }); socket.on('typing', (senderId, receiverId) => { const typingIndicator = document.querySelector('.typing-' + senderId + '-' + receiverId); const typingIndicatorTc = document.querySelector('.typing-tc-' + senderId + '-' + receiverId); var typingIndicatorHtml = '<div class="chat-message-left"><div class="typing"><div class="dot"></div> <div class="dot"></div><div class="dot"></div></div></div>'; if ($('.sender-left-' + senderId + '-' + receiverId + ' .typing').length === 0) { $('.sender-left-' + senderId + '-' + receiverId).append(typingIndicatorHtml); } let messageContainer = document.getElementById('msg-panel' + senderId); messageContainer.scrollTop = messageContainer.scrollHeight; // if (typingIndicator) { // typingIndicator.style.display = 'block'; // } if (typingIndicatorTc) { typingIndicatorTc.style.display = 'block'; } setTimeout(() => { // if (typingIndicator) { $('.sender-left-' + senderId + '-' + receiverId + ' .typing').remove(); // typingIndicator.style.display = 'none'; typingIndicatorTc.style.display = 'none'; // } }, 3000); }); </script> <script> document.addEventListener("DOMContentLoaded", function() { let io; // Define io in a higher scope $('button[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) { // Delay the setup to ensure the new tab content is fully rendered setTimeout(function() { setupIntersectionObserver(); }, 1000); }); function reportIntersection(entries) { entries.forEach(entry => { if (entry.isIntersecting) { var messageId = entry.target.getAttribute('data-message-id'); console.log('data-message-id:', messageId); io.unobserve(entry.target); $.ajax({ type: 'POST', url: '<?php echo e(route('mark.message.as.read')); ?>', // Replace with your route data: { '_token': '<?php echo e(csrf_token()); ?>', 'id': messageId }, success: function(response) { if (response.senderdiv) { $('.' + response.senderdiv).find('.unread-bar-divider') .prepend(response.html); console.log('Message marked as read successfully'); } }, error: function(error) { console.error('Failed to mark message as read'); } }); entry.target.remove(); // setTimeout(() => { // entry.target.remove(); // }, 100); // entry.target.remove(); // entry.target.classList.remove('unread-message'); // let html = entry.target; // let activeTab = document.querySelector('.tab-pane.show.active'); // let messagePanel = activeTab.querySelector('.message-panel'); // let unread = messagePanel.querySelector('.unread').className; // let c = unread.replace(/\s+/g, '.'); // let b = jQuery(messagePanel).find('.' + c).find('.unread-bar-divider'); // b.prepend(html); } }); } function setupIntersectionObserver() { function reportIntersection(entries) { entries.forEach(entry => { if (entry.isIntersecting) { var messageId = entry.target.getAttribute('data-message-id'); console.log('data-message-id:', messageId); let number = 0; const activeTab = document.querySelector('.tab-pane.show.active'); const messagePanelId = activeTab.querySelector('.message-panel').id; const match = messagePanelId.match( /\d+/); // This RegEx extracts one or more digits if (match) { const number = match[0]; console.log(number); } io.unobserve(entry.target); $.ajax({ type: 'POST', url: '<?php echo e(route('mark.message.as.read')); ?>', // Replace with your route data: { '_token': '<?php echo e(csrf_token()); ?>', 'id': messageId, 'sender_id': document.querySelector('.tab-pane.show.active') .querySelector('.message-panel').id.match( /\d+/)[0], }, success: function(response) { if (response.senderdiv) { $('.' + response.senderdiv).find('.unread-bar-divider') .prepend(response.html); $(response.countdiv).text(response.count); console.log('Message marked as read successfully'); } }, error: function(error) { console.error('Failed to mark message as read'); } }); setTimeout(() => { entry.target.remove(); }, 100); // entry.target.remove(); // entry.target.classList.remove('unread-message'); // let html = entry.target; // let activeTab = document.querySelector('.tab-pane.show.active'); // let messagePanel = activeTab.querySelector('.message-panel'); // let unread = messagePanel.querySelector('.unread').className; // let c = unread.replace(/\s+/g, '.'); // let b = jQuery(messagePanel).find('.' + c).find('.unread-bar-divider'); // b.prepend(html); } }); } var activeTab = document.querySelector('.tab-pane.show.active'); if (activeTab) { const container = activeTab.querySelector('.message-panel'); io = new IntersectionObserver(reportIntersection, { root: container, rootMargin: '0px', threshold: 0.5 }); activeTab.querySelectorAll('.unread-message').forEach(item => { io.observe(item); }); } } setupIntersectionObserver(); }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make( ($user->roles()->where('title', 'Tenant')->exists()) ? 'tenant.layouts.tenant' : 'landlord.layouts.landlord', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/clickysoft/public_html/somni.clickysoft.net/resources/views/chat/message.blade.php ENDPATH**/ ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка