Booking, QI Content, Trees, Media

This commit is contained in:
Kevin Adametz 2019-10-02 20:03:55 +02:00
parent 1f340e96fa
commit 7fbac395a9
260 changed files with 27160 additions and 3773 deletions

View file

@ -2,6 +2,40 @@
@section('content')
<style>
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn-xs {
line-height: 1.3em;
}
.table tbody + tbody {
border-top: 1px solid #9c9c9c;
}
.table th, .table td {
border-top: none;
}
.table tr.border-none td, .table tr.border-none th {
border-top: none;
}
.table .thead-dark th {
color: #4E5155;
background-color: rgba(24, 28, 33, 0.1);
border-color: rgba(63, 69, 74, 0.1);
}
.input-group-text {
padding: 0.438rem 0.475rem;
}
</style>
<h4 class="font-weight-bold py-3 mb-1">
Buchung verwalten
</h4>
@ -24,8 +58,19 @@
{{ Form::text('id', $booking->id, array('placeholder'=>__('Nr.'), 'class'=>'form-control', 'id'=>'booking_id', 'readonly')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="booking_id">{{ __('Gesamtpreis Organisation') }}</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('price', $booking->price, array('placeholder'=>__('Gesamtpreis'), 'class'=>'form-control', 'id'=>'price', 'readonly')) }}
</div>
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('bookings')}}" class="btn btn-default">{{ __('zur Übersicht') }}</a>
@ -39,123 +84,119 @@
<div class="text-right mb-2">
<button type="submit" name="action" value="addItemUp" class="btn btn-sm btn-primary"><i class="far fa-plus"></i> Neue Leistung hinzufügen <i class="far fa-arrow-up"></i></button>
</div>
<div id="dragula-drag-handles">
@foreach($booking->booking_draft_items as $booking_draft_item)
<!-- item -->
<div class="card mb-2" @if($booking_draft_item->draft_type) style="background-color: {{ $booking_draft_item->draft_type->color }}" @endif>
<div class="card-body row" style="">
<div class="form-group col-md-3 col-12">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$booking_draft_item->id}}][draft_type_id]" id="draft_item_{{$booking_draft_item->id }}_draft_type_id" data-live-search="true" required>
<option value="" disabled>Vorlagen-Typ*</option>
{!! HTMLHelper::getDraftTypes($booking_draft_item->draft_type_id) !!}
</select>
</div>
<div class="form-group col-md-3 col-4">
{{ Form::text('draft_item['.$booking_draft_item->id.'][start_date]', $booking_draft_item->start_date, array('placeholder'=>__('Start Datum'), 'class'=>'form-control datepicker-base', 'id'=>'draft_item_'.$booking_draft_item->id.'_start_dat')) }}
</div>
<div class="form-group col-md-3 col-4">
{{ Form::text('draft_item['.$booking_draft_item->id.'][end_date]', $booking_draft_item->end_date, array('placeholder'=>__('End Datum'), 'class'=>'form-control datepicker-base', 'id'=>'draft_item_'.$booking_draft_item->id.'_end_date')) }}
</div>
<div class="form-group col-md-3 col-4 text-right">
<h5 class="float-right mt-1">#{{ $i++ }} </h5>
<span class=" handle ion ion-ios-move d-inline-block bg-primary text-white p-2 mr-2 mb-1"></span>
<button type="submit" name="action" value="up_{{$booking_draft_item->id}}" class="btn btn-xs btn-default"><i class="fa fa-arrow-up"></i> </button>
<button type="submit" name="action" value="down_{{$booking_draft_item->id}}" class="btn btn-xs btn-default mr-2"><i class="fa fa-arrow-down"></i> </button>
</div>
@if(in_array($booking_draft_item->draft_type_id, [36, 37]))
<div class="form-group col-sm-3 col-3">
<div class="table-responsive mb-4">
<table class="table mb-0" id="table_dragula_tbody" style="min-width: 1080px">
<thead class="thead-dark">
<tr>
<th style="width: 1em"></th>
<th style="width: 1em">#</th>
<th>Leistung</th>
<th style="width: 9em">Datum von</th>
<th style="width: 9em">Datum bis</th>
<th style="width: 15em">Teilnehmer/EP</th>
<th style="width: 15em">Kinder/EP</th>
<th style="width: 8em">#</th>
</tr>
</thead>
@foreach($booking->booking_draft_items as $booking_draft_item)
<tbody class="draft_item_tbody">
<tr @if($booking_draft_item->draft_type) style="background-color: {{ $booking_draft_item->draft_type->color }}" @endif>
<td>
<span class="handle ion ion-ios-move d-inline-block bg-primary text-white p-1"></span>
</td>
<td><span class="item_pos_number">{{ $i++ }}</span></td>
<td>
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$booking_draft_item->id}}][draft_type_id]" id="draft_item_{{$booking_draft_item->id }}_draft_type_id" data-live-search="true" required>
<option value="" disabled>Vorlagen-Typ*</option>
{!! HTMLHelper::getDraftTypes($booking_draft_item->draft_type_id) !!}
</select>
</td>
<td>
{{ Form::text('draft_item['.$booking_draft_item->id.'][start_date]', $booking_draft_item->start_date, array('placeholder'=>__('Start Datum'), 'class'=>'form-control datepicker-base', 'id'=>'draft_item_'.$booking_draft_item->id.'_start_dat')) }}
</td>
<td>
{{ Form::text('draft_item['.$booking_draft_item->id.'][end_date]', $booking_draft_item->end_date, array('placeholder'=>__('End Datum'), 'class'=>'form-control datepicker-base', 'id'=>'draft_item_'.$booking_draft_item->id.'_end_date')) }}
</td>
@if(in_array($booking_draft_item->draft_type_id, [24, 26, 30, 31, 32, 33, 34, 35, 36, 37, 41]))
<td>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">A:</span>
</div>
{{ Form::text('draft_item['.$booking_draft_item->id.'][days_duration]', $booking_draft_item->days_duration, array('placeholder'=>__('Anzahl Tage'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_days_duration',)) }}
<select class="custom-select" name="draft_item[{{$booking_draft_item->id}}][adult]" id="draft_item_{{$booking_draft_item->id }}_adult">
<option value="">0</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->adult, 10, '') !!}
</select>
{{ Form::text('draft_item['.$booking_draft_item->id.'][price_adult]', $booking_draft_item->price_adult, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price_adult', 'maxlength'=>10)) }}
<span class="input-group-append">
<span class="input-group-text"></span>
</span>
</div>
</div>
<div class="form-group col-sm-7 col-5">
@else
<div class="form-group col-sm-10 col-8">
@endif
{{ Form::textarea('draft_item['.$booking_draft_item->id.'][service]', $booking_draft_item->service, array('placeholder'=>__('Leistungen'), 'class'=>'form-control autoExpand', 'id'=>'draft_item_'.$booking_draft_item->id.'_service', 'rows'=>'1', 'data-min-rows'=>'1')) }}
</div>
<div class="form-group col-sm-2 col-4">
<div class="text-right mt-2 float-right">
<a class="text-danger" href="{{ route('booking_draft_item_delete', [$booking_draft_item->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="far fa-trash-alt"></i></a>
</div>
<label class="custom-control custom-checkbox mt-2" style="margin-right: 20px;">
{!! Form::checkbox('draft_item['.$booking_draft_item->id.'][in_pdf]', 1, $booking_draft_item->in_pdf, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('in PDF')}}</span>
</label>
</div>
@if(in_array($booking_draft_item->draft_type_id, [24, 26, 30, 31, 32, 33, 34, 35, 36, 37]))
<div class="form-group col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$booking_draft_item->id}}][adult]" id="draft_item_{{$booking_draft_item->id }}_adult">
<option value="">Teilnehmer</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->adult, 10, ' T.') !!}
</select>
</div>
<div class="form-group col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$booking_draft_item->id.'][price_adult]', $booking_draft_item->price_adult, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price_adult',)) }}
</div>
</div>
<div class="form-group col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$booking_draft_item->id}}][children]" id="draft_item_{{$booking_draft_item->id}}_children">
<option value="">Kinder</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->children, 10, ' K.') !!}
</select>
</div>
<div class="form-group col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$booking_draft_item->id.'][price_children]', $booking_draft_item->price_children, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price_children')) }}
</div>
</div>
@endif
@if(in_array($booking_draft_item->draft_type_id, [38, 39,40]))
<div class="form-group col-3">
</td>
<td>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"> </span>
</div>
{{ Form::text('draft_item['.$booking_draft_item->id.'][price]', $booking_draft_item->price, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price',)) }}
<select class="custom-select" name="draft_item[{{$booking_draft_item->id}}][children]" id="draft_item_{{$booking_draft_item->id}}_children">
<option value="">0</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->children, 10, '') !!}
</select>
{{ Form::text('draft_item['.$booking_draft_item->id.'][price_children]', $booking_draft_item->price_children, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price_children')) }}
<span class="input-group-append">
<span class="input-group-text"></span>
</span>
</div>
</div>
@if(in_array($booking_draft_item->draft_type_id, [38]))
<div class="form-group col-sm-3 col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">A:</span>
</div>
{{ Form::text('draft_item['.$booking_draft_item->id.'][days_duration]', $booking_draft_item->days_duration, array('placeholder'=>__('Anzahl Tage'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_days_duration',)) }}
</div>
</div>
@endif
</td>
@else
<td>-</td>
<td>-</td>
@endif
<td>
<button type="button" name="" value="up_{{$booking_draft_item->id}}" class="btn btn-xs btn-primary py-0 move-up-btn"><i class="fa fa-arrow-up"></i> </button>
<button type="button" name="" value="down_{{$booking_draft_item->id}}" class="btn btn-xs btn-primary mr-2 move-down-btn"><i class="fa fa-arrow-down"></i> </button>
<a class="text-danger" href="{{ route('booking_draft_item_delete', [$booking_draft_item->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="far fa-trash-alt"></i></a>
</td>
</tr>
<tr @if($booking_draft_item->draft_type) style="background-color: {{ $booking_draft_item->draft_type->color }}" @endif class="border-none">
@if(in_array($booking_draft_item->draft_type_id, [36, 37]))
<td colspan="3">
<select class="custom-select" name="draft_item[{{$booking_draft_item->id}}][days_duration]" id="draft_item_{{$booking_draft_item->id }}_days_duration">
<option value="">0 Tage</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->days_duration, 40, ' Tage') !!}
</select>
</td>
<td colspan="4">
@elseif(in_array($booking_draft_item->draft_type_id, [38, 39,40]))
<td colspan="3">
<div class="input-group">
@if(in_array($booking_draft_item->draft_type_id, [38]))
<select class="custom-select" name="draft_item[{{$booking_draft_item->id}}][days_duration]" id="draft_item_{{$booking_draft_item->id }}_days_duration">
<option value="">0 Tage</option>
{!! HTMLHelper::getRangeOptions($booking_draft_item->days_duration, 40, ' T.') !!}
</select>
@endif
{{ Form::text('draft_item['.$booking_draft_item->id.'][price]', $booking_draft_item->price, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$booking_draft_item->id.'_price',)) }}
<span class="input-group-append">
<span class="input-group-text"></span>
</span>
</div>
</td>
<td colspan="4">
@else
<td colspan="7">
@endif
{{ Form::textarea('draft_item['.$booking_draft_item->id.'][service]', $booking_draft_item->service, array('placeholder'=>__('Leistungen'), 'class'=>'form-control autoExpand', 'id'=>'draft_item_'.$booking_draft_item->id.'_service', 'rows'=>'1', 'data-min-rows'=>'1')) }}
</td>
<td>
<label class="custom-control custom-checkbox mt-2" style="margin-right: 20px;">
{!! Form::checkbox('draft_item['.$booking_draft_item->id.'][in_pdf]', 1, $booking_draft_item->in_pdf, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('in PDF')}}</span>
</label>
</td>
</div>
</div>
@endforeach
</tr>
</tbody>
@endforeach
</table>
</div>
@endif
@ -173,11 +214,54 @@
{!! Form::close() !!}
<script>
$(document).ready(function() {
$.dragYScroll();
var sort_item_pos_number = function(){
var index = 1;
$('#table_dragula_tbody .draft_item_tbody').each(function () {
$(this).find('.item_pos_number').html(index);
$(this).data('rowPosition', index);
index++;
});
};
$(function() {
// Drag handle
var sortableItems = dragula([$('#table_dragula_tbody')[0]], {
moves: function (el, container, handle) {
return handle.classList.contains('handle');
}
});
sortableItems.on('dragend', function() {
//sort new
sort_item_pos_number();
});
});
$('table .move-up-btn').on('click', function () {
var thisRow = $(this).closest('tbody');
var prevRow = thisRow.prev();
if (prevRow.length) {
prevRow.before(thisRow);
sort_item_pos_number()
}
});
$('table .move-down-btn').on('click', function () {
var thisRow = $(this).closest('tbody');
var nextRow = thisRow.next();
if (nextRow.length) {
nextRow.after(thisRow);
sort_item_pos_number()
}
});
});
</script>
@endsection