File: D:/HostingSpaces/SBogers10/hours.komma.pro/resources/views/notifications/index.blade.php
@extends('app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Berichten</h1>
<br>
<hr>
</div>
<div class="col-md-8 col-md-offset-2">
<div class="project" style="position: absolute; width: 95%;">
<div class="col-md-7">
<div class="row">
<div class="col-md-12">
<h5>
Er zijn geen openstaande meldingen.
</h5>
</div>
</div>
</div>
</div>
@foreach($notifications as $notification)
<div class="project @if(empty($notification->done_at) || $notification->done_at == '0000-00-00 00:00:00')active @else deleted @endif"
id="notification-{{$notification->id}}">
@if(empty($notification->done_at) || $notification->done_at == '0000-00-00 00:00:00')
<a href="{{$notification->url}}">
<div class="col-md-7">
<div class="row">
<div class="col-md-12">
<h2 class="title">
{{$notification->title}}
</h2>
</div>
</div>
</div>
<div class="col-md-3">
<span class="pull-right text-muted" style="margin-top: 19px">
<em>{{\Carbon\Carbon::parse($notification->created_at)->diffForHumans()}}</em>
</span>
</div>
<div class="col-md-12">
<p>{!!html_entity_decode($notification->message)!!}</p>
</div>
</a>
@else
<div class="col-md-7">
<div class="row">
<div class="col-md-12">
<h2 class="title">
{{$notification->title}}
</h2>
</div>
</div>
</div>
<div class="col-md-3">
<span class="pull-right text-muted" style="margin-top: 19px">
<em>{{\Carbon\Carbon::parse($notification->created_at)->diffForHumans()}}</em>
</span>
</div>
<div class="col-md-2">
<span class="glyphicon glyphicon-ok ckeck pull-right" id="{{$notification->id}}"
data-toggle="tooltip"
title="melding sluiten" aria-hidden="true"
style="top: -27px; cursor: pointer"></span>
</div>
<div class="col-md-12">
<p>{!!html_entity_decode($notification->message)!!}</p>
</div>
@endif
</div>
@endforeach
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="text-center">
{!! $notifications->appends(Request::except('page'))->render() !!}
</div>
</div>
</div>
</div>
@stop
@section('script')
<script type="text/javascript">
$(".glyphicon-ok").click(function () {
$id = $(this).attr('id');
console.log("delete " + $id);
$.ajax({
type: 'POST',
url: '/berichten/' + $id,
headers: {
'X-CSRF-TOKEN': $('input[name="_token"]').val()
},
success: function (data) {
console.log(data);
$('#notification-' + $id).fadeOut(300, function () {
$(this).remove();
});
},
error: function (jqXHR, textStatus) {
console.log('error');
console.log(jqXHR);
}
});
});
</script>
@stop