Current File : /home/tradevaly/public_html/resources/views/user/pages/message/messages.blade.php
@extends('user.ayaan.master')


@push('title','Message')

@push('style')

@endpush

@section('content')
<div class="main-content">
<div class="container-fluid">
    <div class="page-content">
        <div class="container-fluid">
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                        <h4 class="mb-sm-0 font-size-18">Inbox</h4>

                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);">Email</a></li>
                                <li class="breadcrumb-item active">Inbox</li>
                            </ol>
                        </div>

                    </div>
                </div>
            </div>
            <!-- end page title -->

            <div class="row">
                <div class="col-12">
                    <!-- Left sidebar -->
                    <div class="email-leftbar card">
                        <!--<button type="button" class="btn btn-danger btn-block waves-effect waves-light" data-bs-toggle="modal" data-bs-target="#composemodal">-->
                        <!--    Compose-->
                        <!--</button>-->
                        <div class="mail-list mt-4">
                            <a href="javascript: void(0);" class="active"><i class="mdi mdi-email-outline me-2"></i> Inbox <span class="ms-1 float-end">(18)</span></a>
                            <a href="javascript: void(0);"><i class="mdi mdi-star-outline me-2"></i>Read</a>
                            <a href="javascript: void(0);"><i class="mdi mdi-diamond-stone me-2"></i>Unread</a>
                            <a href="javascript: void(0);"><i class="mdi mdi-email-check-outline me-2"></i>Sent Mail</a>
                        </div>

                    </div>
                    <!-- End Left sidebar -->


                    <!-- Right Sidebar -->
                    <div class="email-rightbar mb-3">
                        
                        <div class="card">
                            <!--<div class="btn-toolbar p-3" role="toolbar">-->
                            <!--    <div class="btn-group me-2 mb-2 mb-sm-0">-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect"><i class="fa fa-inbox"></i></button>-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect"><i class="fa fa-exclamation-circle"></i></button>-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect"><i class="far fa-trash-alt"></i></button>-->
                            <!--    </div>-->
                            <!--    <div class="btn-group me-2 mb-2 mb-sm-0">-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect" data-bs-toggle="dropdown" aria-expanded="false">-->
                            <!--            <i class="fa fa-folder"></i> <i class="mdi mdi-chevron-down ms-1"></i>-->
                            <!--        </button>-->
                            <!--        <div class="dropdown-menu">-->
                            <!--            <a class="dropdown-item" href="#">Updates</a>-->
                            <!--            <a class="dropdown-item" href="#">Social</a>-->
                            <!--            <a class="dropdown-item" href="#">Team Manage</a>-->
                            <!--        </div>-->
                            <!--    </div>-->
                            <!--    <div class="btn-group me-2 mb-2 mb-sm-0">-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect" data-bs-toggle="dropdown" aria-expanded="false">-->
                            <!--            <i class="fa fa-tag"></i> <i class="mdi mdi-chevron-down ms-1"></i>-->
                            <!--        </button>-->
                            <!--        <div class="dropdown-menu">-->
                            <!--            <a class="dropdown-item" href="#">Updates</a>-->
                            <!--            <a class="dropdown-item" href="#">Social</a>-->
                            <!--            <a class="dropdown-item" href="#">Team Manage</a>-->
                            <!--        </div>-->
                            <!--    </div>-->

                            <!--    <div class="btn-group me-2 mb-2 mb-sm-0">-->
                            <!--        <button type="button" class="btn btn-primary waves-light waves-effect" data-bs-toggle="dropdown" aria-expanded="false">-->
                            <!--            More <i class="mdi mdi-dots-vertical ms-2"></i>-->
                            <!--        </button>-->
                            <!--        <div class="dropdown-menu">-->
                            <!--            <a class="dropdown-item" href="#">Mark as Unread</a>-->
                            <!--            <a class="dropdown-item" href="#">Mark as Important</a>-->
                            <!--            <a class="dropdown-item" href="#">Add to Tasks</a>-->
                            <!--            <a class="dropdown-item" href="#">Add Star</a>-->
                            <!--            <a class="dropdown-item" href="#">Mute</a>-->
                            <!--        </div>-->
                            <!--    </div>-->
                            <!--</div>-->
                            <ul class="message-list">
                                @foreach($messages as $message)
                                <li class="{{($message->seen==null)?'unread':''}}">
                                    <div class="col-mail col-mail-1">
                                        <div class="checkbox-wrapper-mail">
                                            <input type="checkbox" id="chk19">
                                            <label for="chk19" class="toggle"></label>
                                        </div>
                                        <a href="{{route('user.message.view',$message->chat_id)}}" class="title">
                                            @if($message->person_one == auth()->id())
                                                @if(isset($message->personTwo->name))
                                                {{$message->personTwo->name}}
                                                @else
                                                Acount Deleted
                                                @endif
                                            @else
                                                @if(isset($message->personOne->name))
                                                {{$message->personOne->name}}
                                                @else
                                                Acount Deleted
                                                @endif
                                            @endif
                                            {!!($message->seen==null)?'<span class=text-warning>unread</span>':''!!}
                                        </a>
                                        <span class="star-toggle far fa-star"></span>
                                    </div>
                                    <div class="col-mail col-mail-2">
                                        <a href="{{route('user.message.view',$message->chat_id)}}" class="subject">
                                            @if($message->last_message==null)
                                            Lets Start To chat with 
                                            @if($message->person_one == auth()->id())
                                                @if(isset($message->personTwo->name))
                                                {{$message->personTwo->name}}
                                                @else
                                                <strong class="text-warning">Acount Deleted</strong>
                                                @endif
                                            @else
                                                @if(isset($message->personOne->name))
                                                {{$message->personOne->name}}
                                                @else
                                                <strong class="text-warning">Acount Deleted</strong>
                                                @endif
                                            @endif
                                            @else
                                            {{$message->last_message}}
                                            @endif
                                        </a>
                                        <div class="date">{{$message->updated_at->format('M y');}}</div>
                                    </div>
                                </li>
                                @endforeach

                            </ul>

                        </div><!-- card -->

                        <div class="row">
                            <div class="col-7">
                                <!--Showing 1 - 20 of 1,524-->
                            </div>
                            <div class="col-5">
                                <div class="btn-group float-end">
                                    <button type="button" class="btn btn-sm btn-success waves-effect"><i class="fa fa-chevron-left"></i></button>
                                    <button type="button" class="btn btn-sm btn-success waves-effect"><i class="fa fa-chevron-right"></i></button>
                                </div>
                            </div>
                        </div>

                    </div> <!-- end Col-9 -->

                </div>

            </div><!-- End row -->

        </div> <!-- container-fluid -->
    </div>
</div>
</div>

@push('script')