98 lines
3.8 KiB
PHP
98 lines
3.8 KiB
PHP
@extends('layout')
|
|
|
|
@section('content')
|
|
<h1>{{ $event->title }} </h1>
|
|
<?php
|
|
setlocale(LC_ALL,'de_AT.utf8');
|
|
?>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="ui big label">
|
|
<i class="calendar icon"></i>
|
|
|
|
{{strftime('%d. %m. %Y', strtotime($event->start_date))}}
|
|
@if($event->end_date != $event->start_date)
|
|
bis {{strftime('%d. %m. %Y', strtotime($event->end_date))}}
|
|
@endif
|
|
</div>
|
|
<div class="ui big label">
|
|
<i class="clock icon"></i>
|
|
|
|
{{str_limit($event->starttime, $limit = 5, $end="")}}
|
|
</div>
|
|
|
|
@foreach($event->categories as $cat)
|
|
<a class="ui tag label">{{$cat->name}}</a>
|
|
@endforeach
|
|
|
|
{!! $event->text !!}
|
|
|
|
<br/>
|
|
|
|
<?php
|
|
$now = new DateTime();
|
|
$timeDisableReservation = DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", strtotime('+2 hours', $now->getTimestamp()))); // just before the event (+2 bc of time zone diff)
|
|
$eventDate = DateTime::createFromFormat('Y-m-d H:i:s', $event->end_date . " " . $event->starttime);
|
|
?>
|
|
|
|
@if (($timeDisableReservation->getTimestamp() < $eventDate->getTimestamp()) || (Auth::check() && Auth::user()->isAdmin()))
|
|
@if($event->reservation()->first()->name != "Keine")
|
|
<br/>
|
|
<br/>
|
|
@if(count($event->seat()->get()) == 1)
|
|
@if($event->id !== 1310)
|
|
<a class="ui huge primary button" href="../book/{{$event->id}}-0">
|
|
Reservieren
|
|
</a>
|
|
@endif
|
|
@else
|
|
<div class="ui primary buttons">
|
|
<div class="ui floating dropdown icon button">
|
|
Reservieren
|
|
<i class="dropdown icon"></i>
|
|
<div class="menu">
|
|
<?php $count = 0; ?>
|
|
@foreach($event->seat()->get() as $seat)
|
|
<?php
|
|
$now = new DateTime();
|
|
$timeDisableReservation = DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", strtotime('+2 hours', $now->getTimestamp()))); // $now (+2 bc of time zone diff)
|
|
$eventDate = DateTime::createFromFormat('Y-m-d H:i:s', $seat->date . " " . $event->starttime);
|
|
?>
|
|
@if ($timeDisableReservation->getTimestamp() < $eventDate->getTimestamp())
|
|
<a class="item"
|
|
href="../book/{{$event->id}}-{{$count}}">{{strftime('%d. %m. %Y', strtotime($seat->date))}}</a>
|
|
@endif
|
|
<?php $count++; ?>
|
|
@endforeach
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="image">
|
|
{{ Html::image("/imgs/events/".$event->image, '', array('class' => 'ui image center', "style" => "width: 100%; max-width: 500px;margin: auto;")) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br/><br/>
|
|
|
|
|
|
@endsection
|
|
|
|
|
|
@section('scripts')
|
|
<script>
|
|
$('.ui.dropdown').dropdown();
|
|
</script>
|
|
@endsection
|