0556c400834b0c2b95f139f8014ad4568235f70e.php 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php $__env->startSection('panel_content'); ?>
  2. <div class="aiz-titlebar mt-2 mb-4">
  3. <div class="h6">
  4. <span><?php echo e(translate('Conversations With ')); ?></span>
  5. <?php if($conversation->sender_id == Auth::user()->id && $conversation->receiver->shop != null): ?>
  6. <a href="<?php echo e(route('shop.visit', $conversation->receiver->shop->slug)); ?>" class=""><?php echo e($conversation->receiver->shop->name); ?></a>
  7. <?php endif; ?>
  8. </div>
  9. </div>
  10. <div class="card">
  11. <div class="card-header">
  12. <h5 class="card-title fs-16 fw-600 mb-0">#<?php echo e($conversation->title); ?>
  13. (
  14. <?php echo e(translate('Between you and')); ?>
  15. <?php if($conversation->sender_id == Auth::user()->id): ?>
  16. <?php echo e($conversation->receiver->name); ?>
  17. <?php else: ?>
  18. <?php echo e($conversation->sender->name); ?>
  19. <?php endif; ?>
  20. )
  21. </h5>
  22. </div>
  23. <div class="card-body">
  24. <ul class="list-group list-group-flush">
  25. <?php $__currentLoopData = $conversation->messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  26. <li class="list-group-item px-0">
  27. <div class="media mb-2">
  28. <img class="avatar avatar-xs mr-3" <?php if($message->user != null): ?> src="<?php echo e(uploaded_asset($message->user->avatar_original)); ?>" <?php endif; ?> onerror="this.onerror=null;this.src='<?php echo e(static_asset('assets/img/avatar-place.png')); ?>';">
  29. <div class="media-body">
  30. <h6 class="mb-0 fw-600">
  31. <?php if($message->user != null): ?>
  32. <?php echo e($message->user->name); ?>
  33. <?php endif; ?>
  34. </h6>
  35. <p class="opacity-50"><?php echo e($message->created_at); ?></p>
  36. </div>
  37. </div>
  38. <p>
  39. <?php echo e($message->message); ?>
  40. </p>
  41. </li>
  42. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  43. </ul>
  44. <form class="pt-4" action="<?php echo e(route('messages.store')); ?>" method="POST">
  45. <?php echo csrf_field(); ?>
  46. <input type="hidden" name="conversation_id" value="<?php echo e($conversation->id); ?>">
  47. <div class="form-group">
  48. <textarea class="form-control" rows="4" name="message" placeholder="<?php echo e(translate('Type your reply')); ?>" required></textarea>
  49. </div>
  50. <div class="form-group mb-0 text-right">
  51. <button type="submit" class="btn btn-primary"><?php echo e(translate('Send')); ?></button>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. <?php $__env->stopSection(); ?>
  57. <?php $__env->startSection('script'); ?>
  58. <script type="text/javascript">
  59. function refresh_messages(){
  60. $.post('<?php echo e(route('conversations.refresh')); ?>', {_token:'<?php echo e(@csrf_token()); ?>', id:'<?php echo e(encrypt($conversation->id)); ?>'}, function(data){
  61. $('#messages').html(data);
  62. })
  63. }
  64. refresh_messages(); // This will run on page load
  65. setInterval(function(){
  66. refresh_messages() // this will run after every 5 seconds
  67. }, 4000);
  68. </script>
  69. <?php $__env->stopSection(); ?>
  70. <?php echo $__env->make('frontend.layouts.user_panel', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/www.easybuyjp.shop/resources/views/frontend/user/conversations/show.blade.php ENDPATH**/ ?>