@extends('admin/layouts/default')

{{-- Page title --}}
@section('title')
Editor Logs List
@parent
@stop

{{-- page level styles --}}
@section('header_styles')
<link href="{{ asset('assets/css/pages/tables.css') }}" rel="stylesheet" type="text/css" />
<!-- end of page level css-->
@stop

{{-- Page content --}}
@section('content')
<section class="content-header">
    <!--section starts-->
    <h1>Editor Logs List</h1>
    <ol class="breadcrumb">
        <li>
            <a href="{{ route('admin.dashboard') }}">
                <i class="livicon" data-name="home" data-size="18" data-loop="true"></i>
                Dashboard
            </a>
        </li>
        <li class="active">Editor Logs List</li>
    </ol>
</section>
<!--section ends-->
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="portlet box primary">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="livicon" data-name="responsive" data-size="16" data-loop="true" data-c="#fff" data-hc="white"></i>
                        Editor Logs List
                    </div>
                </div>
                <div class="portlet-body table-responsive">
                        <table class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>Name</th>
                                    <th>Email</th>
                                    <th>Verification Request Type</th>
                                    <th>Comment</th>
                                    <th>Request Status</th>
                                    <th>Added by</th>
                                    <th>Request Date</th>
                                    <th>Approve / Reject by</th>
                                    <th>Action Date</th>
                                </tr>
                            </thead>
                            <tbody>
                                @if (count($log_list) > 0)
                                @foreach ($log_list as $log)
                                <tr>
                                    <td>@if(!empty($log->full_name))
                                        {{$log->full_name}}
                                        @else
                                        {{$log->fname.' '.$log->mname.' '.$log->lname}}
                                        @endif
                                    </td>
                                    <td>@if(!empty($log->editor_email))
                                        {{$log->editor_email}}
                                        @else
                                        {{$log->email}}
                                        @endif
                                    </td>
                                    <td>@if($log->verification_comment == "Edit Editor")
                                        {{"Request to"}} <b>CHANGE Editor Information</b>
                                        @elseif($log->verification_comment == "Delete Editor")
                                        {{"Request to"}} <b>DELETE Editor</b>
                                        @elseif($log->verification_comment == "Editor Status Active")
                                        {{"Change Editor Status"}} <b>(Currently BLOCK)</b>
                                        @elseif($log->verification_comment == "Editor Status Block")
                                        {{"Change Editor Status"}} <b>(Currently ACTIVE)</b>
                                        @elseif($log->ebm_verification_comment == "Add Editor Role")
                                        {{"Request to"}} <b>ADD New Editor Role</b>
                                        @elseif($log->ebm_verification_comment == "Delete Editor Role")
                                        {{"Request to"}} <b>DELETE Editor Role</b>
                                        @elseif($log->ebm_verification_comment == "Edit Editor Role")
                                        {{"Request to"}} <b>CHANGE Editor Role Information</b>
                                        @endif
                                    </td>
                                    <td>
                                        @if($log->ebm_verification_comment == "Add Editor Role" || $log->ebm_verification_comment == "Delete Editor Role" || $log->ebm_verification_comment == "Edit Editor Role")
                                        {{$log->ebm_comment}}
                                        @else
                                        {{$log->editor_comment}}
                                        @endif
                                    </td>
                                    <td>@if($log->verification_status == "approve" || $log->ebm_verification_status == "approve")
                                    <span class="label label-success m-t-10 d-block m-r-15 m-l-15">{{"Approve"}}</span>
                                        @elseif($log->verification_status == "reject" || $log->ebm_verification_status == "reject")
                                        <span class="label label-danger m-t-10 d-block m-r-15 m-l-15">{{"Reject"}}</span>
                                        @endif
                                    </td>
                                    <td>
                                        @if($log->ebm_verification_comment == "Add Editor Role" || $log->ebm_verification_comment == "Delete Editor Role" || $log->ebm_verification_comment == "Edit Editor Role")
                                        {{$log->ebm_add_user}}
                                        @else
                                        {{$log->editor_add_user}}
                                        @endif
                                    </td>
                                    <td>
                                        @if($log->ebm_verification_comment == "Add Editor Role" || $log->ebm_verification_comment == "Delete Editor Role" || $log->ebm_verification_comment == "Edit Editor Role")
                                        {{gmdate("d-m-Y", $log->ebm_created_on)}}
                                        @else
                                        {{date('d-m-Y', strtotime($log->created_on))}}
                                        @endif
                                    </td>
                                    <td>
                                        @if($log->ebm_verification_comment == "Add Editor Role" || $log->ebm_verification_comment == "Delete Editor Role" || $log->ebm_verification_comment == "Edit Editor Role")
                                        {{$log->ebm_updated_by}}
                                        @else
                                        {{$log->editor_updated_by}}
                                        @endif
                                    </td>
                                    <td>
                                        @if($log->ebm_verification_comment == "Add Editor Role" || $log->ebm_verification_comment == "Delete Editor Role" || $log->ebm_verification_comment == "Edit Editor Role")
                                        {{date('d-m-Y', strtotime($log->ebm_updated_on))}}
                                        @else
                                        {{date('d-m-Y', strtotime($log->updated_on))}}
                                        @endif
                                    </td>
                                </tr>
                                @endforeach
                                @else
                                <tr>
                                    <td colspan="9">
                                        <center>Empty</center>
                                    </td>
                                </tr>
                                @endif
                            </tbody>
                        </table>
                    </div>
            </div>
        </div>
    </div>
</section>

@stop
{{-- page level scripts --}}
@section('footer_scripts')
@stop