@extends('admin.layout.main')
@section('content')
<div class="row">
    <div class="col-lg-12" style="padding-left: 4px;padding-right: 4px;">
        <div class="card m-b-30" style="border-radius: 5px;">
            <div class="card-header">
                <div class="row">
                    <div class="col">
                        <h5 class="card-title" style="font-weight: bold; padding-top: 15px; font-size: 20px;">Message List</h5>
                    </div>
                   
                </div>
            </div>
            <div class="card-body">
                    
                <div class="table-responsive">
                    <table id="datatable" class="display table table-striped table-bordered" style="width: 100%;border: 1px solid rgb(49, 76, 88);">
                        <thead style="background: #e1efb438;">
                            <tr>
                                <th style="text-align: center; color: #ffdc0b !important;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">No.</th>
                                <th style="color: #ffdc0b !important;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Username</th>
                                <th style="color: #ffdc0b !important;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Name</th>
                                <th style="color: #ffdc0b !important;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Email</th>
                                <th style="text-align: center; color: #ffdc0b !important;padding-top: 3px;padding-bottom: 3px;font-size: 13px;width: 90px;">Action</th>                                    
                            </tr>
                        </thead>
                        
                        <tbody>
                        	<?php $no=1; ?>
            				@foreach($mess as $msg)
                            <tr>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff !important;">{{$no++}}</td> 
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff !important;">{{$msg->username}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff !important;min-width: 130px">{{$msg->name}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff !important;">{{$msg->email}}</td> 
                                
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff !important;width: 90px;min-width: 90px;">
                                    <div class="button-group" style="display: flex;">
                                    <a href="#" data-toggle="modal" data-target="#view_{{$msg->id}}" class="btn btn-sm" style="padding: 0px 6px; margin: 0px;" ><i style="color: #97ffcc" class="fa fa-eye"></i> </a>
                                    <div class="modal fade" id="view_{{$msg->id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                      <div class="modal-dialog" role="document">
                                        <div class="modal-content">  
                                            <h4 style="text-align: center; padding-top: 12px;color: black;">Message #</h4>    
                                          <div class="modal-body">
                                            <p style="color: #000; font-style: italic; padding: 3px;">{!! $msg->message !!}</p>
                                            
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <a href="{{url('admin/msg/reply/'.$msg->id)}}" class="btn btn-sm" style="padding: 0px 6px; margin: 0px;" ><i style="color: #ff97fd" class="fa fa-reply"></i> </a>

                                    @if($msg->status == 0)
                                    <form action="{{url('admin/msg/done')}}" method="post">@csrf
                                        <input type="hidden" name="msg_id" value="{{$msg->id}}">
                                        <button type="submit" style="padding: 0px 6px; margin: 0px;" class="btn btn-sm"><i style="color: #befdff" class="fa fa-check"></i> </button>
                                    </form>
                                    @else
                                    <button disabled="disabled" style="padding: 0px 6px; margin: 0px;" class="btn btn-sm"><i style="color: #befdff" class="fa fa-check"></i> </button>
                                    @endif

                                    <a href="{{url('admin/msg/dlt/'.$msg->id)}}" style="padding: 0px 6px; margin: 0px;" class="btn btn-sm confirmDelete"><i style="color: red" class="fa fa-trash"></i></a>
                                    </div>
                                </td>
                              
                               
                            </tr>
                            @endforeach
                        </tbody>                      
                  
                    </table>
                </div>
            </div>
        </div>
    </div>
   
</div>

@endsection