60 lines
2.5 KiB
PHP
60 lines
2.5 KiB
PHP
|
|
<a class="nav-link" data-toggle="dropdown" href="javascript:void(0)" title="Notifications" aria-expanded="false" data-animation="scale-up" role="button">
|
||
|
|
<i class="icon wb-bell" aria-hidden="true"></i>
|
||
|
|
<span class="badge badge-pill badge-danger up" id="notificationCount">{{ $count_not }}</span>
|
||
|
|
</a>
|
||
|
|
<div class="dropdown-menu dropdown-menu-right dropdown-menu-media" role="menu">
|
||
|
|
<div class="dropdown-menu-header">
|
||
|
|
<h5>{{ __('NOTIFICATIONS') }}</h5>
|
||
|
|
<span class="badge badge-round badge-danger">{{ __('New') }} {{ $count_not }}</span>
|
||
|
|
</div>
|
||
|
|
<div class="list-group">
|
||
|
|
<div data-role="container">
|
||
|
|
<div data-role="content">
|
||
|
|
@if($notifications)
|
||
|
|
@foreach($notifications as $notification)
|
||
|
|
@php
|
||
|
|
$workflow_document = App\WorkflowDocument::where('id', $notification->workflow_document_id)->first();
|
||
|
|
if(!$workflow_document)
|
||
|
|
$workflow_document = App\RemoteTransfer::where('id', $notification->workflow_document_id)->first();
|
||
|
|
@endphp
|
||
|
|
<div class="list-group-item dropdown-item" role="menuitem">
|
||
|
|
<div class="media">
|
||
|
|
<a href="{{ $notification->data['link'] }}" target="_blank">
|
||
|
|
<div class="media-body">
|
||
|
|
{{-- <h3 class="media-heading">{{ __($notification->data['type'])}}</h3> --}}
|
||
|
|
<h3 class="media-heading">{{ __($notification->data['action'])}} : {{$workflow_document->getRegNumber()}}</h3>
|
||
|
|
@php
|
||
|
|
$to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', Date('Y-m-d H:s:i'));
|
||
|
|
$from = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', $notification->created_at);
|
||
|
|
$diff_in_hours = $to->diffInHours($from);
|
||
|
|
$diff_in_minutes = $to->diffInMinutes($from);
|
||
|
|
$diffInDays = $to->diffInDays($from);
|
||
|
|
if($diffInDays > 0){
|
||
|
|
$time_deff = $diffInDays.' '.__('days ago');
|
||
|
|
}elseif($diff_in_hours > 0){
|
||
|
|
$time_deff = $diff_in_hours.' '.__('hours ago');
|
||
|
|
}elseif($diff_in_minutes > 0){
|
||
|
|
$time_deff = $diff_in_hours.' '.__('minutes ago');
|
||
|
|
}else{
|
||
|
|
$time_deff = __('Now');
|
||
|
|
}
|
||
|
|
@endphp
|
||
|
|
<time class="media-meta" datetime="2018-06-12T20:50:48+08:00"> {{ $time_deff }}</time>
|
||
|
|
</div>
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
@endforeach
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="dropdown-menu-footer">
|
||
|
|
<a class="dropdown-menu-footer-btn" href="{{ route('notifications.markAsRead') }}" role="button">
|
||
|
|
<span>{{__('Mark All Read')}}</span>
|
||
|
|
</a>
|
||
|
|
<a class="dropdown-item" href="{{ route('notification') }}" role="menuitem">
|
||
|
|
{{ __('All notifications') }}
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
</div>
|